11
11
# under the License.
15
14
from keystoneclient.auth.identity import v2
15
from keystoneclient import fixture
16
16
from keystoneclient import session
18
from novaclient.openstack.common import jsonutils
19
18
from novaclient.v1_1 import client as v1_1client
20
19
from novaclient.v3 import client as v3client
26
25
class V1(fixtures.Fixture):
28
def __init__(self, compute_url=COMPUTE_URL, identity_url=IDENTITY_URL):
27
def __init__(self, requests,
28
compute_url=COMPUTE_URL, identity_url=IDENTITY_URL):
29
29
super(V1, self).__init__()
30
30
self.identity_url = identity_url
31
31
self.compute_url = compute_url
37
"id": "ab48a9efdfedb23ty3494",
38
"expires": "2010-11-01T03:32:15-05:00",
50
"name": "compute:admin",
54
"name": "object-store:admin",
62
"name": "Cloud Servers",
66
"publicURL": self.compute_url,
67
"internalURL": "https://compute1.host/v1/1",
70
"endpoints_links": [],
73
"name": "Cloud Servers",
77
"publicURL": self.compute_url,
78
"internalURL": "https://compute1.host/v1/1",
81
"endpoints_links": [],
33
self.requests = requests
35
self.token = fixture.V2Token()
36
self.token.set_scope()
38
s = self.token.add_service('compute')
39
s.add_endpoint(self.compute_url)
41
s = self.token.add_service('computev3')
42
s.add_endpoint(self.compute_url)
88
45
super(V1, self).setUp()
90
self.addCleanup(httpretty.disable)
92
47
auth_url = '%s/tokens' % self.identity_url
93
httpretty.register_uri(httpretty.POST, auth_url,
94
body=jsonutils.dumps(self.token),
95
content_type='application/json')
48
headers = {'X-Content-Type': 'application/json'}
49
self.requests.register_uri('POST', auth_url,
96
52
self.client = self.new_client()
98
54
def new_client(self):