Skip to content

Commit

Permalink
Bug 888170: Fixing references to incorrect schema.
Browse files Browse the repository at this point in the history
Change-Id: I738d8c45078a17481856a3b2661fa9436d86df78
  • Loading branch information
yoga80 committed Nov 9, 2011
1 parent 009f2c9 commit fb98f6b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions keystone/logic/types/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def from_xml(xml_str):
dom.append(etree.fromstring(xml_str))
root = dom.find(
"{http://docs.openstack.org/identity"\
"/api/ext/OSKSCATALOG/v1.0}" \
"/api/ext/OS-KSCATALOG/v1.0}" \
"endpointTemplate")
if root == None:
raise fault.BadRequestFault("Expecting endpointTemplate")
Expand Down Expand Up @@ -155,7 +155,7 @@ def __init__(self, id, region, name, type, public_url, admin_url,
def to_dom(self):
dom = etree.Element("endpointTemplate",
xmlns="http://docs.openstack.org/"
"identity/api/ext/OSKSCATALOG/v1.0")
"identity/api/ext/OS-KSCATALOG/v1.0")
if self.id:
dom.set("id", str(self.id))
if self.region:
Expand Down Expand Up @@ -231,7 +231,7 @@ def __init__(self, values, links):
def to_xml(self):
dom = etree.Element("endpointTemplates")
dom.set(u"xmlns",
"http://docs.openstack.org/identity/api/ext/OSKSCATALOG/v1.0")
"http://docs.openstack.org/identity/api/ext/OS-KSCATALOG/v1.0")

for t in self.values:
dom.append(t.to_dom())
Expand Down
2 changes: 1 addition & 1 deletion keystone/test/functional/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ class FunctionalTestCase(ApiTestCase):
xmlns = 'http://docs.openstack.org/identity/api/v2.0'
xmlns_ksadm = 'http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0'
xmlns_kscatalog = "http://docs.openstack.org/identity/api/ext"\
+ "/OSKSCATALOG/v1.0"
+ "/OS-KSCATALOG/v1.0"

def setUp(self):
"""Prepare keystone for system tests"""
Expand Down
26 changes: 13 additions & 13 deletions keystone/test/functional/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ def test_update_endpoint_xml(self):

data = ('<?xml version="1.0" encoding="UTF-8"?> '
'<endpointTemplate '
'xmlns="http://docs.openstack.org'
'/identity/api/ext/OSKSCATALOG/v1.0" '
'xmlns="%s" '
'region="%s" name="%s" type="%s"'
' publicURL="%s" adminURL="%s"'
' internalURL="%s" enabled="%s" global="%s"/>') % (region,
' internalURL="%s" enabled="%s" global="%s"/>') % (
self.xmlns_kscatalog, region,
self.service['name'], self.service['type'],
public_url, admin_url, internal_url,
enabled, is_global)
Expand Down Expand Up @@ -354,11 +354,11 @@ def test_endpoint_create_xml_using_expired_token(self):
self.admin_token = self.expired_admin_token
data = ('<?xml version="1.0" encoding="UTF-8"?> '
'<endpointTemplate '
'xmlns="http://docs.openstack.org/identity'
'/api/ext/OSKSCATALOG/v1.0" '
'xmlns="%s" '
'region="%s" name="%s"'
' type="%s" publicURL="%s" adminURL="%s" '
'internalURL="%s" enabled="%s" global="%s"/>') % (
self.xmlns_kscatalog,
common.unique_str(),
self.service['name'],
self.service['type'], common.unique_url(),
Expand All @@ -370,11 +370,11 @@ def test_endpoint_create_xml_using_disabled_token(self):
self.admin_token = self.disabled_admin_token
data = ('<?xml version="1.0" encoding="UTF-8"?> '
'<endpointTemplate '
'xmlns="http://docs.openstack.org/identity'
'/api/ext/OSKSCATALOG/v1.0" '
'xmlns="%s" '
'region="%s" name="%s" type="%s" publicURL="%s" adminURL="%s" '
'internalURL="%s" enabled="%s" global="%s"/>') % (
common.unique_str(), self.service['name'],
self.xmlns_kscatalog, common.unique_str(),
self.service['name'],
self.service['type'], common.unique_url(),
common.unique_url(), common.unique_url(), True, True)
self.post_endpoint_template(as_xml=data, assert_status=403, headers={
Expand All @@ -384,10 +384,10 @@ def test_endpoint_create_xml_using_missing_token(self):
self.admin_token = ''
data = ('<?xml version="1.0" encoding="UTF-8"?> '
'<endpointTemplate '
'xmlns="http://docs.openstack.org'
'/identity/api/ext/OSKSCATALOG/v1.0" '
'xmlns="%s" '
'region="%s" name="%s" type="%s" publicURL="%s" adminURL="%s" '
'internalURL="%s" enabled="%s" global="%s"/>') % (
self.xmlns_kscatalog,
common.unique_str(),
self.service['name'], self.service['type'],
common.unique_url(),
Expand All @@ -399,11 +399,11 @@ def test_endpoint_create_xml_using_invalid_token(self):
self.admin_token = common.unique_str()
data = ('<?xml version="1.0" encoding="UTF-8"?> '
'<endpointTemplate '
'xmlns="http://docs.openstack.org/'
'identity/api/ext/OSKSCATALOG/v1.0" '
'xmlns="%s" '
'region="%s" name="%s" type="%s" publicURL="%s" adminURL="%s" '
'internalURL="%s" enabled="%s" global="%s"/>') % (
common.unique_str(), self.service['name'],
self.xmlns_kscatalog, common.unique_str(),
self.service['name'],
self.service['type'], common.unique_url(),
common.unique_url(), common.unique_url(), True, True)
self.post_endpoint_template(as_xml=data, assert_status=401, headers={
Expand Down

0 comments on commit fb98f6b

Please sign in to comment.