Re: Proper way of doing replace_or_add?

2010-01-29 Thread Francis GUDIN
On Thu, Jan 28, 2010 at 03:22:22PM -0600, Diego Zamboni wrote: > Hi, Hello, > >> Diego Zamboni wrote: > >>> > >>> Hi, > >>> > >>> I've been working on putting together an edit_line bundle that does > >>> the following: > >>> > >>> - If a certain pattern exists, rep

Re: Proper way of doing replace_or_add?

2010-01-29 Thread Mark Burgess
Diego, this results from a bug that was just fixed in svn 747. No exit status was set for a pattern that was not found. If the pattern was not found, then the promise is considered to be kept. See new version in SVN. Diego Zamboni wrote: > Hi, > > I am still banging my head on this. For a b

Re: bug

2010-01-29 Thread NWatson
Quick update. I was able to reproduce this this morning on 3.0.2 but not 3.0.3. I'll look again at an svn snap shot over the weekend. Sincerely, -- Neil Watson 416-673-3465 CONFIDENTIALITY WARNING This communication, including any attachments, is for the exclusive use of addressee and may co

Re: problem building cfengine 3.0.3 on solaris 10 with sun studio

2010-01-29 Thread Eystein Måløy Stenberg
Hi, Like Nakarin said, you should get PCRE linked in. However, this is probably not what causes the build problem: >> /bin/bash ../ylwrap cf3parse.y y.tab.c cf3parse.c y.tab.h cf3parse.h y.output cf3parse.output -- yacc -d >> got /export/home/tmarshall/cfengine-3\.0\.3/src/ >> >> conflicts:

error in stdlib

2010-01-29 Thread NWatson
>From the std lib ## ## file_select ## body file_select name_age(name,age) # <-- age should be days { leaf_name => { "$(name)" }; mtime => irange(ago(1,0,0,0,0,0),ago(0,0,$(days),0,0,0)); # <-- called age above file_result => "mtime.leaf_name"; } Sincerely, -- Neil Watson 416-673-34

Re: Proper way of doing replace_or_add?

2010-01-29 Thread Diego Zamboni
Indeed, it works now, after compiling from svn. Thanks for the help! More questions are forthcoming... :-) --Diego On Fri, Jan 29, 2010 at 6:00 AM, Mark Burgess wrote: > > Diego, > > this  results from a bug that was just fixed in svn 747. No exit status was > set for a > pattern that was not

Turning a hostname list into a class list

2010-01-29 Thread Justin Lloyd
If I have a list of hostnames, many of which have hyphens in them, what's the cleanest way of generating a class list. For example, say I have the following slist, which may come from a text file, LDAP, or may just be hard-coded in a policy file. vars: "test_hosts" slist => { "foo

Re: Turning a hostname list into a class list

2010-01-29 Thread Nakarin Phooripoom
Could we do something like this following? classes: "test_hosts_c" or => { classmatch(canonify("$(test_hosts)")) }; Cheers, --Nakarin On Jan 29, 2010, at 8:02 PM, Justin Lloyd wrote: > If I have a list of hostnames, many of which have hyphens in them, what’s the > cleanest way of generat

Re: error in stdlib

2010-01-29 Thread Mark Burgess
Thanks, fixed. Will update automatically soon nwat...@symcor.com wrote: > From the std lib > > ## > ## file_select > ## > > body file_select name_age(name,age) # <-- age should be days > { > leaf_name => { "$(name)" }; > mtime => irange(ago(1,0,0,0,0,0),ago(0,0,$(days),0,0,0)); # <--

Re: error in stdlib

2010-01-29 Thread NWatson
As a wish list topic the error message output from this could be more explicit. It took me quite some time adding and removing promises until I isolated this error. Sincerely, -- Neil Watson 416-673-3465 Mark Burgess wrote on 2010-01-29 16:00:10: > > Thanks, fixed. Will update automatically

How to get all the values of an array?

2010-01-29 Thread Diego Zamboni
Hi, Sorry for the possibly dense question, but how do I get a list containing all the values of an associative array? I know the getindices() function, but I can't find a similar getvalues() one. My use case is that I have something like this: # Files to edit "files[sysctlconf]" string => "/

RE: Turning a hostname list into a class list

2010-01-29 Thread Justin Lloyd
Cool, thanks! I was on the right path, just missing the classmatch() call. Here's what I've come up with that works but *usually* gives regex errors, though not always, and the junk in quotes changes, making me think there's some sort of memory boundary issue. Am I doing something wrong or shoul