Issue #7485 has been updated by Jacob  McCann.

Not sure how to use github, but did my best.

I propose 
https://github.com/jmccann/puppet/commit/26ce9c79672d578e9aa03d8341d8c315fcf30c8b

This replaces '--quiet' with '-n'.

This works for SLES10 and SLES11.  I haven't tested on opensuse but can if need 
be ... I'd assume it works though.

This is better for a couple reasons:

Replacing --quiet with --terse serves no purpose.  --quiet is to reduce output 
and --terse is to produce machine readable (for scripting) output.

--quiet is not really needed at all as far as I can tell.

-n should be added regardless.  This runs zypper in a non-interactive mode, so 
if prompts come up that do not allow default answers (which -l and -y try to 
give some default answers, but these will not always be accepted) then it will 
know just to die and not 'hang' as well as actually 'auto answering' more 
questions that maybe are not [y/n] in nature.  From man:

       -n, --non-interactive
              Switches to non-interactive mode. In this mode zypper  doesn't  
ask
              user  to  type answers to various prompts, but uses default 
answers
              automatically. The behaviour of this option is  somewhat  
different
              than  that of options like '--yes', since zypper can answer 
differ-
              ent answers to different questions.  The  answers  also  depend  
on
              other options like '--no-gpg-checks'.

I have been using the change i propose on SLES10 (sp3 and sp4) and SLES11 (sp1) 
for about a year now.

If there is a better way to present my commit above let me know! :)
----------------------------------------
Bug #7485: zypper 0.6 not working with puppet (default version in SLES 10.4 and 
earlier)
https://projects.puppetlabs.com/issues/7485

Author: Thomas Willert
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: 
Category: package
Target version: 
Affected Puppet version: 
Keywords: zypper sles package provider
Branch: 


The Puppet package provider "zypper" is not working for zypper version 0.6. 
This version is the default version in SLES 10.x. Zypper version 1.0 is not 
available until SLES11.x.
The zypper provider is asuming version 1.x as it is using the command options 
"-l", "-y" and "--quiet".
I am using these versions:
    Puppet 2.7.0
    Facter 1.5.7
    zypper-0.6.200-0.4.49
Error message:
    err: /Stage[main]/Sudo/Package[sudo]/ensure: change from absent to present 
failed: Execution of '/usr/bin/zypper --quiet install -l -y sudo' returned 2: 
Unknown option --quiet
    Unknown command '_unknown'.

>From looking at 
>"/usr/lib64/ruby/site_ruby/1.8/puppet/provider/package/zypper.rb" I can see 
>that this provider is coded for zypper 1.0 only. See line 25.
For zypper 0.6 to non-interactive way to install a (sudo) rpm is:
    # zypper -n install sudo
For 0.6 compability the Ruby code for zypper should be extended to include a 
version check.
For version 1.0 do this (same as current):
    # /usr/bin/zypper --quiet install -l -y sudo
For version 0.6 do this:
    # /usr/bin/zypper -n install sudo
     


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to