Skip to content

Error message is misleading if there are more entries in the clients group than clients #157

Description

@teknofire

In the following code, the difference of the clients in the group vs the clients themselves is using .abs.

ui.warn "There are #{(existing_group_data['clients'].length - clients_in_org.length).abs} missing clients in #{org}'s client group file #{clients_group_path}. If this is not intentional do NOT proceed with a restore until corrected. `knife tidy backup clean` will auto-correct this. https://github.com/chef-customers/knife-tidy"

In the case where the clients group has 1 or more clients that no longer exist, then the message show is misleading.

There are 2 missing clients in PROD_ORG's client group file /path/organizations/PROD_ORG/groups/client.json. If this is not intentional do NOT proceed with a restore until corrected. knife tidy backup clean will auto-correct this. https://github.com/chef-customers/knife-tidy

When in fact it should say something like

There are 2 clients in clients in PROD_ORG's client group file /path/organizations/PROD_ORG/groups/client.json that no longer exist.

The way this could happen is if some clients were deleted during the knife-ec-backup, after the client group data was exported but before the client data was exported.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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