Forum: CFEngine Help Subject: Re: methods and variable expansion Author: terok Link to topic: https://cfengine.com/forum/read.php?3,25156,25163#msg-25163
Couldn't see what you had in the pastebin as it just gives unknown id. It seems that the variable passed through usebundle to the called bundle isn't actually 'passed'. Instead the variable is expanded inside the called bundle, like it would be set in the bundles own vars. So now the getfields is run before the $(user) is defined. As a workaround you can set a class to see that the $(user) is defined, something like "user_set" not => strcmp("$(user)",""); Then set that class as a dependency before running rest of the bundle. Why it works on reports comes from the agent ordering, but in the example bundle almost all magic happens in the vars alone. I'd be interested to know too if the variable passing to the bundles works as intended, or if this indeed is a bug? _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine