From f717c1f4fdd230a1fe928108c0bfd5314226b3c6 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 5 Apr 2021 09:50:38 +0200 Subject: [PATCH] removed unreachable code (#2157) (#2169) * removed unreachable code * added changelog fragment (cherry picked from commit b81a7cdd16bc1c5ab519e6338bff3d7058f00f8e) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/2157-unreachable-code.yml | 4 ++++ plugins/modules/cloud/misc/rhevm.py | 18 ------------------ plugins/modules/cloud/ovh/ovh_ip_failover.py | 1 - .../bitbucket/bitbucket_pipeline_variable.py | 2 -- 4 files changed, 4 insertions(+), 21 deletions(-) create mode 100644 changelogs/fragments/2157-unreachable-code.yml diff --git a/changelogs/fragments/2157-unreachable-code.yml b/changelogs/fragments/2157-unreachable-code.yml new file mode 100644 index 0000000000..7cb84b4db9 --- /dev/null +++ b/changelogs/fragments/2157-unreachable-code.yml @@ -0,0 +1,4 @@ +minor_changes: + - rhevm - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157). + - ovh_ip_failover - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157). + - bitbucket_pipeline_variable - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157). diff --git a/plugins/modules/cloud/misc/rhevm.py b/plugins/modules/cloud/misc/rhevm.py index 2aebc3464d..cc6c1252bf 100644 --- a/plugins/modules/cloud/misc/rhevm.py +++ b/plugins/modules/cloud/misc/rhevm.py @@ -1229,24 +1229,6 @@ class RHEV(object): self.__get_conn() return self.conn.set_VM_Host(vmname, vmhost) - # pylint: disable=unreachable - VM = self.conn.get_VM(vmname) - HOST = self.conn.get_Host(vmhost) - - if VM.placement_policy.host is None: - self.conn.set_VM_Host(vmname, vmhost) - elif str(VM.placement_policy.host.id) != str(HOST.id): - self.conn.set_VM_Host(vmname, vmhost) - else: - setMsg("VM's startup host was already set to " + vmhost) - checkFail() - - if str(VM.status.state) == "up": - self.conn.migrate_VM(vmname, vmhost) - checkFail() - - return True - def setHost(self, hostname, cluster, ifaces): self.__get_conn() return self.conn.set_Host(hostname, cluster, ifaces) diff --git a/plugins/modules/cloud/ovh/ovh_ip_failover.py b/plugins/modules/cloud/ovh/ovh_ip_failover.py index 7ed3a5ee16..545c40fff7 100644 --- a/plugins/modules/cloud/ovh/ovh_ip_failover.py +++ b/plugins/modules/cloud/ovh/ovh_ip_failover.py @@ -162,7 +162,6 @@ def waitForTaskDone(client, name, taskId, timeout): currentTimeout -= 5 if currentTimeout < 0: return False - return True def main(): diff --git a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py index 33457fcab4..735db8b784 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py @@ -149,8 +149,6 @@ def get_existing_pipeline_variable(module, bitbucket): var['name'] = var.pop('key') return var - return None - def create_pipeline_variable(module, bitbucket): info, content = bitbucket.request(