Jesse Wolfe | 1 Dec 01:05 2009
Picon

[PATCH/puppet 1/1] Fixing 2849 puppet changes sshkey alias every run if it is blank

Puppet was mis-parsing sshkey aliases when the last alias is an empty
string.
This is due to the counter-intuitive behavior of Ruby's String#split.

Signed-off-by: Jesse Wolfe <jes5199 <at> gmail.com>
---
 lib/puppet/provider/sshkey/parsed.rb |    8 +++-----
 spec/unit/provider/sshkey/parsed.rb  |   19 +++++++++++++++++++
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100755 spec/unit/provider/sshkey/parsed.rb

diff --git a/lib/puppet/provider/sshkey/parsed.rb b/lib/puppet/provider/sshkey/parsed.rb
index 0dc791b..4673b57 100755
--- a/lib/puppet/provider/sshkey/parsed.rb
+++ b/lib/puppet/provider/sshkey/parsed.rb
 <at>  <at>  -19,11 +19,9  <at>  <at>  Puppet::Type.type(:sshkey).provide(:parsed,

     record_line :parsed, :fields => %w{name type key},
         :post_parse => proc { |hash|
-            if hash[:name] =~ /,/
-                names = hash[:name].split(",")
-                hash[:name] = names.shift
-                hash[:alias] = names
-            end
+            names = hash[:name].split(",", -1)
+            hash[:name]  = names.shift
+            hash[:alias] = names
         },
         :pre_gen => proc { |hash|
             if hash[:alias]
(Continue reading)

Markus Roberts | 1 Dec 01:57 2009

Re: [PATCH/puppet 1/1] Fixing 2849 puppet changes sshkey alias every run if it is blank

+1, but isn't:

            names = hash[:name].split(",", -1)
            hash[:name]  = names.shift
            hash[:alias] = names

just a verbose way of saying:

            hash[:name],*hash[:alias] = hash[:name].split(",", -1)

-- Markus

--

You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Luke Kanies | 1 Dec 08:34 2009

Re: Alternative to facts-in-query

On Nov 30, 2009, at 2:32 AM, Christian Hofstaedtler wrote:

>> With the 'retry' functionality in ruby, the caller never knows of a
>> problem unless none of the servers work.  You pick a new server,
>> reconnect, and keep going.  I can't think of anything that would
>> reasonably restart the whole run itself.
>
> I had a simpler mechanism in mind:
>
> Do the server selection only once per run. See if it "works" or
> outright fails, and then stick to this server. ***
>
> If the server fails in the middle of the current run, you get a
> failed run, and the next one will (hopefully) work again.
>
> This way you also don't need to worry _that much_ that all manifests
> and files are completely in sync across all servers _all the time_ -
> which is another problem not easily solved.
>
>
> *** If there is an "intelligent" node manager in between, the server
> selection is done twice, in this order:
>
> * client picks an initial server to talk to (FT)
> * client asks this server (which is really the node manager), whom
>   to talk to (LB)
> * client sends facts to this server (and sticks to it 'til the
>   end/failure of the run)

I actually think that'd be more complicated, but then, I haven't  
(Continue reading)

Thomas Bellman | 1 Dec 14:21 2009
Picon
Picon

Re: Alternative to facts-in-query

Luke Kanies wrote:

> Again, that doesn't solve the real problem - I want a Facts post to  
> return a Catalog.  How, as the client, would I tell the server that?
> 
> Or do we just always return a catalog when someone posts facts?  That  
> seems a bit overkill.

I get the impression that you need to take a step back and look at things
from a slightly higher level.  Is uploading facts really an operation
that we want a client to do?  If so, for what reason?  Isn't the operation
we want really "get catalog based on the following facts"?  Then we will
simply say that a client SHOULD do that by doing

     POST /myenvironment/catalog HTTP/1.0

     <facts>...

but MAY do it using

     GET /myenvironment/catalog?<facts>... HTTP/1.0

(I don't remember the exact syntax for posting a form in HTTP off hand.)
In the server both would be handled identically after decoding the
GET/POST and the "form data".  I haven't looked at that code in Puppet,
but any reasonable framework for handling HTTP requests should make it
pretty easy to handle them identically.

	/Bellman

(Continue reading)

Nigel Kersten | 1 Dec 16:46 2009
Picon

[PATCH/puppet 1/1] Fixes #2836. Adds hold support to dpkg provider

From: nigelk <nigelk <at> dirtyhippies.localdomain>

Signed-off-by: Nigel Kersten <nigelk <at> google.com>
---
 lib/puppet/provider/package/dpkg.rb |   31 +++++++++++++++++++++++++-
 lib/puppet/type/package.rb          |   10 +++++++-
 spec/unit/provider/package/dpkg.rb  |   42 ++++++++++++++++++++++++++++++++--
 3 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/lib/puppet/provider/package/dpkg.rb b/lib/puppet/provider/package/dpkg.rb
index a4c3982..4f1c45a 100755
--- a/lib/puppet/provider/package/dpkg.rb
+++ b/lib/puppet/provider/package/dpkg.rb
 <at>  <at>  -5,6 +5,8  <at>  <at>  Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package
         and not ``apt``, you must specify the source of any packages you want
         to manage."

+    has_feature :holdable
+
     commands :dpkg => "/usr/bin/dpkg"
     commands :dpkg_deb => "/usr/bin/dpkg-deb"
     commands :dpkgquery => "/usr/bin/dpkg-query"
 <at>  <at>  -47,9 +49,12  <at>  <at>  Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package

             if hash[:status] == 'not-installed'
                 hash[:ensure] = :purged
-            elsif hash[:status] != "installed"
+            elsif hash[:status] == "config-files"
                 hash[:ensure] = :absent
             end
(Continue reading)

Nigel Kersten | 1 Dec 18:10 2009
Picon

[PATCH/puppet 1/1] Fixes #2740. pkdmg provider no longer deletes dmgs with a local source


Signed-off-by: Nigel Kersten <nigelk <at> google.com>
---
 lib/puppet/provider/package/pkgdmg.rb |    6 ++----
 spec/unit/provider/package/pkgdmg.rb  |   28 ++++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/lib/puppet/provider/package/pkgdmg.rb b/lib/puppet/provider/package/pkgdmg.rb
index 8a916d5..210c3b7 100644
--- a/lib/puppet/provider/package/pkgdmg.rb
+++ b/lib/puppet/provider/package/pkgdmg.rb
 <at>  <at>  -79,8 +79,7  <at>  <at>  Puppet::Type.type(:package).provide :pkgdmg, :parent => Puppet::Provider::Packag
                 curl "-o", cached_source, "-C", "-", "-k", "-s", "--url", source
                 Puppet.debug "Success: curl transfered [#{name}]"
             rescue Puppet::ExecutionFailure
-                Puppet.debug "curl did not transfer [#{name}].  Falling back to slower open-uri transfer methods."
-                cached_source = source
+                raise Puppet::Error.new("Unable to download #{source} disk image to #{cached_source}")
             end
         end

 <at>  <at>  -109,8 +108,7  <at>  <at>  Puppet::Type.type(:package).provide :pkgdmg, :parent => Puppet::Provider::Packag
                 end
             end
         ensure
-            # JJM Remove the file if open-uri didn't already do so.
-            File.unlink(cached_source) if File.exist?(cached_source)
+            File.unlink(cached_source) if cached_source != source and File.exist?(cached_source)
         end
     end
(Continue reading)

lluis | 1 Dec 19:04 2009
Picon

Re: [PATCH/puppet 1/1] Fixing 2849 puppet changes sshkey alias every run if it is blank

I've checkout the patch branch and run again puppet with the manifest on
the ticket, and is still reporting

alias changed '' to ''

I'm missing something?

El dl 30 de 11 de 2009 a les 16:57 -0800, en/na Markus Roberts va
escriure:
> +1, but isn't:
> 
>             names = hash[:name].split(",", -1)
>             hash[:name]  = names.shift
>             hash[:alias] = names
> 
> just a verbose way of saying:
> 
>             hash[:name],*hash[:alias] = hash[:name].split(",", -1)
> 
> 
> -- Markus
> 
> --
> 
> You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
> To post to this group, send email to puppet-dev <at> googlegroups.com.
> To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
> 
> 
(Continue reading)

Ian Ward Comfort | 1 Dec 19:05 2009
Picon

Re: [PATCH/puppet 1/1] Fixes #2740. pkdmg provider no longer deletes dmgs with a local source

On 1 Dec 2009, at 9:10 AM, Nigel Kersten wrote:
> Signed-off-by: Nigel Kersten <nigelk <at> google.com>
> ---
> lib/puppet/provider/package/pkgdmg.rb |    6 ++----
> spec/unit/provider/package/pkgdmg.rb  |   28 ++++++++++++++++++++++++ 
> ++--
> 2 files changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/lib/puppet/provider/package/pkgdmg.rb b/lib/puppet/ 
> provider/package/pkgdmg.rb
> index 8a916d5..210c3b7 100644
> --- a/lib/puppet/provider/package/pkgdmg.rb
> +++ b/lib/puppet/provider/package/pkgdmg.rb
>  <at>  <at>  -79,8 +79,7  <at>  <at>   
> Puppet::Type.type(:package).provide :pkgdmg, :parent =>  
> Puppet::Provider::Packag
>                 curl "-o", cached_source, "-C", "-", "-k", "-s", "-- 
> url", source
>                 Puppet.debug "Success: curl transfered [#{name}]"
>             rescue Puppet::ExecutionFailure
> -                Puppet.debug "curl did not transfer [#{name}].   
> Falling back to slower open-uri transfer methods."
> -                cached_source = source
> +                raise Puppet::Error.new("Unable to download  
> #{source} disk image to #{cached_source}")
>             end
>         end
>
>  <at>  <at>  -109,8 +108,7  <at>  <at>   
> Puppet::Type.type(:package).provide :pkgdmg, :parent =>  
(Continue reading)

Nigel Kersten | 1 Dec 19:19 2009
Picon

Re: [PATCH/puppet 1/1] Fixes #2740. pkdmg provider no longer deletes dmgs with a local source

On Tue, Dec 1, 2009 at 10:05 AM, Ian Ward Comfort
<icomfort <at> rescomp.stanford.edu> wrote:
> On 1 Dec 2009, at 9:10 AM, Nigel Kersten wrote:
>> Signed-off-by: Nigel Kersten <nigelk <at> google.com>
>> ---
>> lib/puppet/provider/package/pkgdmg.rb |    6 ++----
>> spec/unit/provider/package/pkgdmg.rb  |   28 ++++++++++++++++++++++++
>> ++--
>> 2 files changed, 28 insertions(+), 6 deletions(-)
>>
>> diff --git a/lib/puppet/provider/package/pkgdmg.rb b/lib/puppet/
>> provider/package/pkgdmg.rb
>> index 8a916d5..210c3b7 100644
>> --- a/lib/puppet/provider/package/pkgdmg.rb
>> +++ b/lib/puppet/provider/package/pkgdmg.rb
>>  <at>  <at>  -79,8 +79,7  <at>  <at> 
>> Puppet::Type.type(:package).provide :pkgdmg, :parent =>
>> Puppet::Provider::Packag
>>                 curl "-o", cached_source, "-C", "-", "-k", "-s", "--
>> url", source
>>                 Puppet.debug "Success: curl transfered [#{name}]"
>>             rescue Puppet::ExecutionFailure
>> -                Puppet.debug "curl did not transfer [#{name}].
>> Falling back to slower open-uri transfer methods."
>> -                cached_source = source
>> +                raise Puppet::Error.new("Unable to download
>> #{source} disk image to #{cached_source}")
>>             end
>>         end
>>
(Continue reading)

Jesse A Wolfe | 1 Dec 19:39 2009
Picon

Re: [PATCH/puppet 1/1] Fixing 2849 puppet changes sshkey alias every run if it is blank

Did you try running it more than once? It's still possible to get this message on the first run as there's unfortunately more than one possible encoding of no-alias.

~ Jesse

On Tue, Dec 1, 2009 at 10:04 AM, lluis <lluis <at> ingent.net> wrote:
I've checkout the patch branch and run again puppet with the manifest on
the ticket, and is still reporting

alias changed '' to ''

I'm missing something?


El dl 30 de 11 de 2009 a les 16:57 -0800, en/na Markus Roberts va
escriure:
> +1, but isn't:
>
>             names = hash[:name].split(",", -1)
>             hash[:name]  = names.shift
>             hash[:alias] = names
>
> just a verbose way of saying:
>
>             hash[:name],*hash[:alias] = hash[:name].split(",", -1)
>
>
> -- Markus
>
> --
>
> You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
> To post to this group, send email to puppet-dev <at> googlegroups.com.
> To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
>
>

--

You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.



--

You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Gmane