On Wed, Sep 11, 2013 at 4:07 PM, Klaus Aehlig <[email protected]> wrote:

> On Wed, Sep 11, 2013 at 02:58:34PM +0200, Michele Tartara wrote:
> > On Wed, Sep 11, 2013 at 12:27 PM, Klaus Aehlig <[email protected]>
> wrote:
> >
> > > Before doing any changes, make tools/users-setup explain its
> > > actions first, and ask the user for confirmation. If the first
> > > argument is -y, this step will be skipped.
> > >
> >
> > Most ganeti CLI tools use --yes-do-it instead of -y as the parameter to
> > perform these safety checks. Shouldn't we do the same here?
>
> Yes, you're right. We should use --yes-do-it here.
>
> > > +         $(AWK) -- '{print "echo + Will add group ",$$1; count++}\
> > > +                    END {if (count ==0) {print "echo + No groups to
> > > add"}}' doc/users/groups; \
> > >
> >
> > Missing whitespace between == and 0
>
> done
>
> >
> > +         $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with
> > > pimary group",$$2} \
> > >
> >
> > s/pimary/primary
>
> done
>
>     Interdiff
>
> diff --git a/Makefile.am b/Makefile.am
> index 2f8134d..04f7cf0 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1380,11 +1380,11 @@ tools/kvm-ifup: tools/kvm-ifup.in$(REPLACE_VARS_SED)
>  tools/users-setup: Makefile $(userspecs)
>         set -e; \
>         { echo '#!/bin/sh'; \
> -         echo 'if [ "x$$1" != "x-y" ];'; \
> +         echo 'if [ "x$$1" != "x--yes-do-it" ];'; \
>           echo 'then echo "This will do the following changes"'; \
>           $(AWK) -- '{print "echo + Will add group ",$$1; count++}\
> -                    END {if (count ==0) {print "echo + No groups to
> add"}}' doc/users/groups; \
> -         $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with
> pimary group",$$2} \
> +                    END {if (count == 0) {print "echo + No groups to
> add"}}' doc/users/groups; \
> +         $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with
> primary group",$$2} \
>                                   else {print "echo + Will add user",$$1};
> count++}\
>                      END {if (count == 0) {print "echo + No users to
> add"}}' doc/users/users; \
>           $(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}'
> doc/users/groupmemberships; \
>
>
> Also, reworded the log-message to say --yes-do-it instead of -y.
>
> --
> Klaus Aehlig
> Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
>

LGTM, thanks.

Michele

-- 
Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to