Skip to content

Commit 1f7ba37

Browse files
committed
Removed unneeded code from previous version.
1 parent 44a3d30 commit 1f7ba37

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

providers/keystone.rb

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
puts "\nUser #{new_resource.user} was created with ID #{user_id}"
2020
else
2121
user_id = shell.stdout.match id_regex
22+
if user_id.empty? || user_id.nil?
23+
raise "ID could not be found. Check Keystone and retry."
24+
end
2225
puts "\nUser #{new_resource.user} already exists with ID #{user_id}"
2326
end
2427
end
2528

2629

2730

2831
action :create_tenant do
29-
service_env = { 'SERVICE_TOKEN' => new_resource.keystone_service_pass,
30-
'SERVICE_ENDPOINT' => 'http://localhost:35357/v2.0' }
31-
3232
find = Mixlib::ShellOut.new('keystone', 'tenant-get',
3333
new_resource.tenant,
3434
:environment => new_resource.env)
@@ -52,9 +52,6 @@
5252

5353

5454
action :create_role do
55-
service_env = { 'SERVICE_TOKEN' => new_resource.keystone_service_pass,
56-
'SERVICE_ENDPOINT' => 'http://localhost:35357/v2.0' }
57-
5855
find = Mixlib::ShellOut.new('keystone', 'role-get',
5956
new_resource.role,
6057
:environment => new_resource.env)
@@ -78,9 +75,6 @@
7875

7976

8077
action :user_role_add do
81-
service_env = { 'SERVICE_TOKEN' => new_resource.keystone_service_pass,
82-
'SERVICE_ENDPOINT' => 'http://localhost:35357/v2.0' }
83-
8478
user_id = nil
8579
tenant_id = nil
8680
role_id = nil
@@ -138,9 +132,6 @@
138132

139133

140134
action :create_service do
141-
service_env = { 'SERVICE_TOKEN' => new_resource.keystone_service_pass,
142-
'SERVICE_ENDPOINT' => 'http://localhost:35357/v2.0' }
143-
144135
find = Mixlib::ShellOut.new('keystone', 'service-get',
145136
new_resource.name,
146137
:environment => new_resource.env)
@@ -166,9 +157,6 @@
166157

167158

168159
action :create_endpoint do
169-
service_env = { 'SERVICE_TOKEN' => new_resource.keystone_service_pass,
170-
'SERVICE_ENDPOINT' => 'http://localhost:35357/v2.0' }
171-
172160
find = Mixlib::ShellOut.new('keystone', 'service-get',
173161
new_resource.service_type,
174162
:environment => new_resource.env)

0 commit comments

Comments
 (0)