Merge "replace type() to isinstance() in nova"

This commit is contained in:
Jenkins 2014-02-10 02:25:29 +00:00 committed by Gerrit Code Review
commit 25e1557456
1 changed files with 2 additions and 2 deletions

View File

@ -1001,9 +1001,9 @@ def is_none_string(val):
def convert_version_to_int(version):
try:
if type(version) == str:
if isinstance(version, six.string_types):
version = convert_version_to_tuple(version)
if type(version) == tuple:
if isinstance(version, tuple):
return reduce(lambda x, y: (x * 1000) + y, version)
except Exception:
raise exception.NovaException(message="Hypervisor version invalid.")