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

Unexpected behaviour renaming files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 3.7.4, 3.7.8
    • Fix Version/s: None
    • Component/s: Promise type: files
    • Labels:
      None
    • Platform:
      Linux

      Description

      Hello,

      The following bundle should rename files in several repositories in order to append a "_bis" suffix.

      Before the bundle is run:

      /tmp/test/rick/incoming/rick
      /tmp/test/joe/incoming/joe
      /tmp/test/jane/incoming/jane
      /tmp/test/john/incoming/john
      /tmp/test/sly/incoming/sly

      Expected result:
      /tmp/test/rick/incoming/rick_bis
      /tmp/test/joe/incoming/joe_bis
      /tmp/test/jane/incoming/jane_bis
      /tmp/test/john/incoming/john_bis
      /tmp/test/sly/incoming/sly_bis

      Effective result:
      /tmp/test/rick/incoming/rick_bis
      /tmp/test/joe/incoming/rick_bis
      /tmp/test/jane/incoming/joe_bis
      /tmp/test/john/incoming/jane_bis
      /tmp/test/sly/incoming/john_bis

      From cf-agent output:
      info: Renaming file '/tmp/test/rick/incoming/rick' to '/tmp/test/rick/incoming/rick_bis'
      info: Renaming file '/tmp/test/joe/incoming/joe' to '/tmp/test/joe/incoming/rick_bis'
      info: Renaming file '/tmp/test/jane/incoming/jane' to '/tmp/test/jane/incoming/joe_bis'
      info: Renaming file '/tmp/test/john/incoming/john' to '/tmp/test/john/incoming/jane_bis'
      info: Renaming file '/tmp/test/sly/incoming/sly' to '/tmp/test/sly/incoming/john_bis'

      It looks like some shifting, ie: $(match.1) seem to retourn the previous value in the implicit loop.

        Attachments

        1. run_test.sh
          0.2 kB
        2. test.cf
          0.4 kB

          Activity

            People

            • Assignee:
              olehermanse Ole Herman Schumacher Elgesem
              Reporter:
              ldumaine Luc Dumaine
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel