fix files I checked into the wrong directory
diff --git a/planetstack/observer/steps/sync_image_deployments.py b/planetstack/observer/steps/sync_image_deployments.py
index 31556c3..3522eca 100644
--- a/planetstack/observer/steps/sync_image_deployments.py
+++ b/planetstack/observer/steps/sync_image_deployments.py
@@ -41,10 +41,20 @@
if glance_image:
image_deployment.glance_image_id = glance_image['id']
elif image_deployment.image.path:
+ image = {
+ 'name': image_deployment.image.name,
+ 'is_public': True,
+ 'disk_format': 'raw',
+ 'container_format': 'bare',
+ 'file': image_deployment.image.path,
+ }
glance_image = driver.shell.glanceclient.images.create(name=image_deployment.image.name,
is_public=True,
disk_format='raw',
container_format='bare')
glance_image.update(data=open(image_deployment.image.path, 'rb'))
- image_deployment.glance_image_id = glance_image.id
+
+ if not glance_image or not glance_image.get('id'):
+ raise Exception, "Add image failed at deployment %s" % image_deployment.deployment.name
+ image_deployment.glance_image_id = glance_image['id']
image_deployment.save()