From af43d09c7b6fe260189736dced4b7652207df5a4 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 29 Sep 2006 12:45:09 +0000 Subject: * moved confirmatory question to setup-test-data script, as that's where it is needed (the test script uses a database of its own now). git-svn-id: http://svn.openslx.org/svn/openslx/trunk@399 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/setup-test-data-simple.pl | 25 +++++++++++++++++++++++++ config-db/test-config-demuxer.pl | 26 +++----------------------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/config-db/setup-test-data-simple.pl b/config-db/setup-test-data-simple.pl index fdf6a0e6..675b0c5f 100755 --- a/config-db/setup-test-data-simple.pl +++ b/config-db/setup-test-data-simple.pl @@ -7,10 +7,35 @@ use lib $FindBin::Bin; use OpenSLX::Basics; use OpenSLX::ConfigDB qw(:access :manipulation); +use Getopt::Long qw(:config pass_through); +my $clobber; +GetOptions( + 'clobber' => \$clobber + # clobber causes this script to overwrite the database without asking +); + openslxInit(); my $openslxDB = connectConfigDB(); +if (!$clobber) { + my $yes = _tr('yes'); + my $no = _tr('no'); + my @systems = fetchSystemsByFilter($openslxDB); + my @clients = fetchClientsByFilter($openslxDB); + print _tr(qq[This will overwrite the current OpenSLX-database with an example dataset. +All your data (%s systems and %s clients) will be lost! +Do you want to continue(%s/%s)? ], scalar(@systems), scalar(@clients), $yes, $no); + my $answer = <>; + if ($answer !~ m[^\s*$yes]i) { + print "no - stopping\n"; + exit 5; + } + print "yes - starting...\n"; +} + +emptyDatabase($openslxDB); + my $vendorOs1Id = addVendorOS($openslxDB, { 'name' => "suse-10", 'comment' => "SuSE 10.0 Default-Installation", diff --git a/config-db/test-config-demuxer.pl b/config-db/test-config-demuxer.pl index 5918b0d7..0494a413 100755 --- a/config-db/test-config-demuxer.pl +++ b/config-db/test-config-demuxer.pl @@ -8,32 +8,12 @@ use lib $FindBin::Bin; use OpenSLX::Basics; use OpenSLX::ConfigDB qw(:access :manipulation); -use Getopt::Long qw(:config pass_through); -my $clobber; -GetOptions( - 'clobber' => \$clobber - # clobber causes this script to overwrite the database without asking -); - openslxInit(); -my $openslxDB = connectConfigDB(); +$openslxConfig{'db-name'} = 'openslx_testscript'; + # make sure to use a database of our own! -if (!$clobber) { - my $yes = _tr('yes'); - my $no = _tr('no'); - my @systems = fetchSystemsByFilter($openslxDB); - my @clients = fetchClientsByFilter($openslxDB); - print _tr(qq[This will overwrite the current OpenSLX-database with an example dataset. -All your data (%s systems and %s clients) will be lost! -Do you want to continue(%s/%s)? ], scalar(@systems), scalar(@clients), $yes, $no); - my $answer = <>; - if ($answer !~ m[^\s*$yes]i) { - print "no - stopping\n"; - exit 5; - } - print "yes - starting...\n"; -} +my $openslxDB = connectConfigDB(); emptyDatabase($openslxDB); -- cgit v1.2.3-55-g7522