Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2830

Variable are not expanded when read from a file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 3.10.4
    • Fix Version/s: None
    • Component/s: Evaluation
    • Labels:
      None

      Description

      Hi,

       

      I'm reading a file, that reference variables, that I want to use to do action on. When there is no expansion necessary (plain text), or a variable that is not a list, then it works great. However, when I have a list, I have no expansion of the result, much to my dismay.

       

      The output of the attached code is

      R: I'm expected to have 3 lines in package_state_${pkg_list.pkg_name}
      R: Ok, let's expand it once more package_state_${pkg_list.pkg_name} <- this is still not expanding
      R: What I get from copy pasted output package_state_ed <- this is 3 lines
      R: What I get from copy pasted output package_state_vim <- this is 3 lines
      R: What I get from copy pasted output package_state_nano <- this is 3 lines
      R: Ok, let's not iterate it: package_state_${pkg_list.pkg_name} <- this is still not expanding
      R: Length of the 0th is empty ${length
      

       

      What I was expecting:

      R: I'm expected to have 3 lines in package_state_ed
      R: I'm expected to have 3 lines in package_state_vim
      R: I'm expected to have 3 lines in package_state_nano
      R: Ok, let's expand it once more package_state_ed <- this is still not expanding
      R: Ok, let's expand it once more package_state_vim <- this is still not expanding
      R: Ok, let's expand it once more package_state_nano <- this is still not expanding
      R: What I get from copy pasted output package_state_ed <- this is 3 lines
      R: What I get from copy pasted output package_state_vim <- this is 3 lines
      R: What I get from copy pasted output package_state_nano <- this is 3 lines
      R: Length is not outputed : 3
      R: Ok, let's not iterate it: package_state_ed <- this is still not expanding
      R: Ok, let's not iterate it: package_state_vim <- this is still not expanding
      R: Ok, let's not iterate it: package_state_nano <- this is still not expanding
      R: Length of the 0th is empty 3
      
      
      
      

      Am I not using it properly ?

       

      Thanks

      Nicolas

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              olehermanse Ole Herman Schumacher Elgesem
              Reporter:
              ncharles Nicolas Charles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel