--- nfo/perl/libs/Data/Storage/Container.pm 2002/12/01 07:08:35 1.2 +++ nfo/perl/libs/Data/Storage/Container.pm 2002/12/01 22:18:28 1.3 @@ -1,8 +1,12 @@ ################################################ # -# $Id: Container.pm,v 1.2 2002/12/01 07:08:35 joko Exp $ +# $Id: Container.pm,v 1.3 2002/12/01 22:18:28 joko Exp $ # # $Log: Container.pm,v $ +# Revision 1.3 2002/12/01 22:18:28 joko +# - no interactive implicit deploy +# + only test integrity if storage available +# # Revision 1.2 2002/12/01 07:08:35 joko # + needs to "use Data::Storage;" # @@ -133,24 +137,19 @@ # should we test availability of the storage before using it? if ($locator->{test_availability}) { + $locator->{status}->{availability} = $storage->testAvailability(); if ( !$storage->testAvailability() ) { - $logger->error( "$log_prefix is not available" ); - return; + $logger->error( "$log_prefix: testAvailability failed" ); } } # should we test integrity of the storage before using it? - if ($locator->{test_integrity}) { + if ($locator->{status}->{availability} && $locator->{test_integrity}) { #return unless $storage->testIntegrity(); $locator->{status}->{integrity} = $storage->testIntegrity(); # actions if integrity fails if (!$locator->{status}->{integrity}) { - $logger->error( "testIntegrity failed on $log_prefix" ); - print "Try a $locator->{name}.deploySchema()? (y/n) "; - my $res = ; - if ($res =~ m/y/i) { - $storage->deploySchema(); - } + $logger->error( "$log_prefix: testIntegrity failed" ); } } @@ -159,19 +158,20 @@ # don't connect right here, do an implicit connect on (later) usage # maybe set ->{meta}->{connectmethod} = "connect" here #return unless $storage->connect(); - $storage->connect(); + $storage->connect() if $locator->{status}->{integrity}; # should we check emptyness? - if ( $locator->{test_emptyness} && $locator->{status}->{integrity} ) { + if ($locator->{status}->{availability} && $locator->{test_emptyness}) { + #print "test empty", "\n"; if ( !@{$storage->getChildNodes()} ) { $locator->{status}->{empty} = 1; - $logger->warning( "$log_prefix is empty"); + $logger->warning( "$log_prefix: Storage is empty."); #return; } } # expand logging? - if ( $locator->{logger} && $locator->{status}->{integrity} ) { + if ( $locator->{status}->{integrity} && $locator->{logger} ) { # expand logging (to Tangram-Database) # TODO: # - move configuration data from this code to db_config somehow @@ -188,6 +188,7 @@ } #$self->{storage}->{$name} = $storage; + #print "add storage: $name", "\n"; $self->addStorage($name, $storage); return 1;