vagrant-openstack-plugin-tom 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.travis.yml +11 -0
  4. data/Authors.txt +11 -0
  5. data/CHANGELOG.md +185 -0
  6. data/Gemfile +10 -0
  7. data/LICENSE.txt +23 -0
  8. data/README.md +278 -0
  9. data/Rakefile +21 -0
  10. data/dummy.box +0 -0
  11. data/example_box/README.md +13 -0
  12. data/example_box/metadata.json +3 -0
  13. data/example_vagrant_file +24 -0
  14. data/lib/vagrant-openstack-plugin.rb +53 -0
  15. data/lib/vagrant-openstack-plugin/action.rb +268 -0
  16. data/lib/vagrant-openstack-plugin/action/connect_openstack.rb +90 -0
  17. data/lib/vagrant-openstack-plugin/action/create_network_interfaces.rb +52 -0
  18. data/lib/vagrant-openstack-plugin/action/create_orchestration_stack.rb +97 -0
  19. data/lib/vagrant-openstack-plugin/action/create_server.rb +263 -0
  20. data/lib/vagrant-openstack-plugin/action/delete_orchestration_stack.rb +78 -0
  21. data/lib/vagrant-openstack-plugin/action/delete_server.rb +84 -0
  22. data/lib/vagrant-openstack-plugin/action/hard_reboot_server.rb +27 -0
  23. data/lib/vagrant-openstack-plugin/action/is_created.rb +16 -0
  24. data/lib/vagrant-openstack-plugin/action/is_paused.rb +16 -0
  25. data/lib/vagrant-openstack-plugin/action/is_snapshoting.rb +24 -0
  26. data/lib/vagrant-openstack-plugin/action/is_suspended.rb +16 -0
  27. data/lib/vagrant-openstack-plugin/action/message_already_created.rb +16 -0
  28. data/lib/vagrant-openstack-plugin/action/message_already_paused.rb +16 -0
  29. data/lib/vagrant-openstack-plugin/action/message_already_suspended.rb +16 -0
  30. data/lib/vagrant-openstack-plugin/action/message_not_created.rb +16 -0
  31. data/lib/vagrant-openstack-plugin/action/message_server_running.rb +16 -0
  32. data/lib/vagrant-openstack-plugin/action/message_snapshot_done.rb +16 -0
  33. data/lib/vagrant-openstack-plugin/action/message_snapshot_in_progress.rb +16 -0
  34. data/lib/vagrant-openstack-plugin/action/message_will_not_destroy.rb +16 -0
  35. data/lib/vagrant-openstack-plugin/action/pause_server.rb +27 -0
  36. data/lib/vagrant-openstack-plugin/action/read_ssh_info.rb +103 -0
  37. data/lib/vagrant-openstack-plugin/action/read_state.rb +39 -0
  38. data/lib/vagrant-openstack-plugin/action/reboot_server.rb +27 -0
  39. data/lib/vagrant-openstack-plugin/action/resume_server.rb +31 -0
  40. data/lib/vagrant-openstack-plugin/action/suspend_server.rb +27 -0
  41. data/lib/vagrant-openstack-plugin/action/sync_folders.rb +104 -0
  42. data/lib/vagrant-openstack-plugin/action/take_snapshot.rb +26 -0
  43. data/lib/vagrant-openstack-plugin/action/wait_for_state.rb +39 -0
  44. data/lib/vagrant-openstack-plugin/action/wait_for_task.rb +44 -0
  45. data/lib/vagrant-openstack-plugin/action/warn_networks.rb +19 -0
  46. data/lib/vagrant-openstack-plugin/command.rb +70 -0
  47. data/lib/vagrant-openstack-plugin/command/command_snapshot.rb +43 -0
  48. data/lib/vagrant-openstack-plugin/config.rb +246 -0
  49. data/lib/vagrant-openstack-plugin/errors.rb +71 -0
  50. data/lib/vagrant-openstack-plugin/plugin.rb +45 -0
  51. data/lib/vagrant-openstack-plugin/provider.rb +50 -0
  52. data/lib/vagrant-openstack-plugin/version.rb +5 -0
  53. data/locales/en.yml +154 -0
  54. data/spec/vagrant-openstack-plugin/config_spec.rb +152 -0
  55. data/vagrant-openstack-plugin.gemspec +24 -0
  56. metadata +142 -0
@@ -0,0 +1,152 @@
1
+ require "vagrant-openstack-plugin/config"
2
+
3
+ describe VagrantPlugins::OpenStack::Config do
4
+ describe "defaults" do
5
+ let(:vagrant_public_key) { Vagrant.source_root.join("keys/vagrant.pub") }
6
+
7
+ subject do
8
+ super().tap do |o|
9
+ o.finalize!
10
+ end
11
+ end
12
+
13
+ describe '#api_key' do
14
+ subject { super().api_key }
15
+ it { is_expected.to be_nil }
16
+ end
17
+
18
+ describe '#endpoint' do
19
+ subject { super().endpoint }
20
+ it { is_expected.to be_nil }
21
+ end
22
+
23
+ describe '#flavor' do
24
+ subject { super().flavor }
25
+ it { is_expected.to eq(/m1.tiny/) }
26
+ end
27
+
28
+ describe '#image' do
29
+ subject { super().image }
30
+ it { is_expected.to eq(/cirros/) }
31
+ end
32
+
33
+ describe '#server_name' do
34
+ subject { super().server_name }
35
+ it { is_expected.to be_nil }
36
+ end
37
+
38
+ describe '#username' do
39
+ subject { super().username }
40
+ it { is_expected.to be_nil }
41
+ end
42
+
43
+ describe '#keypair_name' do
44
+ subject { super().keypair_name }
45
+ it { is_expected.to be_nil }
46
+ end
47
+
48
+ describe '#ssh_username' do
49
+ subject { super().ssh_username }
50
+ it { is_expected.to be_nil }
51
+ end
52
+
53
+ describe '#network' do
54
+ subject { super().network }
55
+ it { is_expected.to be_nil }
56
+ end
57
+
58
+ describe '#security_groups' do
59
+ subject { super().security_groups }
60
+ it { is_expected.to be_nil }
61
+ end
62
+
63
+ describe '#scheduler_hints' do
64
+ subject { super().scheduler_hints }
65
+ it { is_expected.to be_nil }
66
+ end
67
+
68
+ describe '#tenant' do
69
+ subject { super().tenant }
70
+ it { is_expected.to be_nil }
71
+ end
72
+
73
+ describe '#proxy' do
74
+ subject { super().proxy }
75
+ it { is_expected.to be_nil }
76
+ end
77
+
78
+ describe '#disks' do
79
+ subject { super().disks }
80
+ it { is_expected.to be_nil }
81
+ end
82
+
83
+ describe '#ssl_verify_peer' do
84
+ subject { super().ssl_verify_peer }
85
+ it { is_expected.to be_nil }
86
+ end
87
+ end
88
+
89
+ describe "overriding defaults" do
90
+ [:api_key,
91
+ :endpoint,
92
+ :flavor,
93
+ :image,
94
+ :server_name,
95
+ :username,
96
+ :keypair_name,
97
+ :network,
98
+ :ssh_username,
99
+ :security_groups,
100
+ :scheduler_hints,
101
+ :tenant,
102
+ :ssl_verify_peer,
103
+ :proxy].each do |attribute|
104
+ it "should not default #{attribute} if overridden" do
105
+ subject.send("#{attribute}=".to_sym, "foo")
106
+ subject.finalize!
107
+ expect(subject.send(attribute)).to eq("foo")
108
+ end
109
+ end
110
+ it "should not default disks if overridden" do
111
+ subject.send("disks=".to_sym, {"name" => "foo", "size" => 10, "description" => "bar"})
112
+ subject.finalize!
113
+ expect(subject.send("disks")).to eq({"name" => "foo", "size" => 10, "description" => "bar"})
114
+ end
115
+ end
116
+
117
+ describe "validation" do
118
+ let(:machine) { double("machine") }
119
+
120
+ subject do
121
+ super().tap do |o|
122
+ o.finalize!
123
+ end
124
+ end
125
+
126
+ context "with good values" do
127
+ it "should validate"
128
+ end
129
+
130
+ context "the API key" do
131
+ it "should error if not given"
132
+ end
133
+
134
+ context "the public key path" do
135
+ it "should have errors if the key doesn't exist"
136
+ it "should not have errors if the key exists with an absolute path"
137
+ it "should not have errors if the key exists with a relative path"
138
+ end
139
+
140
+ context "the username" do
141
+ it "should error if not given"
142
+ end
143
+
144
+ context "the disks" do
145
+ it "should not error if not given"
146
+ it "should error if non-array given"
147
+ it "should error if non-hash array element given"
148
+ it "should error if array element hash does not contain all three name, description or size keys"
149
+ it "should not error if array element hash does contain all three name, description and size keys"
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-openstack-plugin/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "vagrant-openstack-plugin-tom"
8
+ gem.version = VagrantPlugins::OpenStack::VERSION
9
+ gem.authors = ["Tom Hellier"]
10
+ gem.email = ["me@tomhellier.com"]
11
+ gem.description = "Enables Vagrant to manage machines in OpenStack Cloud, with keystone v3"
12
+ gem.summary = "Enables Vagrant to manage machines in OpenStack Cloud, with keystone v3, taken from cloudbau/vagrant-openstack-plugin"
13
+ gem.homepage = "http://www.vagrantup.com"
14
+
15
+ gem.add_runtime_dependency "fog", ">= 1.16.0"
16
+
17
+ gem.add_development_dependency "rake"
18
+ gem.add_development_dependency "rspec", "~> 3.1.0"
19
+
20
+ gem.files = `git ls-files`.split($/)
21
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
22
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
23
+ gem.require_paths = ["lib"]
24
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-openstack-plugin-tom
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.12.0
5
+ platform: ruby
6
+ authors:
7
+ - Tom Hellier
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fog
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.16.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.16.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.0
55
+ description: Enables Vagrant to manage machines in OpenStack Cloud, with keystone
56
+ v3
57
+ email:
58
+ - me@tomhellier.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - .travis.yml
65
+ - Authors.txt
66
+ - CHANGELOG.md
67
+ - Gemfile
68
+ - LICENSE.txt
69
+ - README.md
70
+ - Rakefile
71
+ - dummy.box
72
+ - example_box/README.md
73
+ - example_box/metadata.json
74
+ - example_vagrant_file
75
+ - lib/vagrant-openstack-plugin.rb
76
+ - lib/vagrant-openstack-plugin/action.rb
77
+ - lib/vagrant-openstack-plugin/action/connect_openstack.rb
78
+ - lib/vagrant-openstack-plugin/action/create_network_interfaces.rb
79
+ - lib/vagrant-openstack-plugin/action/create_orchestration_stack.rb
80
+ - lib/vagrant-openstack-plugin/action/create_server.rb
81
+ - lib/vagrant-openstack-plugin/action/delete_orchestration_stack.rb
82
+ - lib/vagrant-openstack-plugin/action/delete_server.rb
83
+ - lib/vagrant-openstack-plugin/action/hard_reboot_server.rb
84
+ - lib/vagrant-openstack-plugin/action/is_created.rb
85
+ - lib/vagrant-openstack-plugin/action/is_paused.rb
86
+ - lib/vagrant-openstack-plugin/action/is_snapshoting.rb
87
+ - lib/vagrant-openstack-plugin/action/is_suspended.rb
88
+ - lib/vagrant-openstack-plugin/action/message_already_created.rb
89
+ - lib/vagrant-openstack-plugin/action/message_already_paused.rb
90
+ - lib/vagrant-openstack-plugin/action/message_already_suspended.rb
91
+ - lib/vagrant-openstack-plugin/action/message_not_created.rb
92
+ - lib/vagrant-openstack-plugin/action/message_server_running.rb
93
+ - lib/vagrant-openstack-plugin/action/message_snapshot_done.rb
94
+ - lib/vagrant-openstack-plugin/action/message_snapshot_in_progress.rb
95
+ - lib/vagrant-openstack-plugin/action/message_will_not_destroy.rb
96
+ - lib/vagrant-openstack-plugin/action/pause_server.rb
97
+ - lib/vagrant-openstack-plugin/action/read_ssh_info.rb
98
+ - lib/vagrant-openstack-plugin/action/read_state.rb
99
+ - lib/vagrant-openstack-plugin/action/reboot_server.rb
100
+ - lib/vagrant-openstack-plugin/action/resume_server.rb
101
+ - lib/vagrant-openstack-plugin/action/suspend_server.rb
102
+ - lib/vagrant-openstack-plugin/action/sync_folders.rb
103
+ - lib/vagrant-openstack-plugin/action/take_snapshot.rb
104
+ - lib/vagrant-openstack-plugin/action/wait_for_state.rb
105
+ - lib/vagrant-openstack-plugin/action/wait_for_task.rb
106
+ - lib/vagrant-openstack-plugin/action/warn_networks.rb
107
+ - lib/vagrant-openstack-plugin/command.rb
108
+ - lib/vagrant-openstack-plugin/command/command_snapshot.rb
109
+ - lib/vagrant-openstack-plugin/config.rb
110
+ - lib/vagrant-openstack-plugin/errors.rb
111
+ - lib/vagrant-openstack-plugin/plugin.rb
112
+ - lib/vagrant-openstack-plugin/provider.rb
113
+ - lib/vagrant-openstack-plugin/version.rb
114
+ - locales/en.yml
115
+ - spec/vagrant-openstack-plugin/config_spec.rb
116
+ - vagrant-openstack-plugin.gemspec
117
+ homepage: http://www.vagrantup.com
118
+ licenses: []
119
+ metadata: {}
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 2.0.14.1
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: Enables Vagrant to manage machines in OpenStack Cloud, with keystone v3,
140
+ taken from cloudbau/vagrant-openstack-plugin
141
+ test_files:
142
+ - spec/vagrant-openstack-plugin/config_spec.rb