Skip to content
Browse files

Making sure that the YAML parsed stuff is a string to avoid failing i…

…n the next if comparison
  • Loading branch information...
1 parent 394eaf0 commit 518eb65820a52a0cd50f37f7c4f03e4c0f7b9705 @jjmaestro jjmaestro committed Feb 13, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 kraftwerk/cli/commands.py
View
6 kraftwerk/cli/commands.py
@@ -174,23 +174,23 @@ def create_node(config, args):
# Query driver for size, image, and location
- image_id = getattr(args, 'image-id', config["image_id"])
+ image_id = str(getattr(args, 'image-id', config["image_id"]))
for i in config.driver.list_images():
if str(i.id) == image_id:
image = i
break
else:
sys.exit("Image %s not found for this provider. Aborting." % image_id)
- size_id = getattr(args, 'size-id', config["size_id"])
+ size_id = str(getattr(args, 'size-id', config["size_id"]))
for s in config.driver.list_sizes():
if str(s.id) == size_id:
size = s
break
else:
sys.exit("Size %s not found for this provider. Aborting." % size_id)
- location_id = getattr(args, 'location-id', config.get("location_id", "0"))
+ location_id = str(getattr(args, 'location-id', config.get("location_id", "0")))
for l in config.driver.list_locations():
if str(l.id) == location_id:
location = l

0 comments on commit 518eb65

Please sign in to comment.
Something went wrong with that request. Please try again.