fog-openstack 0.1.31 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +4 -1
  4. data/.travis.yml +5 -5
  5. data/.zuul.yaml +8 -8
  6. data/Rakefile +14 -4
  7. data/fog-openstack.gemspec +3 -2
  8. data/lib/fog/baremetal/openstack.rb +6 -24
  9. data/lib/fog/compute/openstack.rb +6 -27
  10. data/lib/fog/compute/openstack/requests/create_security_group.rb +1 -1
  11. data/lib/fog/compute/openstack/requests/create_server.rb +1 -1
  12. data/lib/fog/compute/openstack/requests/evacuate_server.rb +1 -5
  13. data/lib/fog/container_infra/openstack.rb +6 -25
  14. data/lib/fog/dns/openstack/v1.rb +5 -17
  15. data/lib/fog/dns/openstack/v2.rb +5 -22
  16. data/lib/fog/event/openstack.rb +5 -24
  17. data/lib/fog/identity/openstack.rb +24 -71
  18. data/lib/fog/identity/openstack/v2.rb +6 -4
  19. data/lib/fog/identity/openstack/v3.rb +5 -11
  20. data/lib/fog/image/openstack/v1.rb +8 -21
  21. data/lib/fog/image/openstack/v2.rb +8 -21
  22. data/lib/fog/image/openstack/v2/models/image.rb +1 -1
  23. data/lib/fog/introspection/openstack.rb +4 -19
  24. data/lib/fog/key_manager/openstack.rb +5 -47
  25. data/lib/fog/metering/openstack.rb +8 -23
  26. data/lib/fog/metric/openstack.rb +7 -26
  27. data/lib/fog/monitoring/openstack.rb +3 -12
  28. data/lib/fog/network/openstack.rb +5 -26
  29. data/lib/fog/network/openstack/requests/set_tenant.rb +0 -1
  30. data/lib/fog/nfv/openstack.rb +4 -24
  31. data/lib/fog/openstack.rb +17 -431
  32. data/lib/fog/openstack/auth/catalog.rb +64 -0
  33. data/lib/fog/openstack/auth/catalog/v2.rb +23 -0
  34. data/lib/fog/openstack/auth/catalog/v3.rb +23 -0
  35. data/lib/fog/openstack/auth/name.rb +65 -0
  36. data/lib/fog/openstack/auth/token.rb +69 -0
  37. data/lib/fog/openstack/auth/token/v2.rb +70 -0
  38. data/lib/fog/openstack/auth/token/v3.rb +116 -0
  39. data/lib/fog/openstack/core.rb +100 -76
  40. data/lib/fog/openstack/version.rb +1 -1
  41. data/lib/fog/orchestration/openstack.rb +4 -21
  42. data/lib/fog/planning/openstack.rb +13 -23
  43. data/lib/fog/shared_file_system/openstack.rb +10 -27
  44. data/lib/fog/storage/openstack.rb +6 -11
  45. data/lib/fog/volume/openstack.rb +1 -1
  46. data/lib/fog/volume/openstack/models/backup.rb +2 -2
  47. data/lib/fog/volume/openstack/requests/restore_backup.rb +2 -2
  48. data/lib/fog/volume/openstack/requests/update_volume.rb +12 -1
  49. data/lib/fog/volume/openstack/v1.rb +4 -21
  50. data/lib/fog/volume/openstack/v1/models/volume.rb +1 -2
  51. data/lib/fog/volume/openstack/v1/requests/update_volume.rb +0 -17
  52. data/lib/fog/volume/openstack/v2.rb +4 -21
  53. data/lib/fog/volume/openstack/v2/models/volume.rb +1 -1
  54. data/lib/fog/volume/openstack/v2/requests/update_volume.rb +0 -18
  55. data/lib/fog/workflow/openstack/v2.rb +5 -22
  56. data/playbooks/fog-openstack-unittest-spec/run.yaml +2 -1
  57. data/playbooks/fog-openstack-unittest-test/run.yaml +2 -1
  58. data/unit/auth/catalog_test.rb +252 -0
  59. data/unit/auth/name_test.rb +115 -0
  60. data/unit/auth/token_test.rb +478 -0
  61. data/unit/auth_helper.rb +102 -0
  62. data/unit/test_helper.rb +6 -0
  63. metadata +41 -16
  64. data/lib/fog/compute/openstack/requests/list_tenants.rb +0 -43
@@ -0,0 +1,102 @@
1
+ def auth_response_v3(type, name)
2
+ {
3
+ 'token' => {
4
+ 'methods' => ['password'],
5
+ 'roles' => [{
6
+ 'id' => 'id_roles',
7
+ 'name' => 'admin'
8
+ }],
9
+ 'expires_at' => '2017-11-29T07:45:29.908554Z',
10
+ 'project' => {
11
+ 'domain' => {
12
+ 'id' => 'default',
13
+ 'name' => 'Default'
14
+ },
15
+ 'id' => 'project_id',
16
+ 'name' => 'admin'
17
+ },
18
+ 'catalog' => [{
19
+ 'endpoints' => [
20
+ {
21
+ 'region_id' => 'regionOne',
22
+ 'url' => 'http://localhost',
23
+ 'region' => 'regionOne',
24
+ 'interface' => 'internal',
25
+ 'id' => 'id_endpoint_internal'
26
+ },
27
+ {
28
+ 'region_id' => 'regionOne',
29
+ 'url' => 'http://localhost',
30
+ 'region' => 'regionOne',
31
+ 'interface' => 'public',
32
+ 'id' => 'id_endpoint_public'
33
+ },
34
+ {
35
+ 'region_id' => 'regionOne',
36
+ 'url' => 'http://localhost',
37
+ 'region' => 'regionOne',
38
+ 'interface' => 'admin',
39
+ 'id' => 'id_endpoint_admin'
40
+ }
41
+ ],
42
+ 'type' => type,
43
+ 'id' => 'id_endpoints',
44
+ 'name' => name
45
+ }],
46
+ 'user' => {
47
+ 'domain' => {
48
+ 'id' => 'default',
49
+ 'name' => 'Default'
50
+ },
51
+ 'id' => 'id_user',
52
+ 'name' => 'admin'
53
+ },
54
+ 'audit_ids' => ['id_audits'],
55
+ 'issued_at' => '2017-11-29T06:45:29.908578Z'
56
+ }
57
+ }
58
+ end
59
+
60
+ def auth_response_v2(type, name)
61
+ {
62
+ 'access' => {
63
+ 'token' => {
64
+ 'issued_at' => '2017-12-05T10:44:31.454741Z',
65
+ 'expires' => '2017-12-05T11:44:31Z',
66
+ 'id' => '4ae647d3a5294690a3c29bc658e17e26',
67
+ 'tenant' => {
68
+ 'description' => 'admin tenant',
69
+ 'enabled' => true,
70
+ 'id' => 'tenant_id',
71
+ 'name' => 'admin'
72
+ },
73
+ 'audit_ids' => ['Ye0Rq1HzTk2ggUAg8nDGbQ']
74
+ },
75
+ 'serviceCatalog' => [{
76
+ 'endpoints' => [{
77
+ 'adminURL' => 'http://localhost',
78
+ 'region' => 'regionOne',
79
+ 'internalURL' => 'http://localhost',
80
+ 'id' => 'id_endpoints',
81
+ 'publicURL' => 'http://localhost'
82
+ }],
83
+ 'endpoints_links' => [],
84
+ 'type' => type,
85
+ 'name' => name
86
+ }],
87
+ 'user' => {
88
+ 'username' => 'admin',
89
+ 'roles_links' => [],
90
+ 'id' => 'user_id',
91
+ 'roles' => [{
92
+ 'name' => 'admin'
93
+ }],
94
+ 'name' => 'admin'
95
+ },
96
+ 'metadata' => {
97
+ 'is_admin' => 0,
98
+ 'roles' => ['role_id']
99
+ }
100
+ }
101
+ }
102
+ end
@@ -0,0 +1,6 @@
1
+ require 'minitest/autorun'
2
+ require 'webmock/minitest'
3
+
4
+ require 'fog/core'
5
+ require 'fog/json'
6
+ require 'fog/openstack/auth/token'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2018-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1'
61
+ version: '1.6'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1'
68
+ version: '1.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coveralls
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -109,21 +109,21 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rake
112
+ name: minitest
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '10.0'
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '10.0'
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: rubocop
126
+ name: pry-byebug
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,21 +137,21 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: shindo
140
+ name: rake
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.3'
145
+ version: '10.0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.3'
152
+ version: '10.0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: minitest
154
+ name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: shindo
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.3'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.3'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: vcr
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -412,7 +426,6 @@ files:
412
426
  - lib/fog/compute/openstack/requests/list_services.rb
413
427
  - lib/fog/compute/openstack/requests/list_snapshots.rb
414
428
  - lib/fog/compute/openstack/requests/list_snapshots_detail.rb
415
- - lib/fog/compute/openstack/requests/list_tenants.rb
416
429
  - lib/fog/compute/openstack/requests/list_tenants_with_flavor_access.rb
417
430
  - lib/fog/compute/openstack/requests/list_usages.rb
418
431
  - lib/fog/compute/openstack/requests/list_volume_attachments.rb
@@ -1005,6 +1018,13 @@ files:
1005
1018
  - lib/fog/nfv/openstack/requests/list_vnfs.rb
1006
1019
  - lib/fog/nfv/openstack/requests/update_vnf.rb
1007
1020
  - lib/fog/openstack.rb
1021
+ - lib/fog/openstack/auth/catalog.rb
1022
+ - lib/fog/openstack/auth/catalog/v2.rb
1023
+ - lib/fog/openstack/auth/catalog/v3.rb
1024
+ - lib/fog/openstack/auth/name.rb
1025
+ - lib/fog/openstack/auth/token.rb
1026
+ - lib/fog/openstack/auth/token/v2.rb
1027
+ - lib/fog/openstack/auth/token/v3.rb
1008
1028
  - lib/fog/openstack/core.rb
1009
1029
  - lib/fog/openstack/errors.rb
1010
1030
  - lib/fog/openstack/models/collection.rb
@@ -1354,6 +1374,11 @@ files:
1354
1374
  - playbooks/fog-openstack-unittest-spec/run.yaml
1355
1375
  - playbooks/fog-openstack-unittest-test/run.yaml
1356
1376
  - supported.md
1377
+ - unit/auth/catalog_test.rb
1378
+ - unit/auth/name_test.rb
1379
+ - unit/auth/token_test.rb
1380
+ - unit/auth_helper.rb
1381
+ - unit/test_helper.rb
1357
1382
  homepage: https://github.com/fog/fog-openstack
1358
1383
  licenses:
1359
1384
  - MIT
@@ -1374,7 +1399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1374
1399
  version: '0'
1375
1400
  requirements: []
1376
1401
  rubyforge_project:
1377
- rubygems_version: 2.7.6
1402
+ rubygems_version: 2.6.14.1
1378
1403
  signing_key:
1379
1404
  specification_version: 4
1380
1405
  summary: OpenStack fog provider gem
@@ -1,43 +0,0 @@
1
- module Fog
2
- module Compute
3
- class OpenStack
4
- class Real
5
- def list_tenants
6
- response = @identity_connection.request(:expects => [200, 204],
7
- :headers => {'Content-Type' => 'application/json',
8
- 'Accept' => 'application/json',
9
- 'X-Auth-Token' => @auth_token},
10
- :method => 'GET',
11
- :path => '/v2.0/tenants')
12
- response.body = Fog::JSON.decode(response.body)
13
- response
14
- end
15
- end
16
-
17
- class Mock
18
- def list_tenants
19
- response = Excon::Response.new
20
- response.status = [200, 204][rand(2)]
21
- response.body = {
22
- 'tenants_links' => [],
23
- 'tenants' => [
24
- {'id' => '1',
25
- 'description' => 'Has access to everything',
26
- 'enabled' => true,
27
- 'name' => 'admin'},
28
- {'id' => '2',
29
- 'description' => 'Normal tenant',
30
- 'enabled' => true,
31
- 'name' => 'default'},
32
- {'id' => '3',
33
- 'description' => 'Disabled tenant',
34
- 'enabled' => false,
35
- 'name' => 'disabled'}
36
- ]
37
- }
38
- response
39
- end
40
- end
41
- end
42
- end
43
- end