help-cfengine
[Top][All Lists]
Advanced

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

Syntax pb with classes


From: paguerlais
Subject: Syntax pb with classes
Date: Thu, 6 Feb 2003 10:31:46 +0100

I face a little syntax problem with variables and classes (cfengine 2.0.4)
: I want to set a variable which contains the name of some hosts
(fileserver hosts), and define a class if the actual host is one of these
fileserver hosts. Something like :
<cut>
control:
      fileservers = ( "host1 host2" )

classes:
      is_a_fileserver = ( ${fileservers} )
</cut>
But it fails saying :
cf:my_host:./test.cf:5: Variables in groups/classes need to be quoted
cf:my_host:./test.cf:5: Variable or name out of context

So I added quotes around my variable name on line 5 :
<cut>
control:
      fileservers = ( "host1 host2" )

classes:
      is_a_fileserver = ( "${fileservers}" )
</cut>
And then it fails saying :
cf:my_host:./test.cf:5: Quoted scripts must begin with / for absolute path

Of course, if I duplicate the server names on the 5th line, it works :
<cut>
control:
      fileservers = ( "host1 host2" )

classes:
      is_a_fileserver = ( host1 host2 )
</cut>
But then I must remember that every change on the 2nd line must be done on the 
5th line too. Too bad ;-)

Is it possible to define a class based on a variable ? Did I miss something ?

Thanks
Patrice






 
----------------
L'acces immediat aux meilleurs tarifs Air France et au billet electronique sur 
http://www.airfrance.com
 
For immediate access to the best Air France fares and to electronic tickets, 
visit our website http://www.airfrance.com
 
----------------
Les donnees et renseignements contenus dans ce message sont personnels, 
confidentiels et secrets. Ce message est adresse a l'individu ou l'entite dont 
les coordonnees figurent ci-dessus. Si vous n'etes pas le bon destinataire, 
nous vous demandons de ne pas lire, copier, utiliser ou divulguer cette 
communication. Nous vous prions de notifier cette erreur a l'expediteur et 
d'effacer immediatement cette communication de votre systeme.
The information contained in this message is privileged, confidential, and 
protected from disclosure. This message is intended for the individual or 
entity adressed herein. If you are not the intended recipient, please do not 
read, copy, use or disclose this communication to others; also please notify 
the sender by replying to this message, and then delete it from your system.





reply via email to

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