Added missing support for resource states in unicode format in VM workload consolidation strategy
Unicode type resource state is now handled in the same fashion as resource state specified by general string. Change-Id: I35ffa09015283b51c935515436735aecbe83a9d6 Closes-Bug: #1565764
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
from copy import deepcopy
|
||||
|
||||
from oslo_log import log
|
||||
import six
|
||||
|
||||
from watcher._i18n import _LE, _LI
|
||||
from watcher.common import exception
|
||||
@@ -95,7 +96,7 @@ class VMWorkloadConsolidation(base.BaseStrategy):
|
||||
|
||||
:param state: resource state of unknown type
|
||||
"""
|
||||
if type(state) == str:
|
||||
if isinstance(state, six.string_types):
|
||||
return state
|
||||
elif (type(state) == hyper_state.HypervisorState or
|
||||
type(state) == vm_state.VMState):
|
||||
|
||||
Reference in New Issue
Block a user