cfengine-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cfengine-develop] Re: Homework


From: Luke A. Kanies
Subject: Re: [Cfengine-develop] Re: Homework
Date: Thu, 6 Mar 2003 10:44:09 -0600 (CST)

On Thu, 6 Mar 2003, Mark Burgess wrote:

> I'm not so sure about this. There is a logical and syntactical
> difference between a path to a file and a quoted string.

As I mentioned earlier, though, if you want to enforce that difference,
you basically have to have variable interpolation at parse time, which is
pretty nasty.

If your parser differentiates between file paths and other strings, then
it has to recognize that the following three configs are all equivalent:

#----------------
editfiles:
  { /path/to/file
    dostuff
  }
#----------------
control:
  var = ( "/path/to/file" )
editfiles:
  { ${var}
    dostuff
  }
#----------------
control:
  var1 = ( "/path" )
  var2 = ( "/to" )
  var3 = ( "/file" )
editfiles:
  { ${var1}${var2}${var3}
    dostuff
  }
#----------------

These examples all rely on hard information, so they could actually be
optimized at parse time, but it's not difficult to expand these examples
to the point where they can't be decided at parse time.

If you can't decide at parse time whether ${var} is a path, then how can
you treat it differently than a normal string?

I guess I basically think that it should be the responsibility of the
action to verify its input is valid; if it requires a valid path, then it
should verify that.  If you are instead encoding that information into the
core of cfengine, then you are too closely coupling the actions and the
cfengine core.

-- 
Computers are not intelligent.  They only think they are.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]