diff options
| author | Egor Tensin <egor@tensin.name> | 2026-08-06 13:07:27 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-08-06 13:08:45 +0200 |
| commit | d7c131e370306aff43ebbfe682df7ba64302d9f1 (patch) | |
| tree | 8581994225110a24d7faceb43ae4d06b0ed1cfeb /plugins/action/safe_git.py | |
| parent | Merge pull request #2 from egor-tensin/dependabot/github_actions/actions/setu... (diff) | |
| download | infra-ansible-d7c131e370306aff43ebbfe682df7ba64302d9f1.tar.gz infra-ansible-d7c131e370306aff43ebbfe682df7ba64302d9f1.zip | |
reformat Python code with default Black settings
Diffstat (limited to 'plugins/action/safe_git.py')
| -rwxr-xr-x | plugins/action/safe_git.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins/action/safe_git.py b/plugins/action/safe_git.py index 8389169..8d4504b 100755 --- a/plugins/action/safe_git.py +++ b/plugins/action/safe_git.py @@ -9,25 +9,25 @@ class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): result = super().run(tmp, task_vars) - repo = self._task.args['repo'] - dest = self._task.args['dest'] - accept_hostkey = self._task.args.get('accept_hostkey', False) - remote = self._task.args.get('remote', 'origin') - version = self._task.args['version'] + repo = self._task.args["repo"] + dest = self._task.args["dest"] + accept_hostkey = self._task.args.get("accept_hostkey", False) + remote = self._task.args.get("remote", "origin") + version = self._task.args["version"] builtin_args = { - 'repo': repo, - 'dest': dest, - 'accept_hostkey': accept_hostkey, - 'remote': remote, - 'version': version, + "repo": repo, + "dest": dest, + "accept_hostkey": accept_hostkey, + "remote": remote, + "version": version, } if not file.does_dir_exist(self, dest, task_vars): # If the destination directory doesn't exist, delegate to the # builtin module. return self._execute_module( - module_name='ansible.builtin.git', + module_name="ansible.builtin.git", module_args=builtin_args, task_vars=task_vars, ) @@ -35,7 +35,7 @@ class ActionModule(ActionBase): # ansible.builtin.git would just remove everything, fuck that. if not git.is_work_tree(self, dest, task_vars): raise AnsibleActionFail( - f'Destination {dest} exists but is not a repository' + f"Destination {dest} exists but is not a repository" ) # Again, ansible.builtin.git would just remove everything, fuck that. @@ -49,7 +49,7 @@ class ActionModule(ActionBase): # `false`, but I don't want to depend on default values. dirty_files = git.get_dirty_file_list(self, dest, task_vars) if dirty_files: - raise AnsibleActionFail(f'There are local changes in {dest}') + raise AnsibleActionFail(f"There are local changes in {dest}") # Fetch the remote. git.update_remote(self, dest, remote, task_vars, accept_hostkey=accept_hostkey) @@ -59,12 +59,12 @@ class ActionModule(ActionBase): is_ancestor = git.is_ancestor(self, dest, remote, version, task_vars) if not is_ancestor: raise AnsibleActionFail( - f'HEAD in {dest} is not an ancestor of {remote}/{version}' + f"HEAD in {dest} is not an ancestor of {remote}/{version}" ) # Finally, everything looks good, delegate to the builtin module. return self._execute_module( - module_name='ansible.builtin.git', + module_name="ansible.builtin.git", module_args=builtin_args, task_vars=task_vars, ) |
