diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-04-19 09:19:52 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-04-19 09:19:52 -0700 |
| commit | 745351d1e2a98a98de0a5f955385a92c01110684 (patch) | |
| tree | ccbe0b88a4d7124252815a92b1c7f912fa969daf /nova/api | |
| parent | 8b21dd6634cc32c43d0bebf3dede40b4b28c0a78 (diff) | |
Fixes cloudpipe to get the proper ip address.
* Changes FLAGS.vpn_image_id to integer
* Converts to str when comparing because instance['image_id'] is a str
* Removes unused method from db
* Converts integer_id to ami when launching
* Adds docs for setting up interface in cloudpipe image
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/admin.py | 2 | ||||
| -rw-r--r-- | nova/api/ec2/cloud.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/nova/api/ec2/admin.py b/nova/api/ec2/admin.py index 6a5609d4a..ea94d9c1f 100644 --- a/nova/api/ec2/admin.py +++ b/nova/api/ec2/admin.py @@ -266,7 +266,7 @@ class AdminController(object): def _vpn_for(self, context, project_id): """Get the VPN instance for a project ID.""" for instance in db.instance_get_all_by_project(context, project_id): - if (instance['image_id'] == FLAGS.vpn_image_id + if (instance['image_id'] == str(FLAGS.vpn_image_id) and not instance['state_description'] in ['shutting_down', 'shutdown']): return instance diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 10b1d0ac5..d9c1af072 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -703,7 +703,7 @@ class CloudController(object): instances = self.compute_api.get_all(context, **kwargs) for instance in instances: if not context.is_admin: - if instance['image_id'] == FLAGS.vpn_image_id: + if instance['image_id'] == str(FLAGS.vpn_image_id): continue i = {} instance_id = instance['id'] @@ -898,7 +898,7 @@ class CloudController(object): return image_type @staticmethod - def _image_ec2_id(image_id, image_type='ami'): + def image_ec2_id(image_id, image_type='ami'): """Returns image ec2_id using id and three letter type.""" template = image_type + '-%08x' return ec2utils.id_to_ec2_id(int(image_id), template=template) |
