Skip to content

errors and return codes on a per-lv basis #45

Open
@richm

Description

@richm

If you specify --all, or provide a snapset, then the code performs operations on several volumes. For example, if a snapset of 5 volumes are passed in, and the operations are successful on the first 4, then the 5th one fails, the user has no way to know which of those operations were successful. The response should contain information about each volume e.g.

result:
  return_code: N  # if there are any errors, this will be the return_code of the last error
  changed: true|false  # if there are any changes, this will be true
  results:
    - name: name argument for snapset element, if given
      vg: volume group, if given
      lv: logical volume, if given
      return_code: N  # code from operation
      changed: true|false  # if the operation changed something
      message: ....  # message from the operation
    - name: ....
    ....

We could also have a config parameter - snapshot_fail_fast: true|false - if true, once it hits the first failure, it returns without processing all of the items in the snapset. If false, it will process all of them.
This is similar to how Ansible returns results from a loop - https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#registering-variables-with-a-loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions