diff options
| author | William Wolf <throughnothing@gmail.com> | 2011-09-19 11:26:14 -0400 |
|---|---|---|
| committer | William Wolf <throughnothing@gmail.com> | 2011-09-19 11:26:14 -0400 |
| commit | 5feb413f7698633c6a598ec2899772269a96b690 (patch) | |
| tree | cfb25bc23c3756b883ee7c9b6fc0aa0a9d30b8c2 /nova/api | |
| parent | 1e094377ada74202bfc4d3c03f6b7f747ad570d7 (diff) | |
| download | nova-5feb413f7698633c6a598ec2899772269a96b690.tar.gz nova-5feb413f7698633c6a598ec2899772269a96b690.tar.xz nova-5feb413f7698633c6a598ec2899772269a96b690.zip | |
make our own function instead of using urllib.urlencode since we apparently don't suppor urlencoded strings yet
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/common.py | 10 | ||||
| -rw-r--r-- | nova/api/openstack/views/servers.py | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py index ca7848678..64d7dded1 100644 --- a/nova/api/openstack/common.py +++ b/nova/api/openstack/common.py @@ -259,6 +259,16 @@ def check_img_metadata_quota_limit(context, metadata): headers={'Retry-After': 0}) +def dict_to_query_str(params): + # TODO: we should just use urllib.urlencode instead of this + # But currently we don't work with urlencoded url's + param_str = "" + for key, val in params.iteritems(): + param_str = param_str + '='.join([str(key), str(val)]) + '&' + + return param_str.rstrip('&') + + class MetadataXMLDeserializer(wsgi.XMLDeserializer): def extract_metadata(self, metadata_node): diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index 0037fd64e..49e7b6645 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -237,7 +237,7 @@ class ViewBuilderV11(ViewBuilder): def generate_next_link(self, server_id, params, is_detail=False): """ Return an href string with proper limit and marker params""" params['marker'] = server_id - return "%s?%s" % (self.base_url, urllib.urlencode(params)) + return "%s?%s" % (self.base_url, common.dict_to_query_str(params)) def generate_href(self, server_id): """Create an url that refers to a specific server id.""" |
