From ba096482941b394ddda2afb2f07739d954ce5f4d Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 28 Jan 2009 16:45:07 +0000 Subject: * in case of error during creation of bootmenu files, the demuxer no longer stops, but catches the exception and continues to run, showing any errors in the final summary git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2538 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig-demuxer | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'config-db/slxconfig-demuxer') diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index b9f2a8dd..9badee07 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -56,6 +56,8 @@ my ( # number of system configurations written $systemErrCount, # number of systems that had errors + $bootEnvErrCount, + # number of boot environments that had errors $clientSystemConfCount, # number of (system-specific) client configurations written $initramfsCount, @@ -153,12 +155,18 @@ writeConfigurations(); my $wr = $option{dryRun} ? 'would have written' : 'wrote'; my $errCount = $systemErrCount ? $systemErrCount : 'no'; -my $statusString +my $systemStatusString = $systemErrCount ? "$errCount system(s) had errors" : 'all systems ok'; +$errCount = $bootEnvErrCount ? $bootEnvErrCount : 'no'; +my $bootEnvStatusString + = $bootEnvErrCount + ? "$errCount boot environment(s) had errors" + : 'all boot-environments ok'; print "\n", unshiftHereDoc(<<"End-of-Here"); $wr $systemConfCount system-specific and $clientSystemConfCount client-specific configurations $initramfsCount initramfs were created - $statusString + $systemStatusString + $bootEnvStatusString End-of-Here $openslxDB->disconnect(); @@ -355,7 +363,16 @@ sub writeBootloaderMenus # now write bootloader menu with all bootable systems for this client my $bootEnv = bootEnvironmentForType($client->{attrs}->{boot_type}); my $externalID = externalIDForClient($client); - $bootEnv->writeBootloaderMenuFor($client, $externalID, \@systemInfos); + my $success = eval { + $bootEnv->writeBootloaderMenuFor( + $client, $externalID, \@systemInfos + ); + 1; + }; + if (!$success) { + print STDERR $@; + $bootEnvErrCount++; + } } return; } -- cgit v1.2.3-55-g7522