knife-openstack 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/lib/chef/knife/cloud/openstack_server_create_options.rb +16 -1
  3. data/lib/chef/knife/cloud/openstack_service.rb +14 -2
  4. data/lib/chef/knife/cloud/openstack_service_options.rb +17 -1
  5. data/lib/chef/knife/openstack_flavor_list.rb +16 -2
  6. data/lib/chef/knife/openstack_floating_ip_allocate.rb +16 -2
  7. data/lib/chef/knife/openstack_floating_ip_associate.rb +17 -3
  8. data/lib/chef/knife/openstack_floating_ip_disassociate.rb +17 -3
  9. data/lib/chef/knife/openstack_floating_ip_list.rb +16 -2
  10. data/lib/chef/knife/openstack_floating_ip_release.rb +14 -2
  11. data/lib/chef/knife/openstack_group_list.rb +18 -1
  12. data/lib/chef/knife/openstack_helpers.rb +17 -1
  13. data/lib/chef/knife/openstack_image_list.rb +16 -2
  14. data/lib/chef/knife/openstack_network_list.rb +16 -2
  15. data/lib/chef/knife/openstack_server_create.rb +3 -4
  16. data/lib/chef/knife/openstack_server_delete.rb +14 -2
  17. data/lib/chef/knife/openstack_server_list.rb +3 -4
  18. data/lib/chef/knife/openstack_server_show.rb +1 -2
  19. data/lib/chef/knife/openstack_volume_list.rb +4 -4
  20. data/lib/knife-openstack/version.rb +2 -2
  21. metadata +8 -207
  22. data/.github/ISSUE_TEMPLATE.md +0 -21
  23. data/.gitignore +0 -32
  24. data/.travis.yml +0 -18
  25. data/CHANGELOG.md +0 -339
  26. data/CONTRIBUTING.MD +0 -164
  27. data/Gemfile +0 -5
  28. data/README.md +0 -179
  29. data/Rakefile +0 -29
  30. data/knife-openstack.gemspec +0 -41
  31. data/spec/functional/flavor_list_func_spec.rb +0 -47
  32. data/spec/functional/floating_ip_list_func_spec.rb +0 -48
  33. data/spec/functional/group_list_func_spec.rb +0 -65
  34. data/spec/functional/image_list_func_spec.rb +0 -53
  35. data/spec/functional/network_list_func_spec.rb +0 -46
  36. data/spec/functional/server_create_func_spec.rb +0 -118
  37. data/spec/functional/server_delete_func_spec.rb +0 -84
  38. data/spec/functional/server_list_func_spec.rb +0 -98
  39. data/spec/functional/server_show_func_spec.rb +0 -46
  40. data/spec/functional/volume_list_func_spec.rb +0 -46
  41. data/spec/integration/cleanup.rb +0 -89
  42. data/spec/integration/config/environment.yml.sample +0 -13
  43. data/spec/integration/openstack_spec.rb +0 -649
  44. data/spec/spec_context.rb +0 -56
  45. data/spec/spec_helper.rb +0 -128
  46. data/spec/unit/openstack_flavor_list_spec.rb +0 -30
  47. data/spec/unit/openstack_floating_ip_allocate_spec.rb +0 -56
  48. data/spec/unit/openstack_floating_ip_associate_spec.rb +0 -40
  49. data/spec/unit/openstack_floating_ip_disassociate_spec.rb +0 -39
  50. data/spec/unit/openstack_floating_ip_list_spec.rb +0 -27
  51. data/spec/unit/openstack_floating_ip_release_spec.rb +0 -49
  52. data/spec/unit/openstack_group_list_spec.rb +0 -44
  53. data/spec/unit/openstack_image_list_spec.rb +0 -32
  54. data/spec/unit/openstack_network_list_spec.rb +0 -39
  55. data/spec/unit/openstack_server_create_spec.rb +0 -449
  56. data/spec/unit/openstack_server_delete_spec.rb +0 -43
  57. data/spec/unit/openstack_server_list_spec.rb +0 -32
  58. data/spec/unit/openstack_server_show_spec.rb +0 -42
  59. data/spec/unit/openstack_service_spec.rb +0 -128
  60. data/spec/unit/openstack_volume_list_spec.rb +0 -30
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
4
- # Author:: Mukta Aphale (<mukta.aphale@clogeny.com>)
5
- # Author:: Siddheshwar More (<siddheshwar.more@clogeny.com>)
6
- # Author:: Ameya Varade (<ameya.varade@clogeny.com>)
7
- # Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
8
- # License:: Apache License, Version 2.0
9
- #
10
- # Licensed under the Apache License, Version 2.0 (the "License");
11
- # you may not use this file except in compliance with the License.
12
- # You may obtain a copy of the License at
13
- #
14
- # http://www.apache.org/licenses/LICENSE-2.0
15
- #
16
- # Unless required by applicable law or agreed to in writing, software
17
- # distributed under the License is distributed on an "AS IS" BASIS,
18
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- # See the License for the specific language governing permissions and
20
- # limitations under the License.
21
-
22
- require "spec_helper"
23
- require "chef/knife/openstack_server_delete"
24
- require "chef/knife/cloud/openstack_service"
25
- require "support/shared_examples_for_serverdeletecommand"
26
-
27
- describe Chef::Knife::Cloud::OpenstackServerDelete do
28
- it_behaves_like Chef::Knife::Cloud::ServerDeleteCommand, Chef::Knife::Cloud::OpenstackServerDelete.new
29
-
30
- include_context "#validate!", Chef::Knife::Cloud::OpenstackServerDelete.new
31
-
32
- let (:instance) { Chef::Knife::Cloud::OpenstackServerDelete.new }
33
-
34
- before(:each) do
35
- allow(instance).to receive(:exit)
36
- end
37
-
38
- describe "#create_service_instance" do
39
- it "return OpenstackService instance" do
40
- expect(instance.create_service_instance).to be_an_instance_of(Chef::Knife::Cloud::OpenstackService)
41
- end
42
- end
43
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Author:: Mukta Aphale (<mukta.aphale@clogeny.com>)
4
- # Author:: Siddheshwar More (<siddheshwar.more@clogeny.com>)
5
- # Author:: Ameya Varade (<ameya.varade@clogeny.com>)
6
- # Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
7
- # License:: Apache License, Version 2.0
8
- #
9
- # Licensed under the Apache License, Version 2.0 (the "License");
10
- # you may not use this file except in compliance with the License.
11
- # You may obtain a copy of the License at
12
- #
13
- # http://www.apache.org/licenses/LICENSE-2.0
14
- #
15
- # Unless required by applicable law or agreed to in writing, software
16
- # distributed under the License is distributed on an "AS IS" BASIS,
17
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- # See the License for the specific language governing permissions and
19
- # limitations under the License.
20
-
21
- require "spec_helper"
22
- require "chef/knife/openstack_server_list"
23
- require "chef/knife/cloud/openstack_service"
24
- require "support/shared_examples_for_command"
25
-
26
- describe Chef::Knife::Cloud::OpenstackServerList do
27
- it_behaves_like Chef::Knife::Cloud::Command, Chef::Knife::Cloud::OpenstackServerList.new
28
-
29
- include_context "#validate!", Chef::Knife::Cloud::OpenstackServerList.new
30
-
31
- let (:instance) { Chef::Knife::Cloud::OpenstackServerList.new }
32
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Author:: Ameya Varade (<ameya.varade@clogeny.com>)
4
- # Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- require "spec_helper"
20
- require "chef/knife/openstack_server_show"
21
- require "chef/knife/cloud/openstack_service"
22
- require "support/shared_examples_for_command"
23
-
24
- describe Chef::Knife::Cloud::OpenstackServerShow do
25
- it_behaves_like Chef::Knife::Cloud::Command, Chef::Knife::Cloud::OpenstackServerShow.new
26
-
27
- include_context "#validate!", Chef::Knife::Cloud::OpenstackServerShow.new
28
-
29
- let (:instance) { Chef::Knife::Cloud::OpenstackServerShow.new }
30
-
31
- context "#validate_params!" do
32
- before(:each) do
33
- Chef::Config[:knife][:instance_id] = "instance_id"
34
- end
35
-
36
- it "raise error on instance_id missing" do
37
- Chef::Config[:knife].delete(:instance_id)
38
- expect(instance.ui).to receive(:error).with("You must provide a valid Instance Id")
39
- expect { instance.validate_params! }.to raise_error(Chef::Knife::Cloud::CloudExceptions::ValidationError)
40
- end
41
- end
42
- end
@@ -1,128 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Author:: Mukta Aphale (<mukta.aphale@clogeny.com>)
4
- # Author:: Siddheshwar More (<siddheshwar.more@clogeny.com>)
5
- # Author:: Ameya Varade (<ameya.varade@clogeny.com>)
6
- # Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
7
- # License:: Apache License, Version 2.0
8
- #
9
- # Licensed under the Apache License, Version 2.0 (the "License");
10
- # you may not use this file except in compliance with the License.
11
- # You may obtain a copy of the License at
12
- #
13
- # http://www.apache.org/licenses/LICENSE-2.0
14
- #
15
- # Unless required by applicable law or agreed to in writing, software
16
- # distributed under the License is distributed on an "AS IS" BASIS,
17
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- # See the License for the specific language governing permissions and
19
- # limitations under the License.
20
-
21
- require "spec_helper"
22
- require "chef/knife/cloud/openstack_service"
23
-
24
- describe Chef::Knife::Cloud::OpenstackService do
25
- describe "#add_api_endpoint" do
26
- before(:each) do
27
- @api_endpoint = "https://test_openstack_api_endpoint"
28
- Chef::Config[:knife][:api_endpoint] = @api_endpoint
29
- @instance = Chef::Knife::Cloud::OpenstackService.new
30
- end
31
-
32
- after(:each) do
33
- Chef::Config[:knife].delete(:api_endpoint)
34
- end
35
-
36
- it "sets the api_endpoint in auth params" do
37
- expect(@instance.instance_variable_get(:@auth_params)[:openstack_auth_url]).to be_nil
38
- @instance.add_api_endpoint
39
- expect(@instance.instance_variable_get(:@auth_params)[:openstack_auth_url]).to be == @api_endpoint
40
- end
41
-
42
- it "does not set the endpoint when --api-endpoint option is missing" do
43
- Chef::Config[:knife][:api_endpoint] = nil
44
- expect(@instance.instance_variable_get(:@auth_params)[:openstack_auth_url]).to be_nil
45
- @instance.add_api_endpoint
46
- expect(@instance.instance_variable_get(:@auth_params)[:openstack_auth_url]).to_not be == @api_endpoint
47
- expect(@instance.instance_variable_get(:@auth_params)[:openstack_auth_url]).to be_nil
48
- end
49
-
50
- it "doesn't set an OpenStack endpoint type by default" do
51
- expect(Chef::Config[:knife][:openstack_endpoint_type]).to be_nil
52
- end
53
- end
54
-
55
- describe "#get_server" do
56
- before(:each) do
57
- @instance = Chef::Knife::Cloud::OpenstackService.new
58
- allow(@instance).to receive_message_chain(:connection, :servers, :get)
59
- end
60
-
61
- context "when instance_id given" do
62
- it "return server" do
63
- server_id = "123f456-123-453e-9c0c-12345a6789"
64
- expect(@instance.connection.servers).to receive(:get).and_return(server_id)
65
- expect(@instance.connection.servers).to_not receive(:all)
66
- expect(@instance.get_server(server_id)).to be == server_id
67
- end
68
- end
69
-
70
- context "when instance_name given" do
71
- before(:each) do
72
- expect(@instance.connection.servers).to receive(:get).and_return(nil)
73
- end
74
-
75
- let (:server_name) { "testname" }
76
-
77
- it "return server" do
78
- expect(@instance.connection.servers).to receive(:all).with(name: server_name).and_return([server_name])
79
- expect(@instance.get_server(server_name)).to be == server_name
80
- end
81
-
82
- it "raise error if multiple server matches found for given instance name" do
83
- error_message = "Multiple server matches found for '#{server_name}', use an instance_id to be more specific."
84
- expect(@instance.connection.servers).to receive(:all).with(name: server_name).and_return([server_name, server_name])
85
- allow(@instance).to receive_message_chain(:ui, :fatal)
86
- expect { @instance.get_server(server_name) }.to raise_error(Chef::Knife::Cloud::CloudExceptions::ValidationError, error_message)
87
- end
88
- end
89
- end
90
-
91
- describe "#get_auth_params" do
92
- let(:auth_params) do
93
- Chef::Knife::Cloud::OpenstackService.new.instance_variable_get(:@auth_params)
94
- end
95
-
96
- it "sets ssl_verify_peer to false when openstack_insecure is true" do
97
- Chef::Config[:knife][:openstack_insecure] = true
98
- expect(auth_params[:connection_options][:ssl_verify_peer]).to be false
99
- end
100
-
101
- it "only copies openstack options from Fog" do
102
- params = auth_params.keys - [:provider, :connection_options]
103
- expect(params.all? { |p| p.to_s.start_with?("openstack") }).to be true
104
- end
105
-
106
- context "when openstack_password is set" do
107
- before(:each) do
108
- @expected = "password"
109
- Chef::Config[:knife][:openstack_password] = @expected
110
- end
111
-
112
- it "sets openstack_api_key from openstack_password" do
113
- expect(auth_params[:openstack_api_key]).to be == @expected
114
- end
115
-
116
- it "prefers openstack_password over openstack_api_key" do
117
- Chef::Config[:knife][:openstack_api_key] = "unexpected"
118
- expect(auth_params[:openstack_api_key]).to be == @expected
119
- end
120
- end
121
-
122
- it "uses openstack_api_key if openstack_password is not set" do
123
- @expected = "password"
124
- Chef::Config[:knife][:openstack_api_key] = @expected
125
- expect(auth_params[:openstack_api_key]).to be == @expected
126
- end
127
- end
128
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Author:: Mukta Aphale (<mukta.aphale@clogeny.com>)
4
- # Author:: Siddheshwar More (<siddheshwar.more@clogeny.com>)
5
- # Author:: Ameya Varade (<ameya.varade@clogeny.com>)
6
- # Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
7
- # License:: Apache License, Version 2.0
8
- #
9
- # Licensed under the Apache License, Version 2.0 (the "License");
10
- # you may not use this file except in compliance with the License.
11
- # You may obtain a copy of the License at
12
- #
13
- # http://www.apache.org/licenses/LICENSE-2.0
14
- #
15
- # Unless required by applicable law or agreed to in writing, software
16
- # distributed under the License is distributed on an "AS IS" BASIS,
17
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- # See the License for the specific language governing permissions and
19
- # limitations under the License.
20
-
21
- require "spec_helper"
22
- require "chef/knife/openstack_volume_list"
23
- require "chef/knife/cloud/openstack_service"
24
- require "support/shared_examples_for_command"
25
-
26
- describe Chef::Knife::Cloud::OpenstackVolumeList do
27
- it_behaves_like Chef::Knife::Cloud::Command, Chef::Knife::Cloud::OpenstackVolumeList.new
28
-
29
- include_context "#validate!", Chef::Knife::Cloud::OpenstackVolumeList.new
30
- end