Merge "Removed H404, H405, H305 ignore in pep8"
This commit is contained in:
@@ -32,6 +32,7 @@ class MigrationType(Enum):
|
||||
class Migrate(BaseAction):
|
||||
def __init__(self, vm, src_hypervisor, dest_hypervisor):
|
||||
"""Request to migrate a virtual machine from a host to another
|
||||
|
||||
:param vm: the virtual machine uuid to migrate
|
||||
:param src_hypervisor: uuid
|
||||
:param dest_hypervisor: uuid
|
||||
|
||||
@@ -32,6 +32,7 @@ class Mapping(object):
|
||||
:param hypervisor: the hypervisor
|
||||
:param vm: the virtual machine or instance
|
||||
"""
|
||||
|
||||
try:
|
||||
self.lock.acquire()
|
||||
|
||||
@@ -55,13 +56,15 @@ class Mapping(object):
|
||||
:param hypervisor: the hypervisor
|
||||
:param vm: the virtual machine or instance
|
||||
"""
|
||||
|
||||
self.unmap_from_id(hypervisor.uuid, vm.uuid)
|
||||
|
||||
def unmap_from_id(self, node_uuid, vm_uuid):
|
||||
"""
|
||||
"""Remove the instance (by id) from the hypervisor (by id)
|
||||
|
||||
:rtype : object
|
||||
"""
|
||||
|
||||
try:
|
||||
self.lock.acquire()
|
||||
if str(node_uuid) in self._mapping_hypervisors:
|
||||
@@ -91,6 +94,7 @@ class Mapping(object):
|
||||
:param vm: the uuid of the instance
|
||||
:return: hypervisor
|
||||
"""
|
||||
|
||||
return self.model.get_hypervisor_from_id(
|
||||
self.get_mapping_vm()[str(vm_uuid)])
|
||||
|
||||
@@ -117,6 +121,7 @@ class Mapping(object):
|
||||
:param dest_hypervisor:
|
||||
:return:
|
||||
"""
|
||||
|
||||
if src_hypervisor == dest_hypervisor:
|
||||
return False
|
||||
# unmap
|
||||
|
||||
@@ -24,9 +24,10 @@ LOG = log.getLogger(__name__)
|
||||
|
||||
class DefaultSolution(Solution):
|
||||
def __init__(self):
|
||||
"""The DefaultSolution class store a set of actions generated by a
|
||||
strategy in order to achieve the goal.
|
||||
"""Stores a set of actions generated by a strategy
|
||||
|
||||
The DefaultSolution class store a set of actions generated by a
|
||||
strategy in order to achieve the goal.
|
||||
"""
|
||||
super(DefaultSolution, self).__init__()
|
||||
self._actions = []
|
||||
@@ -39,6 +40,5 @@ class DefaultSolution(Solution):
|
||||
|
||||
@property
|
||||
def actions(self):
|
||||
"""Get the current actions of the solution
|
||||
"""
|
||||
"""Get the current actions of the solution"""
|
||||
return self._actions
|
||||
|
||||
@@ -27,7 +27,9 @@ LOG = log.getLogger(__name__)
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class BaseStrategy(object):
|
||||
"""A Strategy is an algorithm implementation which is able to find a
|
||||
"""A base class for all the strategies
|
||||
|
||||
A Strategy is an algorithm implementation which is able to find a
|
||||
Solution for a given Goal.
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user