Fixes confusing Error when trying to sync project set to scm_type Manual (#13080)

Signed-off-by: darshanip <darshancoding@gmail.com>
Co-authored-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
Darshan 2022-10-28 00:34:26 +05:30 committed by GitHub
parent eba24db74c
commit b19aa4a88d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,7 +114,12 @@ def main():
# Update the project
result = module.post_endpoint(project['related']['update'])
if result['status_code'] != 202:
if result['status_code'] == 405:
module.fail_json(
msg="Unable to trigger a project update because the project scm_type ({0}) does not support it.".format(project['scm_type']),
response=result
)
elif result['status_code'] != 202:
module.fail_json(msg="Failed to update project, see response for details", response=result)
module.json_output['changed'] = True