Commit e11537cd authored by Christos Stavrakakis's avatar Christos Stavrakakis

cyclades: Fix type error

parent 0e560529
......@@ -81,9 +81,9 @@ def get_resource(name, value, for_update=False):
capital_name = name.capitalize()
if name in ["server", "network", "port"]:
if isinstance(value, basestring) and name in ["server", "network", "port"]:
if value.startswith(settings.BACKEND_PREFIX_ID):
if name == "server":
value = id_from_instance_name(value)
elif name == "network":
......@@ -91,7 +91,8 @@ def get_resource(name, value, for_update=False):
elif name == "port":
value = id_from_nic_name(value)
except ValueError:
raise CommandError("Invalid {} ID: {}".format(capital_name, value))
raise CommandError("Invalid {} ID: {}".format(capital_name,
if for_update:
objects = objects.select_for_update()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment