summaryrefslogtreecommitdiffstats
path: root/config-db
diff options
context:
space:
mode:
authorOliver Tappe2006-09-29 14:45:09 +0200
committerOliver Tappe2006-09-29 14:45:09 +0200
commitaf43d09c7b6fe260189736dced4b7652207df5a4 (patch)
tree7623050dadab3b9caa0ab7bc6527bd433513daa1 /config-db
parent* removed unfinished XML-implementation as I encounter several problems with (diff)
downloadcore-af43d09c7b6fe260189736dced4b7652207df5a4.tar.gz
core-af43d09c7b6fe260189736dced4b7652207df5a4.tar.xz
core-af43d09c7b6fe260189736dced4b7652207df5a4.zip
* 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
Diffstat (limited to 'config-db')
-rwxr-xr-xconfig-db/setup-test-data-simple.pl25
-rwxr-xr-xconfig-db/test-config-demuxer.pl26
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);