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

cfbs commands that changes the state of cfbs.json should happend atomically

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: N/A
    • Fix Version/s: None
    • Component/s: cfbs
    • Labels:
      None

      Description

      cfbs commands that changes the state of cfbs.json should happend atomically.

      For cfbs add this seems to be the case

      % cfbs init && cfbs add mpf groups none-existent-module
      Initialized - edit name and description cfbs.json
      To add your first module, type: cfbs add masterfiles
      mpf is an alias for masterfiles
      groups is an alias for promise-type-groups
      Error: Module 'none-existent-module' does not exist
      
      {
        "name": "Example",
        "type": "policy-set",
        "description": "Example description",
        "build": []
      }
      

      but for cfbs remove this is not the case

      % cfbs init && cfbs add groups && cfbs remove promise-type-groups
      Initialized - edit name and description cfbs.json
      To add your first module, type: cfbs add masterfiles
      groups is an alias for promise-type-groups
      Added module: library-for-promise-types-in-python (Dependency of promise-type-groups)
      Added module: promise-type-groups
      Removing module 'promise-type-groups'
      The following modules were added as dependencies but are no longer needed:
      library-for-promise-types-in-python - Library enabling promise types implemented in python - added by: promise-type-groups
      Do you wish to remove these modules? [y/N] 
      

      Before answering this promt, the state of cfbs.json is already changes. So what would happen if removing the dependency fails?

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            larsewi Lars Erik Wik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: