summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorTushar Patil <tushar.vitthal.patil@gmail.com>2011-07-19 17:35:44 -0700
committerTushar Patil <tushar.vitthal.patil@gmail.com>2011-07-19 17:35:44 -0700
commit6b47f87c9e22fa09cedc3e48b7c8dcf52b5d016a (patch)
tree20a1dd7d8aafa4a49aa22c450201eb960998c51b /nova/api
parent6cbd1d860d6a3fe96417391c21fb79b1750ecdcf (diff)
downloadnova-6b47f87c9e22fa09cedc3e48b7c8dcf52b5d016a.tar.gz
nova-6b47f87c9e22fa09cedc3e48b7c8dcf52b5d016a.tar.xz
nova-6b47f87c9e22fa09cedc3e48b7c8dcf52b5d016a.zip
Fixed broken unit testcases after adding extension and minor code refactoring
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/contrib/createserverext.py11
-rw-r--r--nova/api/openstack/create_instance_helper.py9
2 files changed, 10 insertions, 10 deletions
diff --git a/nova/api/openstack/contrib/createserverext.py b/nova/api/openstack/contrib/createserverext.py
index e8fe9afad..78dba425a 100644
--- a/nova/api/openstack/contrib/createserverext.py
+++ b/nova/api/openstack/contrib/createserverext.py
@@ -137,6 +137,15 @@ class CreateInstanceHelperEx(helper.CreateInstanceHelper):
# Let the caller deal with unhandled exceptions.
+ def _validate_fixed_ip(self, value):
+ if not isinstance(value, basestring):
+ msg = _("Fixed IP is not a string or unicode")
+ raise exc.HTTPBadRequest(explanation=msg)
+
+ if value.strip() == '':
+ msg = _("Fixed IP is an empty string")
+ raise exc.HTTPBadRequest(explanation=msg)
+
def _get_requested_networks(self, requested_networks):
"""
Create a list of requested networks from the networks attribute
@@ -202,7 +211,7 @@ class Createserverext(extensions.ExtensionDescriptor):
return "Extended support to the Create Server v1.1 API"
def get_namespace(self):
- return "http://docs.openstack.org/ext/serverscreateext/api/v1.1"
+ return "http://docs.openstack.org/ext/createserverext/api/v1.1"
def get_updated(self):
return "2011-07-19T00:00:00+00:00"
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index 8579c45df..fba0cb8ba 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -193,15 +193,6 @@ class CreateInstanceHelper(object):
msg = _("Server name is an empty string")
raise exc.HTTPBadRequest(explanation=msg)
- def _validate_fixed_ip(self, value):
- if not isinstance(value, basestring):
- msg = _("Fixed IP is not a string or unicode")
- raise exc.HTTPBadRequest(explanation=msg)
-
- if value.strip() == '':
- msg = _("Fixed IP is an empty string")
- raise exc.HTTPBadRequest(explanation=msg)
-
def _get_kernel_ramdisk_from_image(self, req, image_id):
"""Fetch an image from the ImageService, then if present, return the
associated kernel and ramdisk image IDs.