fog-openstack 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -28
  3. data/docs/workflow.md +129 -0
  4. data/examples/workflow/workflow-examples.rb +387 -0
  5. data/gemfiles/Gemfile-1.9 +1 -0
  6. data/lib/fog/openstack.rb +5 -1
  7. data/lib/fog/openstack/baremetal.rb +14 -38
  8. data/lib/fog/openstack/compute.rb +4 -33
  9. data/lib/fog/openstack/core.rb +104 -50
  10. data/lib/fog/openstack/identity.rb +2 -1
  11. data/lib/fog/openstack/identity_v2.rb +0 -2
  12. data/lib/fog/openstack/identity_v3.rb +0 -2
  13. data/lib/fog/openstack/image_v1.rb +6 -6
  14. data/lib/fog/openstack/image_v2.rb +7 -6
  15. data/lib/fog/openstack/introspection.rb +10 -35
  16. data/lib/fog/openstack/metering.rb +16 -35
  17. data/lib/fog/openstack/monitoring.rb +5 -31
  18. data/lib/fog/openstack/network.rb +5 -34
  19. data/lib/fog/openstack/nfv.rb +10 -35
  20. data/lib/fog/openstack/orchestration.rb +5 -40
  21. data/lib/fog/openstack/planning.rb +11 -36
  22. data/lib/fog/openstack/requests/compute/get_limits.rb +8 -7
  23. data/lib/fog/openstack/requests/network/update_router.rb +1 -1
  24. data/lib/fog/openstack/requests/workflow_v2/create_action.rb +28 -0
  25. data/lib/fog/openstack/requests/workflow_v2/create_action_execution.rb +31 -0
  26. data/lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb +55 -0
  27. data/lib/fog/openstack/requests/workflow_v2/create_environment.rb +31 -0
  28. data/lib/fog/openstack/requests/workflow_v2/create_execution.rb +30 -0
  29. data/lib/fog/openstack/requests/workflow_v2/create_workbook.rb +28 -0
  30. data/lib/fog/openstack/requests/workflow_v2/create_workflow.rb +28 -0
  31. data/lib/fog/openstack/requests/workflow_v2/delete_action.rb +25 -0
  32. data/lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb +25 -0
  33. data/lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb +25 -0
  34. data/lib/fog/openstack/requests/workflow_v2/delete_environment.rb +25 -0
  35. data/lib/fog/openstack/requests/workflow_v2/delete_execution.rb +25 -0
  36. data/lib/fog/openstack/requests/workflow_v2/delete_workbook.rb +25 -0
  37. data/lib/fog/openstack/requests/workflow_v2/delete_workflow.rb +25 -0
  38. data/lib/fog/openstack/requests/workflow_v2/get_action.rb +27 -0
  39. data/lib/fog/openstack/requests/workflow_v2/get_action_execution.rb +26 -0
  40. data/lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb +28 -0
  41. data/lib/fog/openstack/requests/workflow_v2/get_environment.rb +28 -0
  42. data/lib/fog/openstack/requests/workflow_v2/get_execution.rb +26 -0
  43. data/lib/fog/openstack/requests/workflow_v2/get_task.rb +27 -0
  44. data/lib/fog/openstack/requests/workflow_v2/get_workbook.rb +28 -0
  45. data/lib/fog/openstack/requests/workflow_v2/get_workflow.rb +28 -0
  46. data/lib/fog/openstack/requests/workflow_v2/list_action_executions.rb +28 -0
  47. data/lib/fog/openstack/requests/workflow_v2/list_actions.rb +30 -0
  48. data/lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb +28 -0
  49. data/lib/fog/openstack/requests/workflow_v2/list_environments.rb +28 -0
  50. data/lib/fog/openstack/requests/workflow_v2/list_executions.rb +28 -0
  51. data/lib/fog/openstack/requests/workflow_v2/list_services.rb +28 -0
  52. data/lib/fog/openstack/requests/workflow_v2/list_tasks.rb +28 -0
  53. data/lib/fog/openstack/requests/workflow_v2/list_workbooks.rb +28 -0
  54. data/lib/fog/openstack/requests/workflow_v2/list_workflows.rb +30 -0
  55. data/lib/fog/openstack/requests/workflow_v2/rerun_task.rb +33 -0
  56. data/lib/fog/openstack/requests/workflow_v2/update_action.rb +28 -0
  57. data/lib/fog/openstack/requests/workflow_v2/update_action_execution.rb +33 -0
  58. data/lib/fog/openstack/requests/workflow_v2/update_environment.rb +31 -0
  59. data/lib/fog/openstack/requests/workflow_v2/update_execution.rb +33 -0
  60. data/lib/fog/openstack/requests/workflow_v2/update_workbook.rb +28 -0
  61. data/lib/fog/openstack/requests/workflow_v2/update_workflow.rb +28 -0
  62. data/lib/fog/openstack/requests/workflow_v2/validate_action.rb +28 -0
  63. data/lib/fog/openstack/requests/workflow_v2/validate_workbook.rb +28 -0
  64. data/lib/fog/openstack/requests/workflow_v2/validate_workflow.rb +28 -0
  65. data/lib/fog/openstack/storage.rb +4 -35
  66. data/lib/fog/openstack/version.rb +1 -1
  67. data/lib/fog/openstack/volume_v1.rb +7 -5
  68. data/lib/fog/openstack/volume_v2.rb +7 -5
  69. data/lib/fog/openstack/workflow.rb +12 -0
  70. data/lib/fog/openstack/workflow_v2.rb +160 -0
  71. metadata +48 -95
  72. data/lib/fog/openstack/common.rb +0 -44
  73. data/tests/openstack/models/compute/images_tests.rb +0 -13
  74. data/tests/openstack/models/compute/security_group_tests.rb +0 -54
  75. data/tests/openstack/models/compute/server_tests.rb +0 -220
  76. data/tests/openstack/models/compute/service_tests.rb +0 -17
  77. data/tests/openstack/models/image/image_tests.rb +0 -36
  78. data/tests/openstack/models/image/images_tests.rb +0 -19
  79. data/tests/openstack/models/network/floating_ip_tests.rb +0 -35
  80. data/tests/openstack/models/network/floating_ips_tests.rb +0 -19
  81. data/tests/openstack/models/network/ike_policies_tests.rb +0 -28
  82. data/tests/openstack/models/network/ike_policy_tests.rb +0 -36
  83. data/tests/openstack/models/network/ipsec_policies_tests.rb +0 -26
  84. data/tests/openstack/models/network/ipsec_policy_tests.rb +0 -36
  85. data/tests/openstack/models/network/ipsec_site_connection_tests.rb +0 -50
  86. data/tests/openstack/models/network/ipsec_site_connections_tests.rb +0 -32
  87. data/tests/openstack/models/network/lb_health_monitor_tests.rb +0 -52
  88. data/tests/openstack/models/network/lb_health_monitors_tests.rb +0 -21
  89. data/tests/openstack/models/network/lb_member_tests.rb +0 -28
  90. data/tests/openstack/models/network/lb_members_tests.rb +0 -21
  91. data/tests/openstack/models/network/lb_pool_tests.rb +0 -53
  92. data/tests/openstack/models/network/lb_pools_tests.rb +0 -20
  93. data/tests/openstack/models/network/lb_vip_tests.rb +0 -39
  94. data/tests/openstack/models/network/lb_vips_tests.rb +0 -21
  95. data/tests/openstack/models/network/network_tests.rb +0 -61
  96. data/tests/openstack/models/network/networks_tests.rb +0 -21
  97. data/tests/openstack/models/network/port_tests.rb +0 -28
  98. data/tests/openstack/models/network/ports_tests.rb +0 -25
  99. data/tests/openstack/models/network/router_tests.rb +0 -39
  100. data/tests/openstack/models/network/routers_tests.rb +0 -21
  101. data/tests/openstack/models/network/security_group_rule_tests.rb +0 -27
  102. data/tests/openstack/models/network/security_group_rules_tests.rb +0 -25
  103. data/tests/openstack/models/network/security_group_tests.rb +0 -17
  104. data/tests/openstack/models/network/security_groups_tests.rb +0 -16
  105. data/tests/openstack/models/network/subnet_tests.rb +0 -30
  106. data/tests/openstack/models/network/subnets_tests.rb +0 -27
  107. data/tests/openstack/models/network/vpn_service_tests.rb +0 -27
  108. data/tests/openstack/models/network/vpn_services_tests.rb +0 -22
  109. data/tests/openstack/models/nfv/vnf_tests.rb +0 -35
  110. data/tests/openstack/models/nfv/vnfd_tests.rb +0 -23
  111. data/tests/openstack/models/nfv/vnfds_tests.rb +0 -31
  112. data/tests/openstack/models/nfv/vnfs_tests.rb +0 -38
  113. data/tests/openstack/models/planning/.gitkeep +0 -0
  114. data/tests/openstack/models/planning/plan_tests.rb +0 -51
  115. data/tests/openstack/models/planning/plans_tests.rb +0 -18
  116. data/tests/openstack/models/planning/role_tests.rb +0 -14
  117. data/tests/openstack/models/storage/file_tests.rb +0 -251
  118. data/tests/openstack/requests/compute/address_tests.rb +0 -58
  119. data/tests/openstack/requests/compute/aggregate_tests.rb +0 -59
  120. data/tests/openstack/requests/compute/availability_zone_tests.rb +0 -18
  121. data/tests/openstack/requests/compute/flavor_tests.rb +0 -95
  122. data/tests/openstack/requests/compute/helper.rb +0 -41
  123. data/tests/openstack/requests/compute/image_tests.rb +0 -58
  124. data/tests/openstack/requests/compute/keypair_tests.rb +0 -30
  125. data/tests/openstack/requests/compute/limit_tests.rb +0 -59
  126. data/tests/openstack/requests/compute/quota_tests.rb +0 -60
  127. data/tests/openstack/requests/compute/security_group_tests.rb +0 -61
  128. data/tests/openstack/requests/compute/server_tests.rb +0 -289
  129. data/tests/openstack/requests/compute/service_tests.rb +0 -33
  130. data/tests/openstack/requests/compute/tenant_tests.rb +0 -19
  131. data/tests/openstack/requests/compute/volume_tests.rb +0 -38
  132. data/tests/openstack/requests/image/image_tests.rb +0 -135
  133. data/tests/openstack/requests/metering/event_tests.rb +0 -17
  134. data/tests/openstack/requests/metering/meter_tests.rb +0 -52
  135. data/tests/openstack/requests/metering/resource_tests.rb +0 -19
  136. data/tests/openstack/requests/network/ike_policy_tests.rb +0 -65
  137. data/tests/openstack/requests/network/ipsec_policy_tests.rb +0 -65
  138. data/tests/openstack/requests/network/ipsec_site_connection_tests.rb +0 -82
  139. data/tests/openstack/requests/network/lb_health_monitor_tests.rb +0 -93
  140. data/tests/openstack/requests/network/lb_member_tests.rb +0 -60
  141. data/tests/openstack/requests/network/lb_pool_tests.rb +0 -80
  142. data/tests/openstack/requests/network/lb_vip_tests.rb +0 -71
  143. data/tests/openstack/requests/network/network_tests.rb +0 -107
  144. data/tests/openstack/requests/network/port_tests.rb +0 -66
  145. data/tests/openstack/requests/network/quota_tests.rb +0 -65
  146. data/tests/openstack/requests/network/router_tests.rb +0 -73
  147. data/tests/openstack/requests/network/security_group_rule_tests.rb +0 -58
  148. data/tests/openstack/requests/network/security_group_tests.rb +0 -43
  149. data/tests/openstack/requests/network/subnet_tests.rb +0 -66
  150. data/tests/openstack/requests/network/vpn_service_tests.rb +0 -61
  151. data/tests/openstack/requests/nfv/vnf_tests.rb +0 -70
  152. data/tests/openstack/requests/nfv/vnfd_tests.rb +0 -44
  153. data/tests/openstack/requests/orchestration/stack_tests.rb +0 -64
  154. data/tests/openstack/requests/planning/.gitkeep +0 -0
  155. data/tests/openstack/requests/planning/plan_tests.rb +0 -65
  156. data/tests/openstack/requests/planning/role_tests.rb +0 -16
  157. data/tests/openstack/requests/storage/container_tests.rb +0 -64
  158. data/tests/openstack/requests/storage/large_object_tests.rb +0 -372
  159. data/tests/openstack/requests/storage/object_tests.rb +0 -208
  160. data/tests/openstack/requests/volume/availability_zone_tests.rb +0 -13
  161. data/tests/openstack/requests/volume/quota_tests.rb +0 -50
  162. data/tests/openstack/requests/volume/volume_type_tests.rb +0 -32
@@ -0,0 +1,30 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def list_workflows(params = {})
7
+ body = Fog::JSON.encode(params)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "GET",
12
+ :path => "workflows"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def list_workflows(_params = {})
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = { "workflows" =>
22
+ [{ "name" => "workflow1", "description" => "d1" },
23
+ { "name" => "workflow2", "description" => "d2" }] }
24
+ response
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,33 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def rerun_task(task_ex_id)
7
+ rerun_payload = {
8
+ :id => task_ex_id,
9
+ :state => 'RUNNING',
10
+ :reset => true
11
+ }
12
+ body = Fog::JSON.encode(rerun_payload)
13
+ request(
14
+ :body => body,
15
+ :expects => 200,
16
+ :method => "PUT",
17
+ :path => "tasks/#{task_ex_id}"
18
+ )
19
+ end
20
+ end
21
+
22
+ class Mock
23
+ def update_action(_task_ex_id)
24
+ response = Excon::Response.new
25
+ response.status = 200
26
+ response.body = ""
27
+ response
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def update_action(definition)
7
+ body = Fog::JSON.encode(definition)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "PUT",
12
+ :path => "actions"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def update_action(_definition)
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = ""
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,33 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def update_action_execution(id, name, value)
7
+ # valid values for name are:
8
+ # state, output
9
+ # https://github.com/openstack/python-mistralclient/blob/master/mistralclient/commands/v2/action_executions.py
10
+ data = { :id => id }
11
+ data[name] = Fog::JSON.encode(value)
12
+ body = Fog::JSON.encode(data)
13
+ request(
14
+ :body => body,
15
+ :expects => 200,
16
+ :method => "PUT",
17
+ :path => "action_executions"
18
+ )
19
+ end
20
+ end
21
+
22
+ class Mock
23
+ def update_action_execution(_id, _name, _value)
24
+ response = Excon::Response.new
25
+ response.status = 200
26
+ response.body = ""
27
+ response
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,31 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def update_environment(definition)
7
+ unless definition["variables"].nil?
8
+ definition["variables"] = Fog::JSON.encode(definition["variables"])
9
+ end
10
+ body = Fog::JSON.encode(definition)
11
+ request(
12
+ :body => body,
13
+ :expects => 200,
14
+ :method => "PUT",
15
+ :path => "environments"
16
+ )
17
+ end
18
+ end
19
+
20
+ class Mock
21
+ def update_environment(_definition)
22
+ response = Excon::Response.new
23
+ response.status = 200
24
+ response.body = ""
25
+ response
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,33 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def update_execution(id, name, value)
7
+ # valid values for name are:
8
+ # state, description, env
9
+ # https://github.com/openstack/python-mistralclient/blob/master/mistralclient/commands/v2/executions.py
10
+ data = { :id => id }
11
+ data[name] = Fog::JSON.encode(value)
12
+ body = Fog::JSON.encode(data)
13
+ request(
14
+ :body => body,
15
+ :expects => 200,
16
+ :method => "PUT",
17
+ :path => "executions"
18
+ )
19
+ end
20
+ end
21
+
22
+ class Mock
23
+ def update_execution(_id, _name, _value)
24
+ response = Excon::Response.new
25
+ response.status = 200
26
+ response.body = ""
27
+ response
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def update_workbook(definition)
7
+ body = Fog::JSON.encode(definition)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "PUT",
12
+ :path => "workbooks"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def update_workbook(_definition)
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = ""
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def update_workflow(definition)
7
+ body = Fog::JSON.encode(definition)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "PUT",
12
+ :path => "workflows"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def update_workflow(_definition)
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = ""
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def validate_action(definition)
7
+ body = Fog::JSON.encode(definition)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "POST",
12
+ :path => "actions/validate"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def validate_action(_definition)
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = "{\"valid\": true}"
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def validate_workbook(definition)
7
+ body = Fog::JSON.encode(definition)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "POST",
12
+ :path => "workbooks/validate"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def validate_workbook(_definition)
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = "{\"valid\": true}"
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def validate_workflow(definition)
7
+ body = Fog::JSON.encode(definition)
8
+ request(
9
+ :body => body,
10
+ :expects => 200,
11
+ :method => "POST",
12
+ :path => "workflows/validate"
13
+ )
14
+ end
15
+ end
16
+
17
+ class Mock
18
+ def validate_workflow(_definition)
19
+ response = Excon::Response.new
20
+ response.status = 200
21
+ response.body = "{\"valid\": true}"
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -82,6 +82,10 @@ module Fog
82
82
  class Real
83
83
  include Fog::OpenStack::Core
84
84
 
85
+ def self.not_found_class
86
+ Fog::Storage::OpenStack::NotFound
87
+ end
88
+
85
89
  def initialize(options={})
86
90
  initialize_identity options
87
91
 
@@ -140,41 +144,6 @@ module Fog
140
144
  def reset_account_name
141
145
  @path = @original_path
142
146
  end
143
-
144
- def request(params, parse_json = true)
145
- begin
146
- response = @connection.request(params.merge({
147
- :headers => {
148
- 'Content-Type' => 'application/json',
149
- 'Accept' => 'application/json',
150
- 'X-Auth-Token' => @auth_token
151
- }.merge!(params[:headers] || {}),
152
- :path => "#{@path}/#{params[:path]}",
153
- }))
154
- rescue Excon::Errors::Unauthorized => error
155
- if error.response.body != 'Bad username or password' # token expiration
156
- @openstack_must_reauthenticate = true
157
- authenticate
158
- retry
159
- else # bad credentials
160
- raise error
161
- end
162
- rescue Excon::Errors::HTTPStatusError => error
163
- raise case error
164
- when Excon::Errors::NotFound
165
- Fog::Storage::OpenStack::NotFound.slurp(error)
166
- else
167
- error
168
- end
169
- end
170
- if !response.body.empty? && parse_json && response.get_header('Content-Type') =~ %r{application/json}
171
- response.body = Fog::JSON.decode(response.body)
172
- end
173
- response
174
- end
175
-
176
- private
177
-
178
147
  end
179
148
  end
180
149
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Openstack
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
@@ -1,5 +1,4 @@
1
1
  require 'fog/openstack/core'
2
- require 'fog/openstack/common'
3
2
  require 'fog/openstack/volume'
4
3
 
5
4
  module Fog
@@ -138,10 +137,10 @@ module Fog
138
137
 
139
138
  class Real
140
139
  include Fog::OpenStack::Core
140
+
141
141
  def self.not_found_class
142
142
  Fog::Volume::OpenStack::NotFound
143
143
  end
144
- include Fog::OpenStack::Common
145
144
 
146
145
  def initialize(options = {})
147
146
  initialize_identity options
@@ -153,16 +152,19 @@ module Fog
153
152
  @connection_options = options[:connection_options] || {}
154
153
 
155
154
  authenticate
155
+ set_api_path
156
+
157
+ @persistent = options[:persistent] || false
158
+ @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
159
+ end
156
160
 
161
+ def set_api_path
157
162
  unless @path.match(SUPPORTED_VERSIONS)
158
163
  @path = Fog::OpenStack.get_supported_version_path(SUPPORTED_VERSIONS,
159
164
  @openstack_management_uri,
160
165
  @auth_token,
161
166
  @connection_options)
162
167
  end
163
-
164
- @persistent = options[:persistent] || false
165
- @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
166
168
  end
167
169
  end
168
170
  end
@@ -1,5 +1,4 @@
1
1
  require 'fog/openstack/core'
2
- require 'fog/openstack/common'
3
2
  require 'fog/openstack/volume'
4
3
 
5
4
  module Fog
@@ -139,10 +138,10 @@ module Fog
139
138
 
140
139
  class Real
141
140
  include Fog::OpenStack::Core
141
+
142
142
  def self.not_found_class
143
143
  Fog::Volume::OpenStack::NotFound
144
144
  end
145
- include Fog::OpenStack::Common
146
145
 
147
146
  def initialize(options = {})
148
147
  initialize_identity options
@@ -154,16 +153,19 @@ module Fog
154
153
  @connection_options = options[:connection_options] || {}
155
154
 
156
155
  authenticate
156
+ set_api_path
157
+
158
+ @persistent = options[:persistent] || false
159
+ @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
160
+ end
157
161
 
162
+ def set_api_path
158
163
  unless @path.match(SUPPORTED_VERSIONS)
159
164
  @path = Fog::OpenStack.get_supported_version_path(SUPPORTED_VERSIONS,
160
165
  @openstack_management_uri,
161
166
  @auth_token,
162
167
  @connection_options)
163
168
  end
164
-
165
- @persistent = options[:persistent] || false
166
- @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
167
169
  end
168
170
  end
169
171
  end