diff --git a/scripts/ansible-role-requirements-editer.py b/scripts/ansible-role-requirements-editor.py similarity index 94% rename from scripts/ansible-role-requirements-editer.py rename to scripts/ansible-role-requirements-editor.py index 625012ba40..a2096b81f4 100755 --- a/scripts/ansible-role-requirements-editer.py +++ b/scripts/ansible-role-requirements-editor.py @@ -47,7 +47,7 @@ def main(): # Setup argument parsing parser = argparse.ArgumentParser( - description='ansible-role-requirements.yml CLI editer', + description='ansible-role-requirements.yml CLI editor', epilog='Licensed "Apache 2.0"') parser.add_argument( @@ -82,7 +82,7 @@ def main(): args = parser.parse_args() # Read the ansible-role-requirements.yml file into memory - with open(args.file, "r+") as role_req_file: + with open(args.file, "r") as role_req_file: reqs = yaml.safe_load(role_req_file) # Loop through the list to find the applicable role @@ -94,7 +94,7 @@ def main(): role_data['src'] = args.src # Write out the resulting file - with open(args.file, "r+") as role_req_file: + with open(args.file, "w") as role_req_file: try: yaml.dump(reqs, role_req_file, default_flow_style=False) except yaml.YAMLError as exc: diff --git a/scripts/sources-branch-updater.sh b/scripts/sources-branch-updater.sh index b1b6269574..a3d84a6448 100755 --- a/scripts/sources-branch-updater.sh +++ b/scripts/sources-branch-updater.sh @@ -212,7 +212,7 @@ if [[ "${OSA_BRANCH}" != "master" ]]; then fi # Now use the information we have to update the ansible-role-requirements file - $(dirname ${0})/ansible-role-requirements-editer.py -f ansible-role-requirements.yml -n "${role_name}" -v "${role_version}" + $(dirname ${0})/ansible-role-requirements-editor.py -f ansible-role-requirements.yml -n "${role_name}" -v "${role_version}" done echo "Completed updating ansible-role-requirements.yml" else