Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Luke Kanies
I've clearly forgotten how this aspect of ralsh works. How does an instances method that returns [] fix anything? Does this just make the file management work but not file querying? E.g., what does 'puppet resource file' do here? It would normally list all instances, but that's obviously

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix for #5022 -- Race condition memory leak in Puppet::Util

2010-10-19 Thread Brice Figureau
+1 with one inlined and one outlined questions On Mon, 2010-10-18 at 16:04 -0700, Markus Roberts wrote: The Puppet::Util.sync method was not thread safe and also leaked memory. I'm not certain, but I believe the first is ironic and the second is merely a bug. :) This patch addresses the

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Markus Roberts
I've clearly forgotten how this aspect of ralsh works. How does an instances method that returns [] fix anything? Does this just make the file management work but not file querying? E.g., what does 'puppet resource file' do here? It would normally list all instances, but that's obviously

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix for #5022 -- Race condition memory leak in Puppet::Util

2010-10-19 Thread Markus Roberts
+1 with one inlined and one outlined questions Quick ruby question: what about using a WeakRef to hold the sync object and completely get rid of the ref counting? Would that work? Interesting idea, but I'm not sure off hand how to make it work. The problem isn't as much the hash values (the

[Puppet-dev] required_features

2010-10-19 Thread Angelos Oikonomopoulos
Hello all, I've been trying my hand at fixing #5036 (and getting a bit acquainted with puppet internals while at it). My current diff can be found at the end of this mail. Unfortunately, I can't get the validation to work and judging by the absense of my debug output, my code doesn't even get

[Puppet-dev] Misunderstanding with case sensitive/insensitive in selectors and case statements.

2010-10-19 Thread Denis Barishev
Hello! Could you, please, enlightent the situation about the subject. As far as i can understand, puppet, actually my version 2.6.1, makes case- sensitive matches, and i can't find a way to change the behavior. The following code fails to work as expected, 'cause all operating system define

Re: [Puppet-dev] [PATCH/facter 1/1] Feature #4575: win32 support for manufacturer, productname, serialnumber

2010-10-19 Thread Paul Nasrat
+1 Using WMI queries where we can makes sense On 19 October 2010 00:28, Rein Henrichs r...@puppetlabs.com wrote: From: William Van Hevelingen wva...@gmail.com Signed-off-by: William Van Hevelingen wva...@gmail.com Signed-off-by: Rein Henrichs r...@puppetlabs.com ---  

Re: [Puppet-dev] Misunderstanding with case sensitive/insensitive in selectors and case statements.

2010-10-19 Thread Brice Figureau
On Tue, 2010-10-19 at 03:14 -0700, Denis Barishev wrote: Hello! Could you, please, enlightent the situation about the subject. As far as i can understand, puppet, actually my version 2.6.1, makes case- sensitive matches, and i can't find a way to change the behavior. The following code

Re: [Puppet-dev] required_features

2010-10-19 Thread Markus Roberts
Angelos -- This looks interesting. I'll try to poke at it a bit this afternoon and get back to you. In the meantime, don't forget to fill out a a Contributor License Agreement (http://puppetlabs.com/legal/cla.txt) -- basically saying that you give us the right to use the code, and that you have

Re: [Puppet-dev] Misunderstanding with case sensitive/insensitive in selectors and case statements.

2010-10-19 Thread Markus Roberts
I suggest you to file (several) bug reports about this (one for the case sensitivity issue, one for the documentation, and one feature for the uppercase/lowercase functions). And if you get on a roll, feel free to file one about unicode. -- M

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Luke Kanies
On Oct 19, 2010, at 6:51 AM, Markus Roberts wrote: I've clearly forgotten how this aspect of ralsh works. How does an instances method that returns [] fix anything? Does this just make the file management work but not file querying? E.g., what does 'puppet resource file' do here? It

Re: [Puppet-dev] [PATCH/facter 1/1] (#4989) Add xendomains fact

2010-10-19 Thread Paul Nasrat
On 18 October 2010 23:45, Rein Henrichs r...@puppetlabs.com wrote: Parses `/usr/sbin/xm list` and returns a comma-separated list of domains. Based on a patch submitted by Jonas Genannt. Looks good - is the output of xm list consistent across all known releases of xen? Paul ---  Jonas,  

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Jesse Wolfe
My guess, then, is that the instances method is set to return [] because the system requires it return something (which is probably a bug), and this way it just returns an empty set rather than failing. Right, that was my understanding, too. It looks like the original code, before it started

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Luke Kanies
On Oct 19, 2010, at 1:58 PM, Jesse Wolfe wrote: My guess, then, is that the instances method is set to return [] because the system requires it return something (which is probably a bug), and this way it just returns an empty set rather than failing. Right, that was my understanding,

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Jesse Wolfe
puppet resource / recurse=1 and produced a list of the existing files in /. I believe that Dan opened a ticket a couple months ago that we should be able to pass parameters that way - right now, the command line only works for setting attributes on a resource that you can find using the

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Markus Roberts
As Owen observed, actually listing all files on the system is not practical. Not practical? Come on, it's one line of code: `find /`.split(/\n/) ...oh wait, you're right, that won't work on MS Windows. :) I think returning the empty list (or some other notion of not implemented) is a

[Puppet-dev] [PATCH/puppet 1/1] (#5027) Add warnings when dynamic scope is used

2010-10-19 Thread Nick Lewis
Puppet (master/apply) will now warn at most once per compile if the manifest being compiled uses dynamic scope. During variable lookup, it will perform both dynamic scope lookup and static scope lookup and compare the two. If they differ, it issues the warning. Signed-off-by: Nick Lewis

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Jesse Wolfe
Not practical? Come on, it's one line of code: `find /`.split(/\n/) I started running that command on my VM a few minutes ago, and I'm still waiting for it to return. Unfortunately, the RAL resource find function is implemented like this: res = type(request).instances.find { |o|

Re: [Puppet-dev] required_features

2010-10-19 Thread Markus Roberts
Angelos -- I poked at it a bit but didn't have any blinding insights. A few observations: # Verify that the passed value is valid. # If the developer uses a 'validate' hook, this method will get overridden. def unsafe_validate(value) self.class.value_collection.validate(value) +

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Markus Roberts
Not practical? Come on, it's one line of code: `find /`.split(/\n/) I started running that command on my VM a few minutes ago, and I'm still waiting for it to return. This is really weird. It seems I can say the most absurd things today and people will take me quite seriously. If

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Jesse Wolfe
This is really weird. It seems I can say the most absurd things today and people will take me quite seriously. If only I could figure out to harness this new found power... Are you certain that you're not the one taking my joke seriously? That's why I'm suggesting we provide some way of

Re: [Puppet-dev] [PATCH/puppet 1/1] (#5027) Add warnings when dynamic scope is used

2010-10-19 Thread Markus Roberts
Puppet (master/apply) will now warn at most once per compile if the manifest being compiled uses dynamic scope. Hmmm. At most once per compile? That still may be too frequent, and yet I'm not sure off the top of my head how to reduce it. Also, does at most mean it might not warn sometimes?

[Puppet-dev] ANNOUNCE: Puppet Dashboard 1.0.4 released!

2010-10-19 Thread James Turnbull
We're pleased to announce the availability of Puppet Dashboard 1.0.4! This is a maintenance release, it fixes a number of bugs, improves the user interface, significantly boosts performance and includes better RPM and DEB packages. The source code of 1.0.4 is identical to 1.0.4rc2. Please

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Markus Roberts
On Tue, Oct 19, 2010 at 4:08 PM, Jesse Wolfe je...@puppetlabs.com wrote: This is really weird. It seems I can say the most absurd things today and people will take me quite seriously. If only I could figure out to harness this new found power... Are you certain that you're not the one

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Jesse Wolfe
I'm for files in the root directory if no name is specified and then when/if we add parameters we're well positioned to have reasonable semantics. I can live with that. Updated patch shortly. -- You received this message because you are subscribed to the Google Groups Puppet Developers

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Luke Kanies
On Oct 19, 2010, at 2:11 PM, Jesse Wolfe wrote: puppet resource / recurse=1 and produced a list of the existing files in /. I believe that Dan opened a ticket a couple months ago that we should be able to pass parameters that way - right now, the command line only works for setting

[Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Jesse Wolfe
This is based on the patch submitted by Owen Smith. File management was being blocked by two problems: an obsolete, broken `instances` method for the file type, and a bug in the way resource/ral handled slashes in resource names. This patch makes two changes to Owen's version: 1) our unit tests

[Puppet-dev] [PATCH/puppet 1/1] Fix for #5022 -- Escaped newlines should be elided

2010-10-19 Thread Markus Roberts
This was a regression, not covered by a test; previously the string foo/ bar would be interpreded as foobar but this was changed to foo\\\nbar in 2.6.x with my string interpolation refactor. This change restores the behaviour. Signed-off-by: Markus Roberts mar...@reality.com ---

Re: [Puppet-dev] [PATCH/puppet 1/1] (#5027) Add warnings when dynamic scope is used

2010-10-19 Thread Markus Roberts
And finally, I'm not seeing why the dodge with the context thread var is needed. Isn't this just going to be the current AST node? Yes. But from lookupvar, we don't know what the current AST node is (as far as I could find). The goal is simply to find the current line and file, preferably

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #3165 Ralsh (bin/puppet resource) can't manage files

2010-10-19 Thread Markus Roberts
+1, with my obligatory: def self.instances(base = '/') return self.new(:name = base, :recurse = true, :recurselimit = 1, :audit = :all).recurse_local.values end could more concisely be written: def self.instances(base = '/') new(:name = base, :recurse = true, :recurselimit = 1,