File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ def take_action(self, parsed_args):
7373 blob = parsed_args .data ,
7474 project = project )
7575
76+ credential ._info .pop ('links' )
7677 return zip (* sorted (six .iteritems (credential ._info )))
7778
7879
@@ -193,4 +194,5 @@ def take_action(self, parsed_args):
193194 credential = utils .find_resource (identity_client .credentials ,
194195 parsed_args .credential )
195196
197+ credential ._info .pop ('links' )
196198 return zip (* sorted (six .iteritems (credential ._info )))
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ def take_action(self, parsed_args):
6666 enabled = parsed_args .enabled ,
6767 )
6868
69+ domain ._info .pop ('links' )
6970 return zip (* sorted (six .iteritems (domain ._info )))
7071
7172
@@ -187,4 +188,5 @@ def take_action(self, parsed_args):
187188 domain = utils .find_resource (identity_client .domains ,
188189 parsed_args .domain )
189190
191+ domain ._info .pop ('links' )
190192 return zip (* sorted (six .iteritems (domain ._info )))
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ def take_action(self, parsed_args):
8181 )
8282
8383 info = {}
84+ endpoint ._info .pop ('links' )
8485 info .update (endpoint ._info )
8586 info ['service_name' ] = service .name
8687 info ['service_type' ] = service .type
@@ -258,6 +259,7 @@ def take_action(self, parsed_args):
258259 service = common .find_service (identity_client , endpoint .service_id )
259260
260261 info = {}
262+ endpoint ._info .pop ('links' )
261263 info .update (endpoint ._info )
262264 info ['service_name' ] = service .name
263265 info ['service_type' ] = service .type
Original file line number Diff line number Diff line change @@ -138,9 +138,8 @@ def take_action(self, parsed_args):
138138 domain = domain ,
139139 description = parsed_args .description )
140140
141- info = {}
142- info .update (group ._info )
143- return zip (* sorted (six .iteritems (info )))
141+ group ._info .pop ('links' )
142+ return zip (* sorted (six .iteritems (group ._info )))
144143
145144
146145class DeleteGroup (command .Command ):
@@ -340,4 +339,5 @@ def take_action(self, parsed_args):
340339 group = utils .find_resource (identity_client .groups ,
341340 parsed_args .group )
342341
342+ group ._info .pop ('links' )
343343 return zip (* sorted (six .iteritems (group ._info )))
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ def take_action(self, parsed_args):
5555 blob = blob , type = parsed_args .type
5656 )
5757
58+ policy ._info .pop ('links' )
5859 return zip (* sorted (six .iteritems (policy ._info )))
5960
6061
@@ -173,4 +174,5 @@ def take_action(self, parsed_args):
173174 policy = utils .find_resource (identity_client .policies ,
174175 parsed_args .policy )
175176
177+ policy ._info .pop ('links' )
176178 return zip (* sorted (six .iteritems (policy ._info )))
Original file line number Diff line number Diff line change @@ -94,9 +94,8 @@ def take_action(self, parsed_args):
9494 ** kwargs
9595 )
9696
97- info = {}
98- info .update (project ._info )
99- return zip (* sorted (six .iteritems (info )))
97+ project ._info .pop ('links' )
98+ return zip (* sorted (six .iteritems (project ._info )))
10099
101100
102101class DeleteProject (command .Command ):
@@ -229,7 +228,7 @@ def take_action(self, parsed_args):
229228 parsed_args .project ,
230229 )
231230
232- kwargs = project . _info
231+ kwargs = {}
233232 if parsed_args .name :
234233 kwargs ['name' ] = parsed_args .name
235234 if parsed_args .domain :
@@ -243,13 +242,6 @@ def take_action(self, parsed_args):
243242 kwargs ['enabled' ] = False
244243 if parsed_args .property :
245244 kwargs .update (parsed_args .property )
246- if 'id' in kwargs :
247- del kwargs ['id' ]
248- if 'domain_id' in kwargs :
249- # Hack around broken Identity API arg names
250- kwargs .update (
251- {'domain' : kwargs .pop ('domain_id' )}
252- )
253245
254246 identity_client .projects .update (project .id , ** kwargs )
255247 return
@@ -287,4 +279,5 @@ def take_action(self, parsed_args):
287279 project = utils .find_resource (identity_client .projects ,
288280 parsed_args .project )
289281
282+ project ._info .pop ('links' )
290283 return zip (* sorted (six .iteritems (project ._info )))
Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ def take_action(self, parsed_args):
157157
158158 role = identity_client .roles .create (name = parsed_args .name )
159159
160+ role ._info .pop ('links' )
160161 return zip (* sorted (six .iteritems (role ._info )))
161162
162163
@@ -472,4 +473,5 @@ def take_action(self, parsed_args):
472473 parsed_args .role ,
473474 )
474475
476+ role ._info .pop ('links' )
475477 return zip (* sorted (six .iteritems (role ._info )))
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ def take_action(self, parsed_args):
7070 enabled = enabled ,
7171 )
7272
73+ service ._info .pop ('links' )
7374 return zip (* sorted (six .iteritems (service ._info )))
7475
7576
@@ -161,7 +162,7 @@ def take_action(self, parsed_args):
161162
162163 service = common .find_service (identity_client , parsed_args .service )
163164
164- kwargs = service . _info
165+ kwargs = {}
165166 if parsed_args .type :
166167 kwargs ['type' ] = parsed_args .type
167168 if parsed_args .name :
@@ -170,8 +171,6 @@ def take_action(self, parsed_args):
170171 kwargs ['enabled' ] = True
171172 if parsed_args .disable :
172173 kwargs ['enabled' ] = False
173- if 'id' in kwargs :
174- del kwargs ['id' ]
175174
176175 identity_client .services .update (
177176 service .id ,
@@ -200,4 +199,5 @@ def take_action(self, parsed_args):
200199
201200 service = common .find_service (identity_client , parsed_args .service )
202201
202+ service ._info .pop ('links' )
203203 return zip (* sorted (six .iteritems (service ._info )))
Original file line number Diff line number Diff line change @@ -116,9 +116,8 @@ def take_action(self, parsed_args):
116116 enabled = enabled
117117 )
118118
119- info = {}
120- info .update (user ._info )
121- return zip (* sorted (six .iteritems (info )))
119+ user ._info .pop ('links' )
120+ return zip (* sorted (six .iteritems (user ._info )))
122121
123122
124123class DeleteUser (command .Command ):
@@ -382,4 +381,5 @@ def take_action(self, parsed_args):
382381 user = utils .find_resource (identity_client .users ,
383382 parsed_args .user )
384383
384+ user ._info .pop ('links' )
385385 return zip (* sorted (six .iteritems (user ._info )))
Original file line number Diff line number Diff line change 1818from openstackclient .tests import fakes
1919from openstackclient .tests import utils
2020
21+ base_url = 'http://identity:5000/v3/'
2122
2223domain_id = 'd1'
2324domain_name = 'oftheking'
2829 'name' : domain_name ,
2930 'description' : domain_description ,
3031 'enabled' : True ,
32+ 'links' : base_url + 'domains/' + domain_id ,
3133}
3234
3335group_id = 'gr-010'
3638GROUP = {
3739 'id' : group_id ,
3840 'name' : group_name ,
41+ 'links' : base_url + 'groups/' + group_id ,
3942}
4043
4144mapping_id = 'test_mapping'
107110 'description' : project_description ,
108111 'enabled' : True ,
109112 'domain_id' : domain_id ,
113+ 'links' : base_url + 'projects/' + project_id ,
110114}
111115
112116PROJECT_2 = {
115119 'description' : project_description + 'plus four more' ,
116120 'enabled' : True ,
117121 'domain_id' : domain_id ,
122+ 'links' : base_url + 'projects/' + project_id ,
118123}
119124
120125role_id = 'r1'
123128ROLE = {
124129 'id' : role_id ,
125130 'name' : role_name ,
131+ 'links' : base_url + 'roles/' + role_id ,
126132}
127133
128134service_id = 's-123'
134140 'name' : service_name ,
135141 'type' : service_type ,
136142 'enabled' : True ,
143+ 'links' : base_url + 'services/' + service_id ,
137144}
138145
139146endpoint_id = 'e-123'
148155 'interface' : endpoint_interface ,
149156 'service_id' : service_id ,
150157 'enabled' : True ,
158+ 'links' : base_url + 'endpoints/' + endpoint_id ,
151159}
152160
153161user_id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
162170 'email' : user_email ,
163171 'enabled' : True ,
164172 'domain_id' : domain_id ,
173+ 'links' : base_url + 'users/' + user_id ,
165174}
166175
167176token_expires = '2014-01-01T00:00:00Z'
You can’t perform that action at this time.
0 commit comments