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

edit_field: Field value is not deleted even though it should be

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Labels:
      None

      Description

      (I'm pasting only parts of the policy here, the attachments contain the full files. The policy files is taking from $(core)/tests/acceptance/10_files/08_field_edits/staging/032.cf).

      Suppose you have the following definition:

      bundle agent init
      {
      vars:
      "actual" string =>
      "able:baker,booker,XXX,bonker:charlie:delta:echo
      apple:XXX,banana:carrot:dogfood
      aardvark:baboon,XXX:colugo:dingo::fox
      ampallang:XXX: :dydoe:,:::::
      :blowfish:conger:dogfish:eel:flounder";
      }

      And then you performed the following transformations:

      bundle edit_line test_edit
      {
      field_edits:
      "a.*"
      edit_field => test_col;
      }

      body edit_field test_col
      {
      allow_blank_fields => "true";
      extend_fields => "true";
      field_operation => "delete";
      field_separator => ":";
      field_value => "XXX";
      select_field => "2";
      value_separator => ",";
      }

      The expected outcome is:

      "able:baker,booker,banker:charlie:delta:echo
      apple:banana:carrot:dogfood
      aardvark:baboon:colugo:dingo::fox
      ampallang:: :dydoe:,:::::
      :blowfish:conger:dogfish:eel:flounder";

      i.e. all instances of XXX that are on the second field should be deleted. We have enable blank fields, therefore the second field of the fourth line should be deleted too. However the end result of the transformation is:

      "able:baker,booker,bonker:charlie:delta:echo
      apple:banana:carrot:dogfood
      aardvark:baboon:colugo:dingo::fox
      ampallang:XXX: :dydoe:,:::::
      :blowfish:conger:dogfish:eel:flounder"

      The second field of the fourth line is not removed.

        Attachments

        1. 032.cf
          2 kB
        2. 032.cf.result
          4 kB

          Activity

            People

            • Assignee:
              a10025 Volker Hilsheimer (Inactive)
              Reporter:
              jiraadmin Old User (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: