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

deleteofflinecollectors always logs an error #28

Open
rjury-sumo opened this issue Mar 8, 2022 · 1 comment
Open

deleteofflinecollectors always logs an error #28

rjury-sumo opened this issue Mar 8, 2022 · 1 comment

Comments

@rjury-sumo
Copy link

this block of code should not have [ERROR] for both branches of the if as it causes misleading responses when the script is run.

    if r.status_code != 200 and r.status_code != 201:
        log('[ERROR] Failed to delete offline Collectors')
    else:
        log('[ERROR] Successfully deleted offline Collectors')
@rjury-sumo
Copy link
Author

suggested fix to also include better error reporting in line with other parts of the code.

    if r.status_code != 200 and r.status_code != 201:
        log('[ERROR] Failed to delete offline Collectors')
        log('[ERROR] %s' % r.json()['message'].lower()[:-1])
    else:
        log('Successfully deleted offline Collectors')

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