Hi Bernard,

On Mon, Apr 11, 2011 at 01:55:49PM -0700, Bernard Li wrote:
> Hi Thomas:
> 
> Does this work?

this does work.

Just one remark: your implementation for @528/530 makes the
"default" behavior for update_script equal to updating the script,
i.e.  if no --update_script is given, it is equivalent to
--update_script=yes as the exit is not executed. Is that the
expected behavior? I do not know how often people customize their
image.script by hand after it was initially created and who do not
want to have it overwritten accidentially.

Best,

thomas

> 
> Index: sbin/si_getimage
> ===================================================================
> --- sbin/si_getimage  (revision 4539)
> +++ sbin/si_getimage  (working copy)
> @@ -197,10 +197,12 @@
>  }
> 
>  # be sure $update_script was passed a proper option
> -unless(
> -       ($update_script eq "yes")
> -    or ($update_script eq "no" )
> -) { die "\n$program_name: --update-script must be yes or 
> no.\n$get_help\n\n"; }
> +if (defined $update_script) {
> +  unless(
> +         ($update_script eq "yes")
> +      or ($update_script eq "no" )
> +  ) { die "\n$program_name: --update-script must be yes or
> no.\n$get_help\n\n"; }
> +}
> 
>  SystemImager::Server->validate_ip_assignment_option($ip_assignment_method);
>  SystemImager::Server->validate_post_install_option($post_install);
> @@ -528,7 +530,9 @@
>  }
> 
>  # if we don't need to update the master script, then exit -- we're done
> -unless($update_script eq "yes") { exit 0; }
> +if (defined $update_script) {
> +  unless($update_script eq "yes") { exit 0; }
> +}
> 
>  ### END Overwrite $script_name.master? ###
> 
> Thanks,
> 
> Bernard
> 
> On Fri, Apr 8, 2011 at 7:58 AM, Thomas Zeiser
> <thomas.zei...@rrze.uni-erlangen.de> wrote:
> > On Thu, Apr 07, 2011 at 05:11:26PM -0700, Bernard Li wrote:
> >> This seems to be a better patch, as it also catches if the user
> >> specified --update-script '' on the CLI:
> >>
> >> Index: sbin/si_getimage
> >> ===================================================================
> >> --- sbin/si_getimage  (revision 4539)
> >> +++ sbin/si_getimage  (working copy)
> >> @@ -197,10 +197,12 @@
> >>  }
> >>
> >>  # be sure $update_script was passed a proper option
> >> -unless(
> >> -       ($update_script eq "yes")
> >> -    or ($update_script eq "no" )
> >> -) { die "\n$program_name: --update-script must be yes or 
> >> no.\n$get_help\n\n"; }
> >> +if (defined $update_script) {
> >> +  unless(
> >> +         ($update_script eq "yes")
> >> +      or ($update_script eq "no" )
> >> +  ) { die "\n$program_name: --update-script must be yes or
> >> no.\n$get_help\n\n"; }
> >> +}
> >>
> >>  SystemImager::Server->validate_ip_assignment_option($ip_assignment_method);
> >>  SystemImager::Server->validate_post_install_option($post_install);
> >
> > That's only half of the storry; you also need the following part;
> >
> > ==========
> > @@ -531,7 +531,7 @@
> >  }
> >
> >  # if we don't need to update the master script, then exit -- we're
> >  # done
> > -unless($update_script eq "yes") { exit 0; }
> > +unless((defined($update_script)) and ($update_script eq "yes")) { exit 0; }
> >
> >  ### END Overwrite $script_name.master? ###
> >
> > ==========
> >
> >
> > Best,
> >
> > thomas

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
sisuite-users mailing list
sisuite-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to