Skip to content

Commit

Permalink
Address F811: redefinition of unused 'can_pause' and 'can_suspend'
Browse files Browse the repository at this point in the history
  • Loading branch information
ogajduse committed Oct 25, 2023
1 parent 0fd7264 commit a4aa048
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 26 deletions.
16 changes: 10 additions & 6 deletions wrapanapi/entities/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,6 @@ class VmMixin(EntityMixin, metaclass=ABCMeta):
Defines methods or properties a wrapanapi.systems.System that manages Vm's should have
"""

# Implementations must define whether this system can suspend (True/False)
can_suspend = None
# Implementations must define whether this system can pause (True/False)
can_pause = None
# Implementations may override the amount of sec to wait for a VM to reach steady state
steady_wait_time = 180

Expand All @@ -485,11 +481,19 @@ def __init__(self, *args, **kwargs):

@abstractproperty
def can_suspend(self):
"""Return True if this system can suspend VM's/instances, False if not."""
"""
Return True if this system can suspend VM's/instances, False if not.
Implementations must define whether this system can suspend (True/False)
"""

@abstractproperty
def can_pause(self):
"""Return True if this system can pause VM's/instances, False if not."""
"""
Return True if this system can pause VM's/instances, False if not.
Implementations must define whether this system can pause (True/False)
"""

@abstractmethod
def get_vm(self, name, **kwargs):
Expand Down
3 changes: 0 additions & 3 deletions wrapanapi/systems/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,6 @@ class EC2System(System, VmMixin, TemplateMixin, StackMixin, NetworkMixin):
"num_template": lambda self: len(self.list_templates()),
}

can_suspend = False
can_pause = False

def __init__(self, **kwargs):
super().__init__(**kwargs)
self._username = kwargs.get("username")
Expand Down
3 changes: 0 additions & 3 deletions wrapanapi/systems/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,6 @@ class GoogleCloudSystem(System, TemplateMixin, VmMixin):
"num_template": lambda self: len(self.list_templates()),
}

can_suspend = False
can_pause = False

default_scope = ["https://www.googleapis.com/auth/cloud-platform"]

def __init__(self, project=None, zone=None, file_type=None, **kwargs):
Expand Down
3 changes: 0 additions & 3 deletions wrapanapi/systems/msazure.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,6 @@ class AzureSystem(System, VmMixin, TemplateMixin):
"num_template": lambda self: len(list(self.list_compute_images())),
}

can_suspend = True
can_pause = False

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.client_id = kwargs.get("username")
Expand Down
3 changes: 0 additions & 3 deletions wrapanapi/systems/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,6 @@ class OpenstackSystem(System, VmMixin, TemplateMixin):
"num_template": lambda self: len(self.list_templates()),
}

can_suspend = True
can_pause = True

def __init__(self, tenant, username, password, auth_url, **kwargs):
self.keystone_version = kwargs.get("keystone_version")
if not self.keystone_version:
Expand Down
2 changes: 0 additions & 2 deletions wrapanapi/systems/rhevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,6 @@ class RHEVMSystem(System, VmMixin, TemplateMixin):
"num_datastore": lambda self: len(self.list_datastore()),
}

can_suspend = True
can_pause = False
# Over-ride default steady_wait_time
steady_wait_time = 6 * 60

Expand Down
3 changes: 0 additions & 3 deletions wrapanapi/systems/scvmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,6 @@ class SCVMMSystem(System, VmMixin, TemplateMixin):
"num_template": lambda self: len(self.list_templates()),
}

can_suspend = True
can_pause = False

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.host = kwargs["hostname"]
Expand Down
3 changes: 0 additions & 3 deletions wrapanapi/systems/virtualcenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,9 +923,6 @@ class VMWareSystem(System, VmMixin, TemplateMixin):
"num_datastore": lambda self: len(self.list_datastore()),
}

can_suspend = True
can_pause = False

def __init__(self, hostname, username, password, **kwargs):
super().__init__(**kwargs)
self.hostname = hostname
Expand Down

0 comments on commit a4aa048

Please sign in to comment.