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

cf-remote deploy a little "friendlier" in terms of masterfiles directory argument

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: N/A
    • Component/s: contrib: cf-remote
    • Labels:
      None
    • Story Points:
      1

      Description

      It seems like the directory argument to cf-remote deploy could be a bit more flexible. I had to make 3 tries before I got it right and I think reasonably the first try should have worked.

      craig@libre:~/cfe/masterfiles$ cf-remote deploy --help
      usage: cf-remote deploy [-h] --hub HUB directory
      
      positional arguments:
        directory   Path to local masterfiles directory
      
      optional arguments:
        -h, --help  show this help message and exit
        --hub HUB   Hub(s) to deploy to
      craig@libre:~/cfe/masterfiles$ cf-remote deploy --hub deb10 .
      Traceback (most recent call last):
        File "/home/craig/.local/bin/cf-remote", line 10, in <module>
          sys.exit(main())
        File "/home/craig/.local/lib/python3.7/site-packages/cf_remote/main.py", line 382, in main
          exit_code = run_command_with_args(args.command, args)
        File "/home/craig/.local/lib/python3.7/site-packages/cf_remote/main.py", line 189, in run_command_with_args
          return commands.deploy(args.hub, args.directory)
        File "/home/craig/.local/lib/python3.7/site-packages/cf_remote/commands.py", line 479, in deploy
          assert(directory.endswith("/masterfiles"))
      AssertionError
      craig@libre:~/cfe/masterfiles$ cf-remote deploy --hub deb10 ~/cfe/masterfiles/
      Traceback (most recent call last):
        File "/home/craig/.local/bin/cf-remote", line 10, in <module>
          sys.exit(main())
        File "/home/craig/.local/lib/python3.7/site-packages/cf_remote/main.py", line 382, in main
          exit_code = run_command_with_args(args.command, args)
        File "/home/craig/.local/lib/python3.7/site-packages/cf_remote/main.py", line 189, in run_command_with_args
          return commands.deploy(args.hub, args.directory)
        File "/home/craig/.local/lib/python3.7/site-packages/cf_remote/commands.py", line 479, in deploy
          assert(directory.endswith("/masterfiles"))
      AssertionError
      craig@libre:~/cfe/masterfiles$ cf-remote deploy --hub deb10 ~/cfe/masterfiles
      
      admin@34.253.192.169
      OS            : debian
      Architecture  : x86_64
      CFEngine      : 3.15.3 (Enterprise)
      Policy server : None
      Binaries      : dpkg, apt
      
      Copying: '/home/craig/.cfengine/cf-remote/masterfiles.tgz' to 'admin@34.253.192.169'
      Running: 'systemctl stop cfengine3 && rm -rf /var/cfengine/masterfiles && mv masterfiles /var/cfengine/masterfiles && systemctl start cfengine3 && cf-agent -Kf update.cf && cf-agent -K'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olehermanse Ole Herman Schumacher Elgesem
                Reporter:
                craig.comstock Craig Comstock
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel