Forum: Cfengine Help
Subject: Handles vs Classes - Scope Intersection
Author: nima
Link to topic: https://cfengine.com/forum/read.php?3,18170,18170#msg-18170

Are we free to do the following:

bundle agent Client {
    files:
        linux::
            "$(sys.workdir)/inputs/."
                handle => "a_unique_identifier",
                comment => "$(this.promiser):$(this.handle)",
                copy_from => ...,
                classes => DefineSoftClass"$(this.handle)"
            ;
    ...:
}


Note that I've defined a single unique identifier, then reused that in the 
comment, and also in the dynamic declaration of classes.  Basically I'm trying 
to minimize the number of unique strings that I need to pull out of thin air to 
reduce complexity.  I would generally just test this, but since I get so many 
cf3 crashes, it's a little difficult to tell what is actually the root cause 
for the crash.

In summary, my questions boils down to the following:

1. Is the scope of handle names mutually exclusive to the class names
2. Is the comment field valid
3. Can I define classes based on $(this.handle), as long as I make sure that it 
contains only valid characters

Oh one more thing that's bugged me - is this valid:

bundle common control {
    vars:
        #. Core - Minimal (Don't EVER break these!)...
        "bundle" slist => { "Client", "Server" };
        "inputs" slist => {
            "lib-conf.cf",      #. User configurations
            "lib-core.cf",      #. System variables and library functions
            "cf-agent.cf",      #. Starting point for cfengine clients & servers
            "cf-serverd.cf",    #. Cfengine server configuration
        };   


4. Note the last comma in the slist block.  This is so I can move lines around 
without having to worry about the absence of the last comma everytime.

Nima

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to