Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
teknofire opened this issue Jun 16, 2021 · 0 comments

Comments

@teknofire
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant