knife-oraclecloud 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +28 -0
- data/.travis.yml +2 -5
- data/CHANGELOG.md +36 -7
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/Rakefile +9 -3
- data/knife-oraclecloud.gemspec +6 -3
- data/lib/chef/knife/cloud/oraclecloud_service.rb +9 -5
- data/lib/chef/knife/cloud/oraclecloud_service_helpers.rb +3 -1
- data/lib/chef/knife/cloud/oraclecloud_service_options.rb +22 -21
- data/lib/chef/knife/oraclecloud_image_list.rb +2 -0
- data/lib/chef/knife/oraclecloud_orchestration_delete.rb +2 -0
- data/lib/chef/knife/oraclecloud_orchestration_list.rb +2 -0
- data/lib/chef/knife/oraclecloud_orchestration_show.rb +2 -0
- data/lib/chef/knife/oraclecloud_server_create.rb +3 -1
- data/lib/chef/knife/oraclecloud_server_delete.rb +2 -0
- data/lib/chef/knife/oraclecloud_server_list.rb +2 -0
- data/lib/chef/knife/oraclecloud_server_show.rb +2 -0
- data/lib/chef/knife/oraclecloud_shape_list.rb +2 -0
- data/lib/knife-oraclecloud/version.rb +3 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/cloud/oraclecloud_service_helpers_spec.rb +2 -0
- data/spec/unit/cloud/oraclecloud_service_spec.rb +8 -6
- data/spec/unit/oraclecloud_image_list_spec.rb +2 -0
- data/spec/unit/oraclecloud_orchestration_delete_spec.rb +4 -2
- data/spec/unit/oraclecloud_orchestration_list_spec.rb +2 -0
- data/spec/unit/oraclecloud_orchestration_show_spec.rb +5 -3
- data/spec/unit/oraclecloud_server_create_spec.rb +11 -9
- data/spec/unit/oraclecloud_server_delete_spec.rb +4 -2
- data/spec/unit/oraclecloud_server_list_spec.rb +2 -0
- data/spec/unit/oraclecloud_server_show_spec.rb +4 -2
- data/spec/unit/oraclecloud_shape_list_spec.rb +2 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 666bd32a9f28ba1daad7ecbbd071d499a6b20381ed6213e44858b3ee5b17908f
|
4
|
+
data.tar.gz: 9e985b970efc5ca2ea52c97dfb47336aadf200c11865a042fff18c048998ed77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e8165a0fd7e89521db91a56090e082514e1b77e04f26fcca2560327d6878dcc2fb9ce2e8b77a55d3d55be5c667c8b99a094239ab95e1a11c566c083f70fe9b9
|
7
|
+
data.tar.gz: eb13434d1c161a791e6cd2a64c539765764128166e3ed9c27a2deffee1555a0604d9665550ff55e2ca23332e2c90885408c52af50e1be1270fd0c1b1d317bee7
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-05-01 10:24:59 -0500 using RuboCop version 0.54.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 14
|
10
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
11
|
+
Metrics/BlockLength:
|
12
|
+
Max: 285
|
13
|
+
|
14
|
+
# Offense count: 1
|
15
|
+
# Configuration parameters: CountComments.
|
16
|
+
Metrics/ClassLength:
|
17
|
+
Max: 145
|
18
|
+
|
19
|
+
# Offense count: 1
|
20
|
+
Naming/MemoizedInstanceVariableName:
|
21
|
+
Exclude:
|
22
|
+
- 'lib/chef/knife/cloud/oraclecloud_service.rb'
|
23
|
+
|
24
|
+
# Offense count: 1
|
25
|
+
# Configuration parameters: MinBodyLength.
|
26
|
+
Style/GuardClause:
|
27
|
+
Exclude:
|
28
|
+
- 'lib/chef/knife/cloud/oraclecloud_service_helpers.rb'
|
data/.travis.yml
CHANGED
@@ -1,19 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
sudo: false
|
4
|
-
|
5
4
|
rvm:
|
6
5
|
- 2.0.0
|
7
6
|
- 2.1
|
8
7
|
- 2.2
|
9
|
-
|
10
8
|
branches:
|
11
9
|
only:
|
12
|
-
|
13
|
-
|
10
|
+
- master
|
14
11
|
notifications:
|
15
12
|
slack:
|
16
13
|
on_success: change
|
17
14
|
on_failure: always
|
18
15
|
rooms:
|
19
|
-
secure:
|
16
|
+
secure: BvdbFPImsNTFSbNzg7h1S1zjfKO7rhurKx28pP474ppk1uV1V096F8Lu5IaGEykAuCBkqOfMOBcAcOU6+qTxv1Pv2tCftKf92AoXe7R+ZnKstT7MZm4MorvLqz5YsylcoEZG96JhEG7S0ZdKdEYwYB1CXU+iL6hG8aued20KdrvX+uRS2Otk1S4KMG+sgMlTwnUKsQEhJeiWGarGNA6C4K2QbEf91FpHjTKORgeUlq5NBvNOLdp1+R6cYbvlmKom7rvdkY91J//H4k+YnGUfuGLdB/L+pQLlWBF9yrxn8a4C7A3tpWcHgZWXD+jhPSstiWorWIyeqj/OUWU2W0CW8FHsNwfJvYJcnC+1IcwanHgjtp7DjojvNNnKGkkXIa0rDoHTRlCREgmuiDhU+kgcrS8Lc8vRasKwDJy2b24St5HcrkLJl/m+atTtzZqtK3wGssDqM6AEFWn8RYNNpeh1lu/fM6MIVfpwTVmEq7R6gnyv6HC9Qd0U7FjE5s/+GKvnSVJbmc9YQxFbH66xCkp5gHeHb4/dYeAbak4M+/qT4YmrET0eKJjn3WftMB/qu93ck+cASl/jxj27mMowB6njjDuVsx6sn3bDGc3fvHBfsBLqk6IEwFRm2i0Devxp8hgn+jruN0cAWAvo/OtOwDsHbts01fOX82eVd2VFVDXa+/I=
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,40 @@
|
|
1
|
-
#
|
1
|
+
# Change Log
|
2
2
|
|
3
|
-
##
|
4
|
-
* [pr#3](https://github.com/chef-partners/knife-oraclecloud/pull/3) Adding support for private cloud deployments
|
3
|
+
## [v2.0.0](https://github.com/chef-partners/knife-oraclecloud/tree/v2.0.0)
|
5
4
|
|
6
|
-
|
7
|
-
* [pr#2](https://github.com/chef-partners/knife-oraclecloud/pull/2) Updated identity domain method calls to match recent changes in the underlying Oracle Cloud client library
|
5
|
+
[Full Changelog](https://github.com/chef-partners/knife-oraclecloud/compare/v1.2.0...v2.0.0)
|
8
6
|
|
9
|
-
|
10
|
-
* Initial release
|
7
|
+
**Closed issues:**
|
11
8
|
|
9
|
+
- Orchestration list command errors out with hard-coded email [\#8](https://github.com/chef-partners/knife-oraclecloud/issues/8)
|
10
|
+
- Unable to associate public key to a provisioned Compute instance [\#6](https://github.com/chef-partners/knife-oraclecloud/issues/6)
|
11
|
+
- knife.rb configuration [\#5](https://github.com/chef-partners/knife-oraclecloud/issues/5)
|
12
|
+
|
13
|
+
**Merged pull requests:**
|
14
|
+
|
15
|
+
- Chef 14 support [\#17](https://github.com/chef-partners/knife-oraclecloud/pull/17) ([jjasghar](https://github.com/jjasghar))
|
16
|
+
- convert to using chefstyle [\#7](https://github.com/chef-partners/knife-oraclecloud/pull/7) ([adamleff](https://github.com/adamleff))
|
17
|
+
- fixing travis notifications [\#4](https://github.com/chef-partners/knife-oraclecloud/pull/4) ([adamleff](https://github.com/adamleff))
|
18
|
+
|
19
|
+
## [v1.2.0](https://github.com/chef-partners/knife-oraclecloud/tree/v1.2.0) (2015-12-22)
|
20
|
+
[Full Changelog](https://github.com/chef-partners/knife-oraclecloud/compare/v1.1.0...v1.2.0)
|
21
|
+
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- Add support for private cloud deployments [\#3](https://github.com/chef-partners/knife-oraclecloud/pull/3) ([adamleff](https://github.com/adamleff))
|
25
|
+
|
26
|
+
## [v1.1.0](https://github.com/chef-partners/knife-oraclecloud/tree/v1.1.0) (2015-12-07)
|
27
|
+
[Full Changelog](https://github.com/chef-partners/knife-oraclecloud/compare/v1.0.0...v1.1.0)
|
28
|
+
|
29
|
+
**Merged pull requests:**
|
30
|
+
|
31
|
+
- method name updates due to changes in latest oraclecloud client [\#2](https://github.com/chef-partners/knife-oraclecloud/pull/2) ([adamleff](https://github.com/adamleff))
|
32
|
+
|
33
|
+
## [v1.0.0](https://github.com/chef-partners/knife-oraclecloud/tree/v1.0.0) (2015-10-15)
|
34
|
+
**Merged pull requests:**
|
35
|
+
|
36
|
+
- Initial release [\#1](https://github.com/chef-partners/knife-oraclecloud/pull/1) ([adamleff](https://github.com/adamleff))
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# knife-oraclecloud
|
2
2
|
|
3
3
|
This is a Knife plugin that will allow you to interact with
|
4
|
-
Oracle Cloud.
|
4
|
+
Oracle Cloud Infrastructure Classic. Please use [knife-oci](https://github.com/oracle/knife-oci) for the newer Oracle Cloud Infrastructure (aka 'OCI').
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
data/Rakefile
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/gem_tasks'
|
2
4
|
require 'rspec/core/rake_task'
|
3
|
-
require 'rubocop/rake_task'
|
4
5
|
|
5
6
|
RSpec::Core::RakeTask.new(:spec)
|
6
|
-
RuboCop::RakeTask.new(:style)
|
7
7
|
|
8
|
-
|
8
|
+
require 'chefstyle'
|
9
|
+
require 'rubocop/rake_task'
|
10
|
+
RuboCop::RakeTask.new(:style) do |task|
|
11
|
+
task.options << '--display-cop-names'
|
12
|
+
end
|
13
|
+
|
14
|
+
task default: %i[spec style]
|
data/knife-oraclecloud.gemspec
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
lib = File.expand_path('lib', __dir__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
6
|
|
5
7
|
require 'knife-oraclecloud/version'
|
@@ -19,11 +21,12 @@ Gem::Specification.new do |spec|
|
|
19
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
22
|
spec.require_paths = ['lib']
|
21
23
|
|
22
|
-
spec.add_dependency 'chef', '
|
24
|
+
spec.add_dependency 'chef', '>= 12.0'
|
23
25
|
spec.add_dependency 'knife-cloud', '~> 1.2.0'
|
24
26
|
spec.add_dependency 'oraclecloud', '~> 1.1'
|
25
27
|
|
26
28
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
29
|
+
spec.add_development_dependency 'chefstyle'
|
27
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
31
|
spec.add_development_dependency 'rubocop', '~> 0.35'
|
29
32
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -25,7 +27,7 @@ require 'oraclecloud'
|
|
25
27
|
class Chef
|
26
28
|
class Knife
|
27
29
|
class Cloud
|
28
|
-
class OraclecloudService < Service
|
30
|
+
class OraclecloudService < Service
|
29
31
|
include OraclecloudServiceHelpers
|
30
32
|
|
31
33
|
attr_reader :wait_time, :refresh_time
|
@@ -68,9 +70,11 @@ class Chef
|
|
68
70
|
ui.msg('')
|
69
71
|
|
70
72
|
servers = orchestration.instances
|
71
|
-
|
72
|
-
'
|
73
|
-
|
73
|
+
if servers.length > 1
|
74
|
+
raise CloudExceptions::ServerCreateError, 'The orchestration created more than one server, ' \
|
75
|
+
'but we were only expecting 1'
|
76
|
+
end
|
77
|
+
raise CloudExceptions::ServerCreateError, 'The orchestration did not create any servers' if servers.empty?
|
74
78
|
|
75
79
|
servers.first
|
76
80
|
end
|
@@ -97,7 +101,7 @@ class Chef
|
|
97
101
|
connection.orchestrations.create(
|
98
102
|
name: options[:name],
|
99
103
|
description: "#{options[:name]} by #{connection.username} via Knife",
|
100
|
-
instances: [
|
104
|
+
instances: [instance_request(options)]
|
101
105
|
)
|
102
106
|
end
|
103
107
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -38,7 +40,7 @@ class Chef
|
|
38
40
|
def check_for_missing_config_values!(*keys)
|
39
41
|
missing = keys.select { |x| locate_config_value(x).nil? }
|
40
42
|
|
41
|
-
unless missing.empty?
|
43
|
+
unless missing.empty?
|
42
44
|
ui.error("The following required parameters are missing: #{missing.join(', ')}")
|
43
45
|
exit(1)
|
44
46
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -19,43 +21,42 @@
|
|
19
21
|
class Chef
|
20
22
|
class Knife
|
21
23
|
class Cloud
|
22
|
-
# rubocop:disable Style/AlignParameters
|
23
24
|
module OraclecloudServiceOptions
|
24
25
|
def self.included(includer)
|
25
26
|
includer.class_eval do
|
26
27
|
option :oraclecloud_api_url,
|
27
|
-
|
28
|
-
|
28
|
+
long: '--oraclecloud-api-url API_URL',
|
29
|
+
description: 'URL for the oraclecloud API server'
|
29
30
|
|
30
31
|
option :oraclecloud_username,
|
31
|
-
|
32
|
-
|
32
|
+
long: '--oraclecloud-username USERNAME',
|
33
|
+
description: 'Username to use with the oraclecloud API'
|
33
34
|
|
34
35
|
option :oraclecloud_password,
|
35
|
-
|
36
|
-
|
36
|
+
long: '--oraclecloud-password PASSWORD',
|
37
|
+
description: 'Password to use with the oraclecloud API'
|
37
38
|
|
38
39
|
option :oraclecloud_domain,
|
39
|
-
|
40
|
-
|
40
|
+
long: '--oraclecloud-domain IDENTITYDOMAIN',
|
41
|
+
description: 'Identity domain to use with the oraclecloud API'
|
41
42
|
|
42
43
|
option :oraclecloud_disable_ssl_verify,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
long: '--oraclecloud-disable-ssl-verify',
|
45
|
+
description: 'Skip any SSL verification for the oraclecloud API',
|
46
|
+
boolean: true,
|
47
|
+
default: false
|
47
48
|
|
48
49
|
option :oraclecloud_private_cloud,
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
long: '--oraclecloud-private-cloud',
|
51
|
+
description: 'Indicate the --oraclecloud-api-url is a private cloud endpoint',
|
52
|
+
boolean: true,
|
53
|
+
default: false
|
53
54
|
|
54
55
|
option :request_refresh_rate,
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
long: '--request-refresh-rate SECS',
|
57
|
+
description: 'Number of seconds to sleep between each check of the request status, defaults to 2',
|
58
|
+
default: 2,
|
59
|
+
proc: proc { |secs| secs.to_i }
|
59
60
|
end
|
60
61
|
end
|
61
62
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -63,7 +65,7 @@ class Chef
|
|
63
65
|
def public_ip
|
64
66
|
return nil unless locate_config_value(:public_ip)
|
65
67
|
|
66
|
-
|
68
|
+
locate_config_value(:public_ip) == 'pool' ? :pool : "ipreservation:#{locate_config_value(:public_ip)}"
|
67
69
|
end
|
68
70
|
|
69
71
|
def sshkeys
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -60,7 +62,7 @@ describe Chef::Knife::Cloud::OraclecloudService do
|
|
60
62
|
allow(service).to receive(:create_orchestration).and_return(orchestration)
|
61
63
|
allow(orchestration).to receive(:start)
|
62
64
|
allow(orchestration).to receive(:name_with_container)
|
63
|
-
allow(orchestration).to receive(:instances).and_return([
|
65
|
+
allow(orchestration).to receive(:instances).and_return([instance])
|
64
66
|
allow(service).to receive(:wait_for_status)
|
65
67
|
allow(service).to receive(:orchestration_summary)
|
66
68
|
end
|
@@ -90,7 +92,7 @@ describe Chef::Knife::Cloud::OraclecloudService do
|
|
90
92
|
end
|
91
93
|
|
92
94
|
it 'gathers the instances from the orchestration' do
|
93
|
-
expect(orchestration).to receive(:instances).and_return([
|
95
|
+
expect(orchestration).to receive(:instances).and_return([instance])
|
94
96
|
|
95
97
|
service.create_server(options)
|
96
98
|
end
|
@@ -101,7 +103,7 @@ describe Chef::Knife::Cloud::OraclecloudService do
|
|
101
103
|
|
102
104
|
context 'when more than one instance is returned' do
|
103
105
|
it 'raises an exception' do
|
104
|
-
allow(orchestration).to receive(:instances).and_return(%w
|
106
|
+
allow(orchestration).to receive(:instances).and_return(%w[instance1 instance2])
|
105
107
|
|
106
108
|
expect { service.create_server(options) }.to raise_error(Chef::Knife::Cloud::CloudExceptions::ServerCreateError)
|
107
109
|
end
|
@@ -182,8 +184,8 @@ describe Chef::Knife::Cloud::OraclecloudService do
|
|
182
184
|
expect(service).to receive(:instance_request).with(options).and_return(instance_request)
|
183
185
|
expect(orchestrations).to receive(:create).with(name: 'test_name',
|
184
186
|
description: 'test_name by test_username via Knife',
|
185
|
-
instances: [
|
186
|
-
|
187
|
+
instances: [instance_request])
|
188
|
+
.and_return(orchestration)
|
187
189
|
expect(service.create_orchestration(options)).to eq(orchestration)
|
188
190
|
end
|
189
191
|
end
|
@@ -253,7 +255,7 @@ describe Chef::Knife::Cloud::OraclecloudService do
|
|
253
255
|
sshkeys: 'test_sshkeys',
|
254
256
|
label: 'test_label',
|
255
257
|
public_ip: 'test_public_ip')
|
256
|
-
|
258
|
+
.and_return(instance_request)
|
257
259
|
expect(service.instance_request(options)).to eq(instance_request)
|
258
260
|
end
|
259
261
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -21,14 +23,14 @@ require 'chef/knife/oraclecloud_orchestration_delete'
|
|
21
23
|
require 'support/shared_examples_for_command'
|
22
24
|
|
23
25
|
describe Chef::Knife::Cloud::OraclecloudOrchestrationDelete do
|
24
|
-
let(:command) { described_class.new(%w
|
26
|
+
let(:command) { described_class.new(%w[orch1 orch2]) }
|
25
27
|
let(:service) { double('service') }
|
26
28
|
|
27
29
|
before do
|
28
30
|
allow(command).to receive(:service).and_return(service)
|
29
31
|
end
|
30
32
|
|
31
|
-
it_behaves_like Chef::Knife::Cloud::Command, described_class.new(%w
|
33
|
+
it_behaves_like Chef::Knife::Cloud::Command, described_class.new(%w[orch1 orch2])
|
32
34
|
|
33
35
|
describe '#validate_params!' do
|
34
36
|
context 'when no orchestrations are provided' do
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -21,7 +23,7 @@ require 'chef/knife/oraclecloud_orchestration_show'
|
|
21
23
|
require 'support/shared_examples_for_command'
|
22
24
|
|
23
25
|
describe Chef::Knife::Cloud::OraclecloudOrchestrationShow do
|
24
|
-
let(:command) { described_class.new(%w
|
26
|
+
let(:command) { described_class.new(%w[orch1]) }
|
25
27
|
let(:service) { double('service') }
|
26
28
|
|
27
29
|
before do
|
@@ -40,7 +42,7 @@ describe Chef::Knife::Cloud::OraclecloudOrchestrationShow do
|
|
40
42
|
end
|
41
43
|
|
42
44
|
context 'when more than one orchestration is provided' do
|
43
|
-
let(:command) { described_class.new(%w
|
45
|
+
let(:command) { described_class.new(%w[orch1 orch2]) }
|
44
46
|
it 'print an error and exits' do
|
45
47
|
expect(command.ui).to receive(:error)
|
46
48
|
expect { command.validate_params! }.to raise_error(SystemExit)
|
@@ -60,7 +62,7 @@ describe Chef::Knife::Cloud::OraclecloudOrchestrationShow do
|
|
60
62
|
let(:ui) { double('ui') }
|
61
63
|
let(:instance1) { double('instance1') }
|
62
64
|
let(:instance2) { double('instance2') }
|
63
|
-
let(:instances) { [
|
65
|
+
let(:instances) { [instance1, instance2] }
|
64
66
|
|
65
67
|
before do
|
66
68
|
allow(command).to receive(:ui).and_return(ui)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -22,13 +24,13 @@ require 'support/shared_examples_for_servercreatecommand'
|
|
22
24
|
|
23
25
|
describe Chef::Knife::Cloud::OraclecloudServerCreate do
|
24
26
|
argv = []
|
25
|
-
argv += %w
|
26
|
-
argv += %w
|
27
|
-
argv += %w
|
28
|
-
argv += %w
|
29
|
-
argv += %w
|
30
|
-
argv += %w
|
31
|
-
argv += %w
|
27
|
+
argv += %w[--image /path/to/test_image]
|
28
|
+
argv += %w[--shape test_shape]
|
29
|
+
argv += %w[--hostname test_hostname]
|
30
|
+
argv += %w[--public-ip pool]
|
31
|
+
argv += %w[--sshkeys user/test_key]
|
32
|
+
argv += %w[--bootstrap-protocol ssh]
|
33
|
+
argv += %w[--ssh-password test_password]
|
32
34
|
|
33
35
|
let(:command) { described_class.new(argv) }
|
34
36
|
let(:service) { double('service') }
|
@@ -81,7 +83,7 @@ describe Chef::Knife::Cloud::OraclecloudServerCreate do
|
|
81
83
|
allow(service).to receive(:prepend_identity_domain).with('key1').and_return('domain/key1')
|
82
84
|
allow(service).to receive(:prepend_identity_domain).with('key2').and_return('domain/key2')
|
83
85
|
|
84
|
-
expect(command.sshkeys).to eq([
|
86
|
+
expect(command.sshkeys).to eq(['domain/key1', 'domain/key2'])
|
85
87
|
end
|
86
88
|
end
|
87
89
|
|
@@ -103,7 +105,7 @@ describe Chef::Knife::Cloud::OraclecloudServerCreate do
|
|
103
105
|
describe '#ip_address' do
|
104
106
|
it 'defaults to a public IP if a public IP was requested' do
|
105
107
|
allow(command).to receive(:locate_config_value).with(:public_ip).and_return('pool')
|
106
|
-
allow(server).to receive(:public_ip_addresses).and_return([
|
108
|
+
allow(server).to receive(:public_ip_addresses).and_return(['1.2.3.4'])
|
107
109
|
|
108
110
|
expect(command.ip_address).to eq('1.2.3.4')
|
109
111
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -21,11 +23,11 @@ require 'chef/knife/oraclecloud_server_delete'
|
|
21
23
|
require 'support/shared_examples_for_command'
|
22
24
|
|
23
25
|
describe Chef::Knife::Cloud::OraclecloudServerDelete do
|
24
|
-
let(:command) { described_class.new(%w
|
26
|
+
let(:command) { described_class.new(%w[server1]) }
|
25
27
|
let(:service) { double('service') }
|
26
28
|
let(:server) { double('server') }
|
27
29
|
|
28
|
-
it_behaves_like Chef::Knife::Cloud::Command, described_class.new(%w
|
30
|
+
it_behaves_like Chef::Knife::Cloud::Command, described_class.new(%w[server1])
|
29
31
|
|
30
32
|
it 'executes the correct methods in the overrided execute_command' do
|
31
33
|
allow(command).to receive(:service).and_return(service)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
3
5
|
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
@@ -21,7 +23,7 @@ require 'chef/knife/oraclecloud_server_show'
|
|
21
23
|
require 'support/shared_examples_for_command'
|
22
24
|
|
23
25
|
describe Chef::Knife::Cloud::OraclecloudServerShow do
|
24
|
-
let(:command) { described_class.new(%w
|
26
|
+
let(:command) { described_class.new(%w[server1]) }
|
25
27
|
let(:service) { double('service') }
|
26
28
|
|
27
29
|
before do
|
@@ -40,7 +42,7 @@ describe Chef::Knife::Cloud::OraclecloudServerShow do
|
|
40
42
|
end
|
41
43
|
|
42
44
|
context 'when more than one server is provided' do
|
43
|
-
let(:command) { described_class.new(%w
|
45
|
+
let(:command) { described_class.new(%w[server1 server2]) }
|
44
46
|
it 'print an error and exits' do
|
45
47
|
expect(command.ui).to receive(:error)
|
46
48
|
expect { command.validate_params! }.to raise_error(SystemExit)
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-oraclecloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Partner Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '12.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '12.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: chefstyle
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rake
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,6 +118,7 @@ files:
|
|
104
118
|
- ".gitignore"
|
105
119
|
- ".rspec"
|
106
120
|
- ".rubocop.yml"
|
121
|
+
- ".rubocop_todo.yml"
|
107
122
|
- ".travis.yml"
|
108
123
|
- CHANGELOG.md
|
109
124
|
- Gemfile
|
@@ -156,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
171
|
version: '0'
|
157
172
|
requirements: []
|
158
173
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.7.6
|
160
175
|
signing_key:
|
161
176
|
specification_version: 4
|
162
177
|
summary: Knife plugin to interact with Oracle Cloud.
|
@@ -173,4 +188,3 @@ test_files:
|
|
173
188
|
- spec/unit/oraclecloud_server_list_spec.rb
|
174
189
|
- spec/unit/oraclecloud_server_show_spec.rb
|
175
190
|
- spec/unit/oraclecloud_shape_list_spec.rb
|
176
|
-
has_rdoc:
|