summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2006-06-21 10:22:46 +0000
committerAntoine Ginies <aginies@mandriva.com>2006-06-21 10:22:46 +0000
commit41d0a26437dd06eb5e15d84299831507b000078e (patch)
tree947eee7bfe15a5431a14113ea21f2c06dbc186d7
parent02da6659361e7e1b8469b535d0245daf05df01a0 (diff)
downloaddrakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar
drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar.gz
drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar.bz2
drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.tar.xz
drakwizard-41d0a26437dd06eb5e15d84299831507b000078e.zip
fix ask_warn for nisautofs wizard
-rwxr-xr-xnfs_wizard/NFS.pm16
-rw-r--r--nisautofs_wizard/Nisautofs.pm5
2 files changed, 12 insertions, 9 deletions
diff --git a/nfs_wizard/NFS.pm b/nfs_wizard/NFS.pm
index 4b19dd9e..eedf6259 100755
--- a/nfs_wizard/NFS.pm
+++ b/nfs_wizard/NFS.pm
@@ -52,21 +52,23 @@ $o->{pages} = {
name => N("NFS Server Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the NFS server for your network."),
no_back => 1,
pre => sub {
- $in->ask_warn((""), N("You should now use draknfs to configure your NFS share."));
+ $in->ask_warn((""), N("You should now use draknfs to configure your NFS share.")) or $in->exit;
},
next => 'nfs'
},
nfs => {
name => N("NFS server") . "\n\n" .N("Directory which will be exported to NFS clients. This directory will be exported in read only mode. It denies any request which requires changes to the filesystem."),
data => [
- { label => N("Directory:"), val => \$o->{var}{wiz_nfs_dir} },
+ { label => N("Directory:"), val => \$o->{var}{wiz_nfs_dir} },
+ { label => N("Create directory if it doesn't exist"), type => 'bool', val => \$o->{var}{create_missing_directory} },
],
complete => sub {
- if (! -d $o->{var}{wiz_nfs_dir}) {
- $in->ask_warn(N("Error"), N("The path you entered does not exist."));
- return 1;
- }
- },
+ if (!-d $o->{var}{wiz_nfs_dir} and $o->{var}{create_missing_directory}) {
+ mkdir_p($o->{var}{wiz_nfs_dir});
+ } elsif (!-d $o->{var}{wiz_nfs_dir}) {
+ $in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually."));
+ return 1; }
+ },
next => 'ask_level'
},
ask_level => {
diff --git a/nisautofs_wizard/Nisautofs.pm b/nisautofs_wizard/Nisautofs.pm
index 8e3b1dad..39742e7e 100644
--- a/nisautofs_wizard/Nisautofs.pm
+++ b/nisautofs_wizard/Nisautofs.pm
@@ -32,6 +32,7 @@ use MDK::Wizard::Wizcommon;
# test root capa
my $wiz = new MDK::Wizard::Wizcommon;
+my $in = interactive->vnew;
#my $NISDOMAIN = $wiz->{net}->network_get("NISDOMAIN");
my $NISDOMAIN = chomp_(`nisdomainname`);
@@ -92,8 +93,8 @@ $o->{pages} = {
if (!-d $o->{var}{HOMENIS} and $o->{var}{create_missing_directory}) {
mkdir_p($o->{var}{HOMENIS});
} elsif (!-d $o->{var}{HOMENIS}) {
- $::in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually."));
- return 0; }
+ $in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually."));
+ return 1; }
},
next => 'summaryserver',
},