From 8d7793b86e27824d14ba454377e839939f499008 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 16 Mar 2007 22:38:07 +0000 Subject: * added the options '--list-clients', '--list-exports', '--list-systems' and '--list-vendor-oses' which trigger a list of the respective objects that as defined in the config-DB. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@778 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/config-db/slxconfig b/config-db/slxconfig index 6e2b7c72..cd87e0f9 100755 --- a/config-db/slxconfig +++ b/config-db/slxconfig @@ -33,6 +33,10 @@ use OpenSLX::DBSchema; my ( $helpReq, + $listClientsReq, + $listExportsReq, + $listSystemsReq, + $listVendorOSesReq, $manReq, $verbose, $versionReq, @@ -40,6 +44,10 @@ my ( GetOptions( 'help|?' => \$helpReq, + 'list-clients' => \$listClientsReq, + 'list-exports' => \$listExportsReq, + 'list-systems' => \$listSystemsReq, + 'list-vendor-oses' => \$listVendorOSesReq, 'man' => \$manReq, 'verbose' => \$verbose, 'version' => \$versionReq, @@ -56,6 +64,40 @@ openslxInit(); my $openslxDB = OpenSLX::ConfigDB->new(); $openslxDB->connect(); +if ($listClientsReq) { + print _tr("List of the clients defined in config-DB:\n"); + print join('', map { "\t$_->{name}\n" } +# grep { $_->{id} > 0 } + sort { $a->{name} cmp $b->{name} } + $openslxDB->fetchClientByFilter()); + exit 1; +} + +if ($listExportsReq) { + print _tr("List of the exports defined in config-DB:\n"); + print join('', map { "\t$_->{name}\n" } + sort { $a->{name} cmp $b->{name} } + $openslxDB->fetchExportByFilter()); + exit 1; +} + +if ($listSystemsReq) { + print _tr("List of the systems defined in config-DB:\n"); + print join('', map { "\t$_->{name}\n" } +# grep { $_->{id} > 0 } + sort { $a->{name} cmp $b->{name} } + $openslxDB->fetchSystemByFilter()); + exit 1; +} + +if ($listVendorOSesReq) { + print _tr("List of the vendor-OSes defined in config-DB:\n"); + print join('', map { "\t$_->{name}\n" } + sort { $a->{name} cmp $b->{name} } + $openslxDB->fetchVendorOSByFilter()); + exit 1; +} + my $action = shift @ARGV; if ($action =~ m[^add-system$]i) { addSystemToConfigDB(@ARGV); -- cgit v1.2.3-55-g7522