dopv 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rspec +2 -0
  4. data/ChangeLog.md +456 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +260 -0
  7. data/Guardfile +22 -0
  8. data/LICENSE.txt +177 -0
  9. data/README.md +214 -0
  10. data/Rakefile +6 -0
  11. data/bin/dopv +4 -0
  12. data/dopv.gemspec +52 -0
  13. data/lib/dopv.rb +166 -0
  14. data/lib/dopv/cli.rb +54 -0
  15. data/lib/dopv/cli/command_add.rb +37 -0
  16. data/lib/dopv/cli/command_export.rb +26 -0
  17. data/lib/dopv/cli/command_import.rb +32 -0
  18. data/lib/dopv/cli/command_list.rb +18 -0
  19. data/lib/dopv/cli/command_remove.rb +29 -0
  20. data/lib/dopv/cli/command_run.rb +38 -0
  21. data/lib/dopv/cli/command_update.rb +35 -0
  22. data/lib/dopv/cli/command_validate.rb +30 -0
  23. data/lib/dopv/infrastructure.rb +40 -0
  24. data/lib/dopv/infrastructure/providers/baremetal.rb +12 -0
  25. data/lib/dopv/infrastructure/providers/base.rb +422 -0
  26. data/lib/dopv/infrastructure/providers/openstack.rb +308 -0
  27. data/lib/dopv/infrastructure/providers/ovirt.rb +228 -0
  28. data/lib/dopv/infrastructure/providers/vsphere.rb +322 -0
  29. data/lib/dopv/log.rb +14 -0
  30. data/lib/dopv/persistent_disk.rb +128 -0
  31. data/lib/dopv/plan.rb +17 -0
  32. data/lib/dopv/state_store.rb +87 -0
  33. data/lib/dopv/version.rb +3 -0
  34. data/spec/data/hooks/test_hook_script_1 +9 -0
  35. data/spec/data/hooks/test_hook_script_2 +10 -0
  36. data/spec/data/plans/test-plan-1.yaml +140 -0
  37. data/spec/spec_helper.rb +112 -0
  38. data/spec/unit/dopv/dopv_spec.rb +7 -0
  39. data/spec/unit/dopv/persistent_disk_spec.rb +38 -0
  40. data/spec/unit/dopv/plan_spec.rb +34 -0
  41. data/spec/unit/dopv/version_spec.rb +17 -0
  42. metadata +401 -0
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Use local path as source for dop_common for testing
4
+ #gem 'dop_common', :path => '../dop_common'
5
+
6
+ gemspec
@@ -0,0 +1,260 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dopv (0.11.0)
5
+ dop_common (~> 0.13, >= 0.13.0)
6
+ fog (~> 1.36.0)
7
+ fog-google (< 0.1.1)
8
+ fog-profitbricks (~> 0.0.5)
9
+ gli (~> 2.13.1)
10
+ json (~> 1.8)
11
+ logger-colors (~> 1)
12
+ net-ssh (< 3.0)
13
+ parallel (~> 1)
14
+ rbovirt (~> 0.1, >= 0.1.3)
15
+ rbvmomi (~> 1.8.2)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ CFPropertyList (2.3.5)
21
+ builder (3.2.3)
22
+ byebug (9.0.6)
23
+ coderay (1.1.1)
24
+ diff-lcs (1.3)
25
+ docile (1.1.5)
26
+ domain_name (0.5.20170223)
27
+ unf (>= 0.0.5, < 1.0.0)
28
+ dop_common (0.13.0)
29
+ hashdiff (~> 0.3, >= 0.3.1)
30
+ hiera (~> 3)
31
+ lockfile (~> 2)
32
+ rb-inotify (~> 0.9)
33
+ excon (0.55.0)
34
+ ffi (1.9.18)
35
+ fission (0.5.0)
36
+ CFPropertyList (~> 2.2)
37
+ fog (1.36.0)
38
+ fog-aliyun (>= 0.1.0)
39
+ fog-atmos
40
+ fog-aws (>= 0.6.0)
41
+ fog-brightbox (~> 0.4)
42
+ fog-core (~> 1.32)
43
+ fog-dynect (~> 0.0.2)
44
+ fog-ecloud (~> 0.1)
45
+ fog-google (<= 0.1.0)
46
+ fog-json
47
+ fog-local
48
+ fog-powerdns (>= 0.1.1)
49
+ fog-profitbricks
50
+ fog-radosgw (>= 0.0.2)
51
+ fog-riakcs
52
+ fog-sakuracloud (>= 0.0.4)
53
+ fog-serverlove
54
+ fog-softlayer
55
+ fog-storm_on_demand
56
+ fog-terremark
57
+ fog-vmfusion
58
+ fog-voxel
59
+ fog-xenserver
60
+ fog-xml (~> 0.1.1)
61
+ ipaddress (~> 0.5)
62
+ nokogiri (~> 1.5, >= 1.5.11)
63
+ fog-aliyun (0.1.0)
64
+ fog-core (~> 1.27)
65
+ fog-json (~> 1.0)
66
+ ipaddress (~> 0.8)
67
+ xml-simple (~> 1.1)
68
+ fog-atmos (0.1.0)
69
+ fog-core
70
+ fog-xml
71
+ fog-aws (1.2.1)
72
+ fog-core (~> 1.38)
73
+ fog-json (~> 1.0)
74
+ fog-xml (~> 0.1)
75
+ ipaddress (~> 0.8)
76
+ fog-brightbox (0.11.0)
77
+ fog-core (~> 1.22)
78
+ fog-json
79
+ inflecto (~> 0.0.2)
80
+ fog-core (1.43.0)
81
+ builder
82
+ excon (~> 0.49)
83
+ formatador (~> 0.2)
84
+ fog-dynect (0.0.3)
85
+ fog-core
86
+ fog-json
87
+ fog-xml
88
+ fog-ecloud (0.3.0)
89
+ fog-core
90
+ fog-xml
91
+ fog-google (0.1.0)
92
+ fog-core
93
+ fog-json
94
+ fog-xml
95
+ fog-json (1.0.2)
96
+ fog-core (~> 1.0)
97
+ multi_json (~> 1.10)
98
+ fog-local (0.3.1)
99
+ fog-core (~> 1.27)
100
+ fog-powerdns (0.1.1)
101
+ fog-core (~> 1.27)
102
+ fog-json (~> 1.0)
103
+ fog-xml (~> 0.1)
104
+ fog-profitbricks (0.0.5)
105
+ fog-core
106
+ fog-xml
107
+ nokogiri
108
+ fog-radosgw (0.0.5)
109
+ fog-core (>= 1.21.0)
110
+ fog-json
111
+ fog-xml (>= 0.0.1)
112
+ fog-riakcs (0.1.0)
113
+ fog-core
114
+ fog-json
115
+ fog-xml
116
+ fog-sakuracloud (1.7.5)
117
+ fog-core
118
+ fog-json
119
+ fog-serverlove (0.1.2)
120
+ fog-core
121
+ fog-json
122
+ fog-softlayer (1.1.4)
123
+ fog-core
124
+ fog-json
125
+ fog-storm_on_demand (0.1.1)
126
+ fog-core
127
+ fog-json
128
+ fog-terremark (0.1.0)
129
+ fog-core
130
+ fog-xml
131
+ fog-vmfusion (0.1.0)
132
+ fission
133
+ fog-core
134
+ fog-voxel (0.1.0)
135
+ fog-core
136
+ fog-xml
137
+ fog-xenserver (0.3.0)
138
+ fog-core
139
+ fog-xml
140
+ fog-xml (0.1.2)
141
+ fog-core
142
+ nokogiri (~> 1.5, >= 1.5.11)
143
+ formatador (0.2.5)
144
+ gli (2.13.4)
145
+ guard (2.14.1)
146
+ formatador (>= 0.2.4)
147
+ listen (>= 2.7, < 4.0)
148
+ lumberjack (~> 1.0)
149
+ nenv (~> 0.1)
150
+ notiffany (~> 0.0)
151
+ pry (>= 0.9.12)
152
+ shellany (~> 0.0)
153
+ thor (>= 0.18.1)
154
+ guard-compat (1.2.1)
155
+ guard-ctags-bundler (1.4.0)
156
+ guard (>= 2.0)
157
+ guard-compat (>= 0.1.0)
158
+ hashdiff (0.3.2)
159
+ hiera (3.3.1)
160
+ http-cookie (1.0.3)
161
+ domain_name (~> 0.5)
162
+ inflecto (0.0.2)
163
+ ipaddress (0.8.3)
164
+ json (1.8.6)
165
+ listen (3.0.8)
166
+ rb-fsevent (~> 0.9, >= 0.9.4)
167
+ rb-inotify (~> 0.9, >= 0.9.7)
168
+ lockfile (2.1.3)
169
+ logger-colors (1.0.0)
170
+ lumberjack (1.0.11)
171
+ method_source (0.8.2)
172
+ mime-types (3.1)
173
+ mime-types-data (~> 3.2015)
174
+ mime-types-data (3.2016.0521)
175
+ mini_portile2 (2.1.0)
176
+ mixlib-shellout (2.2.7)
177
+ multi_json (1.12.1)
178
+ nenv (0.3.0)
179
+ net-ssh (2.9.4)
180
+ netrc (0.11.0)
181
+ nokogiri (1.7.1)
182
+ mini_portile2 (~> 2.1.0)
183
+ notiffany (0.1.1)
184
+ nenv (~> 0.1)
185
+ shellany (~> 0.0)
186
+ parallel (1.11.1)
187
+ pry (0.10.4)
188
+ coderay (~> 1.1.0)
189
+ method_source (~> 0.8.1)
190
+ slop (~> 3.4)
191
+ pry-byebug (3.4.2)
192
+ byebug (~> 9.0)
193
+ pry (~> 0.10)
194
+ rake (12.0.0)
195
+ rb-fsevent (0.9.8)
196
+ rb-inotify (0.9.8)
197
+ ffi (>= 0.5.0)
198
+ rbovirt (0.1.3)
199
+ nokogiri
200
+ rest-client (> 1.7.0)
201
+ rbvmomi (1.8.2)
202
+ builder
203
+ nokogiri (>= 1.4.1)
204
+ trollop
205
+ rest-client (2.0.1)
206
+ http-cookie (>= 1.0.2, < 2.0)
207
+ mime-types (>= 1.16, < 4.0)
208
+ netrc (~> 0.8)
209
+ rspec (3.5.0)
210
+ rspec-core (~> 3.5.0)
211
+ rspec-expectations (~> 3.5.0)
212
+ rspec-mocks (~> 3.5.0)
213
+ rspec-command (1.0.1)
214
+ mixlib-shellout (~> 2.0)
215
+ rspec (~> 3.2)
216
+ rspec-its (~> 1.2)
217
+ rspec-core (3.5.4)
218
+ rspec-support (~> 3.5.0)
219
+ rspec-expectations (3.5.0)
220
+ diff-lcs (>= 1.2.0, < 2.0)
221
+ rspec-support (~> 3.5.0)
222
+ rspec-its (1.2.0)
223
+ rspec-core (>= 3.0.0)
224
+ rspec-expectations (>= 3.0.0)
225
+ rspec-mocks (3.5.0)
226
+ diff-lcs (>= 1.2.0, < 2.0)
227
+ rspec-support (~> 3.5.0)
228
+ rspec-support (3.5.0)
229
+ shellany (0.0.1)
230
+ simplecov (0.14.1)
231
+ docile (~> 1.1.0)
232
+ json (>= 1.8, < 3)
233
+ simplecov-html (~> 0.10.0)
234
+ simplecov-html (0.10.0)
235
+ slop (3.6.0)
236
+ thor (0.19.4)
237
+ trollop (2.1.2)
238
+ unf (0.1.4)
239
+ unf_ext
240
+ unf_ext (0.0.7.2)
241
+ xml-simple (1.1.5)
242
+
243
+ PLATFORMS
244
+ ruby
245
+
246
+ DEPENDENCIES
247
+ bundler (~> 1.3)
248
+ dopv!
249
+ guard-ctags-bundler
250
+ listen (~> 3.0.8)
251
+ pry
252
+ pry-byebug
253
+ rake
254
+ rspec
255
+ rspec-command
256
+ rspec-mocks
257
+ simplecov
258
+
259
+ BUNDLED WITH
260
+ 1.14.3
@@ -0,0 +1,22 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard 'ctags-bundler', :src_path => ["bin", "lib", "spec/support", "../dop_common/lib"] do
19
+ watch(/^(bin|lib|spec\/support)\/.*\.rb$/)
20
+ watch(/^\.\.\/dop_common\/lib\/.*\.rb$/)
21
+ watch('Gemfile.lock')
22
+ end
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS