[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature request
From: |
Mark . Burgess |
Subject: |
Re: feature request |
Date: |
Wed, 18 Apr 2001 19:30:09 +0200 (MET DST) |
On 18 Apr, GERMA Denis wrote:
> Hi,
> I am surprise but I tried to use the ! operator on the 1.6.3 version of
> cfengine
>
> on a test programe :
>
>>classes:
>>
>> classe1 = ( '/usr/bin/test -f classe1' )
>> not_classe1 = ( !classe1 )
>
> And cfengine complains :
> "Wildcards cannot be used in this context:" on the "not_classe1" line.
>
> I would have used in the same spirit the "and" operator in the classe
> definition,
> but it does not seems possible yet.
>
> In fact I would have been a good Idea to be able to use all logical operations
> on classe constructions.
>
> Have I missed something ?
>
> I have joined a start for a test program.
> run cfengine on it and all lines should be duplicated.
>
> Thanks for all.
> D.Germa
>
>
> Mark.Burgess@iu.hio.no a écrit :
>
>> On 17 Apr, Alan Sparks wrote:
>> > Don't know how hard this would be to implement -- so I'll ask anyway...
>> >
>> > Several times I've run into the need for a class representing "run these
>> > if no other class applies." Something like:
>> >
>> > resolve:
>> > box1||box2::
>> > 1.2.3.4
>> > default::
>> > 4.3.2.1
>> >
>> > I just made "default" up... the idea is the "default" class applies if
>> > no other more specific classes apply. I know something like this
>> > behavior can be synthesized by using class defs and negated classes, but
>> > it is extremely cumbersome to do.
>> >
>> > I don't think "any" is any good here, since it would be executed
>> > regardless of whether other rules apply.
>> >
>> > Opinions?
>> > -Alan
>> >
>>
>> I don't see what is difficult about using the ! sign. Figuring
>> out what is "default" is much easier for you than for cfengine.
>> You could do this:
>>
>> classes:
>>
>> someclass = ( box1 box 2 )
>> default = ( !someclass )
>>
>> resolve:
>>
>> someclass::
>> 1.2.3.4
>>
>> default:
>>
>> 1.2.3.4
>>
>> if you want to make it more readable.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
>> Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@gnu.org
>> http://mail.gnu.org/mailman/listinfo/help-cfengine
Ah - you know I have fixed this problem half a dozen times and every
time the patch disappears because I forget to patch cflex.l.in and not
cflex.l....hrmm! Well here is a patch and this time I got it right!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cflex.l.in
Description: Text document