Re: variable are not expanded in handle string
Xander Cage <[email protected]>
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
https://tracker.mender.io/browse/CFE-3667 On Monday, May 17, 2021 at 5:47:48 PM UTC+2 Nick Anderson wrote: > Xander Cage <[email protected]> writes: > > _butthurt_classes_expansion__etc_environment_aix_global_env_etc_environment___name____d___name____reached >> >> >> it produces "unexpanded" variable content. this is not a problem per se, >> the promsies are functional, but as i am doing file reporting, these string >> are a little bit distracting. i guess this has something to do with the >> handles content gets overwritten/cleared out in the reporting loop, but i >> would not go and build houses on this idea. >> > Looks like a good candidate for a bug report. > > It's very helpful when you can include a minimal reproducer. I kind of > suspect that this is related to this.promiser and this.handle being used in > classes bodies specific to files promises since I can define classes > containing this.promiser and this.handle using commands promises > Listing 1: Example Policy > > bundle agent __main__{ > vars: > > "something" string => "in a var"; > > commands: > "/bin/echo Test Commands 0" > handle => "command_0_static_promiser_static_handle", > classes => results( "namespace", "command_0_/bin/echo Test Commands 0_command_0_static_promiser_static_handle" ); > > > "/bin/echo Test Commands 1" > handle => "command_1_static_promiser_static_handle", > classes => results( "namespace", "command_1_$(this.promiser)_$(this.handle)" ); > > "/bin/echo Test Commands 2 $(something)" > handle => "command_2_dynamic_promiser_dynamic_handle_$(something)", > classes => results( "namespace", "command_2_$(this.promiser)_$(this.handle)" ); > > } > > > # cf-agent --no-lock --log-level info --show-evaluated-classes=command_ --file /tmp/commands-promise-classes-containing-this-promiser-and-this-handle.cf > info: Executing 'no timeout' ... '/bin/echo Test Commands 0' > notice: Q: ".../bin/echo Test ": Test Commands 0 > info: Last 1 quoted lines were generated by promiser '/bin/echo Test Commands 0' > info: Completed execution of '/bin/echo Test Commands 0' > info: Executing 'no timeout' ... '/bin/echo Test Commands 1' > notice: Q: ".../bin/echo Test ": Test Commands 1 > info: Last 1 quoted lines were generated by promiser '/bin/echo Test Commands 1' > info: Completed execution of '/bin/echo Test Commands 1' > info: Executing 'no timeout' ... '/bin/echo Test Commands 2 in a var' > notice: Q: ".../bin/echo Test ": Test Commands 2 in a var > info: Last 1 quoted lines were generated by promiser '/bin/echo Test Commands 2 in a var' > info: Completed execution of '/bin/echo Test Commands 2 in a var' > Class name Meta tags > command_0__bin_echo_Test_Commands_0_command_0_static_promiser_static_handle_reached > command_0__bin_echo_Test_Commands_0_command_0_static_promiser_static_handle_repaired > command_1__bin_echo_Test_Commands_1_command_1_static_promiser_static_handle_reached > command_1__bin_echo_Test_Commands_1_command_1_static_promiser_static_handle_repaired > command_2__bin_echo_Test_Commands_2_in_a_var_command_2_dynamic_promiser_dynamic_handle_in_a_var_reached > command_2__bin_echo_Test_Commands_2_in_a_var_command_2_dynamic_promiser_dynamic_handle_in_a_var_repaired > > -- You received this message because you are subscribed to the Google Groups "help-cfengine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/4d71d130-8f41-4da5-ad0a-c52f2544408bn%40googlegroups.com.