knife-cloud 1.2.1 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +1 -1
  3. data/lib/chef/knife/cloud/chefbootstrap/bootstrap_distribution.rb +2 -2
  4. data/lib/chef/knife/cloud/chefbootstrap/bootstrap_options.rb +115 -133
  5. data/lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb +6 -6
  6. data/lib/chef/knife/cloud/chefbootstrap/bootstrapper.rb +11 -12
  7. data/lib/chef/knife/cloud/chefbootstrap/ssh_bootstrap_protocol.rb +49 -54
  8. data/lib/chef/knife/cloud/chefbootstrap/unix_distribution.rb +3 -3
  9. data/lib/chef/knife/cloud/chefbootstrap/windows_distribution.rb +3 -3
  10. data/lib/chef/knife/cloud/chefbootstrap/winrm_bootstrap_protocol.rb +11 -12
  11. data/lib/chef/knife/cloud/command.rb +24 -27
  12. data/lib/chef/knife/cloud/exceptions.rb +1 -2
  13. data/lib/chef/knife/cloud/fog/options.rb +8 -8
  14. data/lib/chef/knife/cloud/fog/service.rb +54 -60
  15. data/lib/chef/knife/cloud/helpers.rb +2 -3
  16. data/lib/chef/knife/cloud/list_resource_command.rb +6 -7
  17. data/lib/chef/knife/cloud/list_resource_options.rb +5 -5
  18. data/lib/chef/knife/cloud/server/create_command.rb +30 -35
  19. data/lib/chef/knife/cloud/server/create_options.rb +33 -34
  20. data/lib/chef/knife/cloud/server/delete_command.rb +12 -15
  21. data/lib/chef/knife/cloud/server/delete_options.rb +7 -8
  22. data/lib/chef/knife/cloud/server/list_command.rb +22 -22
  23. data/lib/chef/knife/cloud/server/list_options.rb +9 -10
  24. data/lib/chef/knife/cloud/server/options.rb +7 -7
  25. data/lib/chef/knife/cloud/server/show_command.rb +5 -5
  26. data/lib/chef/knife/cloud/server/show_options.rb +5 -6
  27. data/lib/chef/knife/cloud/service.rb +12 -13
  28. data/lib/knife-cloud/version.rb +2 -2
  29. data/lib/test/fixtures/knife.rb +3 -3
  30. data/lib/test/fixtures/validation.pem +27 -0
  31. data/lib/test/knife-utils/helper.rb +11 -11
  32. data/lib/test/knife-utils/knife_test_utils.rb +4 -4
  33. data/lib/test/knife-utils/matchers.rb +3 -3
  34. data/lib/test/knife-utils/test_bed.rb +38 -38
  35. data/lib/test/templates/windows-chef-client-msi.erb +3 -4
  36. data/lib/test/templates/windows-shell.erb +2 -2
  37. metadata +12 -152
  38. data/.gitignore +0 -33
  39. data/.travis.yml +0 -6
  40. data/CHANGELOG.md +0 -133
  41. data/CONTRIBUTING.md +0 -5
  42. data/Gemfile +0 -9
  43. data/README.md +0 -421
  44. data/Rakefile +0 -35
  45. data/ci.gemfile +0 -18
  46. data/knife-cloud.gemspec +0 -26
  47. data/spec/resource_spec_helper.rb +0 -49
  48. data/spec/server_command_common_spec_helper.rb +0 -48
  49. data/spec/spec_helper.rb +0 -25
  50. data/spec/support/shared_examples_for_command.rb +0 -35
  51. data/spec/support/shared_examples_for_servercreatecommand.rb +0 -144
  52. data/spec/support/shared_examples_for_serverdeletecommand.rb +0 -77
  53. data/spec/support/shared_examples_for_service.rb +0 -85
  54. data/spec/unit/bootstrap_protocol_spec.rb +0 -98
  55. data/spec/unit/bootstrapper_spec.rb +0 -171
  56. data/spec/unit/cloud_command_spec.rb +0 -35
  57. data/spec/unit/command_spec.rb +0 -49
  58. data/spec/unit/fog_service_spec.rb +0 -163
  59. data/spec/unit/list_resource_command_spec.rb +0 -140
  60. data/spec/unit/server_create_command_spec.rb +0 -198
  61. data/spec/unit/server_delete_command_spec.rb +0 -25
  62. data/spec/unit/server_list_command_spec.rb +0 -119
  63. data/spec/unit/server_show_command_spec.rb +0 -64
  64. data/spec/unit/service_spec.rb +0 -46
  65. data/spec/unit/ssh_bootstrap_protocol_spec.rb +0 -116
  66. data/spec/unit/unix_distribution_spec.rb +0 -37
  67. data/spec/unit/windows_distribution_spec.rb +0 -37
  68. data/spec/unit/winrm_bootstrap_protocol_spec.rb +0 -108
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0dffb3f762fabd5c361aa9b75c9664c201da6473
4
- data.tar.gz: 82bb614bfa626c8d0048a9473de8b3185451751a
2
+ SHA256:
3
+ metadata.gz: 3e9f12b223e859ae2666a230a73195fb48221bdf29edc0a3b345c0ddc40b6d3b
4
+ data.tar.gz: 80e5ff22aa5769a1e671526a6fe9a06436db5b3da5192f24dd02a63d5a961089
5
5
  SHA512:
6
- metadata.gz: 8e49df45f0bce339410f742445b94411d20ab2711828395f08a1897947c8a3d5d5025284f1f06ddae93c91f4760ae74dd2fb646b5fbd38d1d82d3e26d4894e57
7
- data.tar.gz: e047f78d7412473e0509bb43ff1154a602c3389f0fbfb740d201d8cd128a12f494ec2254a914cc47f0a10eb95b0a7d797a55632e0b645bcbfe78f70126dfc294
6
+ metadata.gz: 5c200c5564f6273a92472f0591bd04173b0e266488bddc3320ccccc5be2c00bdea7ac979f661083f559dd7ee4b92e82d8ca8c83335bebbcda033b81fd610106e
7
+ data.tar.gz: c79491de45e5a99dc43fdcb9204e425c75f1768d90e9518069a8b8cda69b675584fa9f76ccf64aede16e4fd00f8efa2ab27f438d8b965b5bd56f3123e5b90835
data/LICENSE CHANGED
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2013 Opscode, Inc.
189
+ Copyright [yyyy] [name of copyright owner]
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
3
- # Copyright:: Copyright (c) 2013 Opscode, Inc.
3
+ # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +15,7 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- require 'chef/knife/cloud/helpers'
18
+ require "chef/knife/cloud/helpers"
19
19
 
20
20
  class Chef
21
21
  class Knife
@@ -1,7 +1,7 @@
1
1
  # Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
2
2
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
3
3
  #
4
- # Copyright:: Copyright (c) 2013 Opscode, Inc.
4
+ # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,9 +15,9 @@
15
15
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
- require 'chef/knife/winrm_base'
19
- require 'chef/knife/core/bootstrap_context'
20
- require 'net/ssh/multi'
18
+ require "chef/knife/winrm_base"
19
+ require "chef/knife/core/bootstrap_context"
20
+ require "net/ssh/multi"
21
21
 
22
22
  class Chef
23
23
  class Knife
@@ -29,199 +29,181 @@ class Chef
29
29
  includer.class_eval do
30
30
 
31
31
  deps do
32
- require 'chef/json_compat'
33
- require 'tempfile'
34
- require 'highline'
35
- require 'net/ssh'
36
- require 'chef/knife/ssh'
32
+ require "chef/json_compat"
33
+ require "tempfile"
34
+ require "net/ssh"
35
+ require "chef/knife/ssh"
37
36
  Chef::Knife::Ssh.load_deps
38
37
  end
39
38
 
40
39
  include Chef::Knife::WinrmBase
41
40
 
42
41
  option :ssh_user,
43
- :short => "-x USERNAME",
44
- :long => "--ssh-user USERNAME",
45
- :description => "The ssh username",
46
- :default => "root"
42
+ short: "-x USERNAME",
43
+ long: "--ssh-user USERNAME",
44
+ description: "The ssh username",
45
+ default: "root"
47
46
 
48
47
  option :ssh_password,
49
- :short => "-P PASSWORD",
50
- :long => "--ssh-password PASSWORD",
51
- :description => "The ssh password"
48
+ short: "-P PASSWORD",
49
+ long: "--ssh-password PASSWORD",
50
+ description: "The ssh password"
52
51
 
53
52
  option :ssh_port,
54
- :short => "-p PORT",
55
- :long => "--ssh-port PORT",
56
- :description => "The ssh port",
57
- :proc => Proc.new { |key| Chef::Config[:knife][:ssh_port] = key },
58
- :default => "22"
53
+ short: "-p PORT",
54
+ long: "--ssh-port PORT",
55
+ description: "The ssh port",
56
+ proc: Proc.new { |key| Chef::Config[:knife][:ssh_port] = key },
57
+ default: "22"
59
58
 
60
59
  option :ssh_gateway,
61
- :long => "--ssh-gateway GATEWAY",
62
- :description => "The ssh gateway server. Any proxies configured in your ssh config are automatically used by default.",
63
- :proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway] = key }
60
+ long: "--ssh-gateway GATEWAY",
61
+ description: "The ssh gateway server. Any proxies configured in your ssh config are automatically used by default.",
62
+ proc: Proc.new { |key| Chef::Config[:knife][:ssh_gateway] = key }
64
63
 
65
64
  option :ssh_gateway_identity,
66
- :long => "--ssh-gateway-identity IDENTITY_FILE",
67
- :description => "The private key for ssh gateway server",
68
- :proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway_identity] = key }
65
+ long: "--ssh-gateway-identity IDENTITY_FILE",
66
+ description: "The private key for ssh gateway server",
67
+ proc: Proc.new { |key| Chef::Config[:knife][:ssh_gateway_identity] = key }
69
68
 
70
69
  option :forward_agent,
71
- :long => "--forward-agent",
72
- :description => "Enable SSH agent forwarding",
73
- :boolean => true
70
+ long: "--forward-agent",
71
+ description: "Enable SSH agent forwarding",
72
+ boolean: true
74
73
 
75
74
  option :identity_file,
76
- :short => "-i IDENTITY_FILE",
77
- :long => "--identity-file IDENTITY_FILE",
78
- :description => "The SSH identity file used for authentication"
75
+ short: "-i IDENTITY_FILE",
76
+ long: "--identity-file IDENTITY_FILE",
77
+ description: "The SSH identity file used for authentication"
79
78
 
80
79
  option :chef_node_name,
81
- :short => "-N NAME",
82
- :long => "--node-name NAME",
83
- :description => "The Chef node name for your new node"
80
+ short: "-N NAME",
81
+ long: "--node-name NAME",
82
+ description: "The Chef node name for your new node"
84
83
 
85
84
  option :prerelease,
86
- :long => "--prerelease",
87
- :description => "Install the pre-release chef gems"
85
+ long: "--prerelease",
86
+ description: "Install the pre-release chef gems"
88
87
 
89
88
  option :bootstrap_version,
90
- :long => "--bootstrap-version VERSION",
91
- :description => "The version of Chef to install",
92
- :proc => lambda { |v| Chef::Config[:knife][:bootstrap_version] = v }
89
+ long: "--bootstrap-version VERSION",
90
+ description: "The version of Chef to install",
91
+ proc: lambda { |v| Chef::Config[:knife][:bootstrap_version] = v }
93
92
 
94
93
  option :bootstrap_proxy,
95
- :long => "--bootstrap-proxy PROXY_URL",
96
- :description => "The proxy server for the node being bootstrapped",
97
- :proc => Proc.new { |p| Chef::Config[:knife][:bootstrap_proxy] = p }
94
+ long: "--bootstrap-proxy PROXY_URL",
95
+ description: "The proxy server for the node being bootstrapped",
96
+ proc: Proc.new { |p| Chef::Config[:knife][:bootstrap_proxy] = p }
98
97
 
99
98
  option :bootstrap_no_proxy,
100
- :long => "--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]",
101
- :description => "Do not proxy locations for the node being bootstrapped; this option is used internally by Opscode",
102
- :proc => Proc.new { |np| Chef::Config[:knife][:bootstrap_no_proxy] = np }
103
-
104
- option :distro,
105
- :short => "-d DISTRO",
106
- :long => "--distro DISTRO",
107
- :description => "Bootstrap a distro using a template. [DEPRECATED] Use -t / --template option instead.",
108
- :proc => Proc.new { |t|
109
- Chef::Log.warn("[DEPRECATED] -d / --distro option is deprecated. Use -t / --template option instead.")
110
- Chef::Config[:knife][:bootstrap_template] = t
111
- }
99
+ long: "--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]",
100
+ description: "Do not proxy locations for the node being bootstrapped; this option is used internally by Chef",
101
+ proc: Proc.new { |np| Chef::Config[:knife][:bootstrap_no_proxy] = np }
112
102
 
113
103
  option :bootstrap_template,
114
- :short => "-t TEMPLATE",
115
- :long => "--bootstrap-template TEMPLATE",
116
- :description => "Bootstrap Chef using a built-in or custom template. Set to the full path of an erb template or use one of the built-in templates."
104
+ short: "-t TEMPLATE",
105
+ long: "--bootstrap-template TEMPLATE",
106
+ description: "Bootstrap Chef using a built-in or custom template. Set to the full path of an erb template or use one of the built-in templates."
117
107
 
118
108
  option :use_sudo,
119
- :long => "--sudo",
120
- :description => "Execute the bootstrap via sudo",
121
- :boolean => true
109
+ long: "--sudo",
110
+ description: "Execute the bootstrap via sudo",
111
+ boolean: true
122
112
 
123
113
  option :use_sudo_password,
124
- :long => "--use-sudo-password",
125
- :description => "Execute the bootstrap via sudo with password",
126
- :boolean => false
127
-
128
- option :template_file,
129
- :long => "--template-file TEMPLATE",
130
- :description => "Full path to location of template to use. [DEPRECATED] Use -t / --bootstrap-template option instead.",
131
- :proc => Proc.new { |v|
132
- Chef::Log.warn("[DEPRECATED] --template-file option is deprecated. Use -t / --bootstrap-template option instead.")
133
- v
134
- }
114
+ long: "--use-sudo-password",
115
+ description: "Execute the bootstrap via sudo with password",
116
+ boolean: false
135
117
 
136
118
  option :run_list,
137
- :short => "-r RUN_LIST",
138
- :long => "--run-list RUN_LIST",
139
- :description => "Comma separated list of roles/recipes to apply",
140
- :proc => lambda { |o| o.split(/[\s,]+/) },
141
- :default => []
119
+ short: "-r RUN_LIST",
120
+ long: "--run-list RUN_LIST",
121
+ description: "Comma separated list of roles/recipes to apply",
122
+ proc: lambda { |o| o.split(/[\s,]+/) },
123
+ default: []
142
124
 
143
125
  option :first_boot_attributes,
144
- :short => "-j JSON_ATTRIBS",
145
- :long => "--json-attributes",
146
- :description => "A JSON string to be added to the first run of chef-client",
147
- :proc => lambda { |o| JSON.parse(o) },
148
- :default => {}
126
+ short: "-j JSON_ATTRIBS",
127
+ long: "--json-attributes",
128
+ description: "A JSON string to be added to the first run of chef-client",
129
+ proc: lambda { |o| JSON.parse(o) },
130
+ default: {}
149
131
 
150
132
  option :host_key_verify,
151
- :long => "--[no-]host-key-verify",
152
- :description => "Verify host key, enabled by default.",
153
- :boolean => true,
154
- :default => true
133
+ long: "--[no-]host-key-verify",
134
+ description: "Verify host key, enabled by default.",
135
+ boolean: true,
136
+ default: true
155
137
 
156
138
  option :hint,
157
- :long => "--hint HINT_NAME[=HINT_FILE]",
158
- :description => "Specify Ohai Hint to be set on the bootstrap target. Use multiple --hint options to specify multiple hints.",
159
- :proc => Proc.new { |h|
139
+ long: "--hint HINT_NAME[=HINT_FILE]",
140
+ description: "Specify Ohai Hint to be set on the bootstrap target. Use multiple --hint options to specify multiple hints.",
141
+ proc: Proc.new { |h|
160
142
  Chef::Config[:knife][:hints] ||= Hash.new
161
143
  name, path = h.split("=")
162
- Chef::Config[:knife][:hints][name] = path ? JSON.parse(::File.read(path)) : Hash.new }
144
+ Chef::Config[:knife][:hints][name] = path ? JSON.parse(::File.read(path)) : Hash.new }
163
145
 
164
146
  option :secret,
165
- :short => "-s SECRET",
166
- :long => "--secret ",
167
- :description => "The secret key to use to encrypt data bag item values"
147
+ short: "-s SECRET",
148
+ long: "--secret ",
149
+ description: "The secret key to use to encrypt data bag item values"
168
150
 
169
151
  option :secret_file,
170
- :long => "--secret-file SECRET_FILE",
171
- :description => "A file containing the secret key to use to encrypt data bag item values"
152
+ long: "--secret-file SECRET_FILE",
153
+ description: "A file containing the secret key to use to encrypt data bag item values"
172
154
 
173
155
  option :bootstrap_url,
174
- :long => "--bootstrap-url URL",
175
- :description => "URL to a custom installation script",
176
- :proc => Proc.new { |u| Chef::Config[:knife][:bootstrap_url] = u }
156
+ long: "--bootstrap-url URL",
157
+ description: "URL to a custom installation script",
158
+ proc: Proc.new { |u| Chef::Config[:knife][:bootstrap_url] = u }
177
159
 
178
160
  option :bootstrap_curl_options,
179
- :long => "--bootstrap-curl-options OPTIONS",
180
- :description => "Add options to curl when install chef-client",
181
- :proc => Proc.new { |co| Chef::Config[:knife][:bootstrap_curl_options] = co }
161
+ long: "--bootstrap-curl-options OPTIONS",
162
+ description: "Add options to curl when install chef-client",
163
+ proc: Proc.new { |co| Chef::Config[:knife][:bootstrap_curl_options] = co }
182
164
 
183
165
  option :auth_timeout,
184
- :long => "--auth-timeout MINUTES",
185
- :description => "The maximum time in minutes to wait to for authentication over the transport to the node to succeed. The default value is 25 minutes.",
186
- :default => 25
166
+ long: "--auth-timeout MINUTES",
167
+ description: "The maximum time in minutes to wait to for authentication over the transport to the node to succeed. The default value is 25 minutes.",
168
+ default: 25
187
169
 
188
170
  option :node_ssl_verify_mode,
189
- :long => "--node-ssl-verify-mode [peer|none]",
190
- :description => "Whether or not to verify the SSL cert for all HTTPS requests.",
191
- :proc => Proc.new { |v|
192
- valid_values = ["none", "peer"]
171
+ long: "--node-ssl-verify-mode [peer|none]",
172
+ description: "Whether or not to verify the SSL cert for all HTTPS requests.",
173
+ proc: Proc.new { |v|
174
+ valid_values = %w{none peer}
193
175
  unless valid_values.include?(v)
194
176
  raise "Invalid value '#{v}' for --node-ssl-verify-mode. Valid values are: #{valid_values.join(", ")}"
195
177
  end
196
178
  }
197
179
 
198
180
  option :node_verify_api_cert,
199
- :long => "--[no-]node-verify-api-cert",
200
- :description => "Verify the SSL cert for HTTPS requests to the Chef server API.",
201
- :boolean => true
181
+ long: "--[no-]node-verify-api-cert",
182
+ description: "Verify the SSL cert for HTTPS requests to the Chef server API.",
183
+ boolean: true
202
184
 
203
185
  option :bootstrap_install_command,
204
- :long => "--bootstrap-install-command COMMANDS",
205
- :description => "Custom command to install chef-client",
206
- :proc => Proc.new { |ic| Chef::Config[:knife][:bootstrap_install_command] = ic }
186
+ long: "--bootstrap-install-command COMMANDS",
187
+ description: "Custom command to install chef-client",
188
+ proc: Proc.new { |ic| Chef::Config[:knife][:bootstrap_install_command] = ic }
207
189
 
208
190
  option :bootstrap_wget_options,
209
- :long => "--bootstrap-wget-options OPTIONS",
210
- :description => "Add options to wget when installing chef-client",
211
- :proc => Proc.new { |wo| Chef::Config[:knife][:bootstrap_wget_options] = wo }
191
+ long: "--bootstrap-wget-options OPTIONS",
192
+ description: "Add options to wget when installing chef-client",
193
+ proc: Proc.new { |wo| Chef::Config[:knife][:bootstrap_wget_options] = wo }
212
194
 
213
195
  option :bootstrap_vault_file,
214
- :long => '--bootstrap-vault-file VAULT_FILE',
215
- :description => 'A JSON file with a list of vault(s) and item(s) to be updated'
196
+ long: "--bootstrap-vault-file VAULT_FILE",
197
+ description: "A JSON file with a list of vault(s) and item(s) to be updated"
216
198
 
217
199
  option :bootstrap_vault_json,
218
- :long => '--bootstrap-vault-json VAULT_JSON',
219
- :description => 'A JSON string with the vault(s) and item(s) to be updated'
200
+ long: "--bootstrap-vault-json VAULT_JSON",
201
+ description: "A JSON string with the vault(s) and item(s) to be updated"
220
202
 
221
203
  option :bootstrap_vault_item,
222
- :long => '--bootstrap-vault-item VAULT_ITEM',
223
- :description => 'A single vault and item to update as "vault:item"',
224
- :proc => Proc.new { |i|
204
+ long: "--bootstrap-vault-item VAULT_ITEM",
205
+ description: 'A single vault and item to update as "vault:item"',
206
+ proc: Proc.new { |i|
225
207
  (vault, item) = i.split(/:/)
226
208
  Chef::Config[:knife][:bootstrap_vault_item] ||= {}
227
209
  Chef::Config[:knife][:bootstrap_vault_item][vault] ||= []
@@ -229,15 +211,15 @@ class Chef
229
211
  Chef::Config[:knife][:bootstrap_vault_item]
230
212
  }
231
213
  option :msi_url,
232
- :short => "-u URL",
233
- :long => "--msi-url URL",
234
- :description => "Location of the Chef Client MSI. The default templates will prefer to download from this location. The MSI will be downloaded from chef.io if not provided.",
235
- :default => ''
236
-
214
+ short: "-u URL",
215
+ long: "--msi-url URL",
216
+ description: "Location of the Chef Client MSI. The default templates will prefer to download from this location. The MSI will be downloaded from chef.io if not provided.",
217
+ default: ""
218
+
237
219
  option :install_as_service,
238
- :long => "--install-as-service",
239
- :description => "Install chef-client as service in windows machine",
240
- :default => false
220
+ long: "--install-as-service",
221
+ description: "Install chef-client as service in windows machine",
222
+ default: false
241
223
 
242
224
  end
243
225
  end
@@ -1,7 +1,7 @@
1
1
  # Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
2
2
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
3
3
  #
4
- # Copyright:: Copyright (c) 2013 Opscode, Inc.
4
+ # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,8 +17,8 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require 'chef/knife/core/ui'
21
- require 'chef/knife/cloud/helpers'
20
+ require "chef/knife/core/ui"
21
+ require "chef/knife/cloud/helpers"
22
22
 
23
23
  class Chef
24
24
  class Knife
@@ -35,7 +35,7 @@ class Chef
35
35
  end
36
36
 
37
37
  def wait_for_server_ready
38
- raise Chef::Exceptions::Override, "You must override wait_for_server_ready in #{self.to_s}"
38
+ raise Chef::Exceptions::Override, "You must override wait_for_server_ready in #{self}"
39
39
  end
40
40
 
41
41
  def send_bootstrap_command
@@ -60,8 +60,8 @@ class Chef
60
60
  bootstrap.config[:first_boot_attributes] = locate_config_value(:first_boot_attributes)
61
61
  bootstrap.config[:secret] = locate_config_value(:secret)
62
62
  bootstrap.config[:secret_file] = locate_config_value(:secret_file)
63
- bootstrap.config[:template_file] = locate_config_value(:template_file)
64
- bootstrap.config[:bootstrap_template] = locate_config_value(:bootstrap_template)
63
+ bootstrap.config[:template_file] = locate_config_value(:template_file)
64
+ bootstrap.config[:bootstrap_template] = locate_config_value(:bootstrap_template)
65
65
  bootstrap.config[:node_ssl_verify_mode] = locate_config_value(:node_ssl_verify_mode)
66
66
  bootstrap.config[:node_verify_api_cert] = locate_config_value(:node_verify_api_cert)
67
67
  bootstrap.config[:bootstrap_no_proxy] = locate_config_value(:bootstrap_no_proxy)
@@ -1,7 +1,7 @@
1
1
  # Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
2
2
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
3
3
  #
4
- # Copyright:: Copyright (c) 2013 Opscode, Inc.
4
+ # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,12 +17,12 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require 'chef/knife/core/ui'
21
- require 'chef/knife/cloud/chefbootstrap/ssh_bootstrap_protocol'
22
- require 'chef/knife/cloud/chefbootstrap/winrm_bootstrap_protocol'
23
- require 'chef/knife/cloud/chefbootstrap/windows_distribution'
24
- require 'chef/knife/cloud/chefbootstrap/unix_distribution'
25
- require 'chef/knife/cloud/exceptions'
20
+ require "chef/knife/core/ui"
21
+ require "chef/knife/cloud/chefbootstrap/ssh_bootstrap_protocol"
22
+ require "chef/knife/cloud/chefbootstrap/winrm_bootstrap_protocol"
23
+ require "chef/knife/cloud/chefbootstrap/windows_distribution"
24
+ require "chef/knife/cloud/chefbootstrap/unix_distribution"
25
+ require "chef/knife/cloud/exceptions"
26
26
 
27
27
  class Chef
28
28
  class Knife
@@ -47,9 +47,9 @@ class Chef
47
47
  end
48
48
 
49
49
  def create_bootstrap_protocol
50
- if @config[:bootstrap_protocol].nil? or @config[:bootstrap_protocol] == 'ssh'
50
+ if @config[:bootstrap_protocol].nil? || @config[:bootstrap_protocol] == "ssh"
51
51
  SshBootstrapProtocol.new(@config)
52
- elsif @config[:bootstrap_protocol] == 'winrm'
52
+ elsif @config[:bootstrap_protocol] == "winrm"
53
53
  WinrmBootstrapProtocol.new(@config)
54
54
  else
55
55
  # raise an exception, invalid bootstrap protocol.
@@ -60,9 +60,9 @@ class Chef
60
60
  end
61
61
 
62
62
  def create_bootstrap_distribution
63
- if @config[:image_os_type] == 'windows'
63
+ if @config[:image_os_type] == "windows"
64
64
  Chef::Knife::Cloud::WindowsDistribution.new(@config)
65
- elsif @config[:image_os_type] == 'linux'
65
+ elsif @config[:image_os_type] == "linux"
66
66
  Chef::Knife::Cloud::UnixDistribution.new(@config)
67
67
  else
68
68
  # raise an exception, invalid bootstrap distribution.
@@ -75,4 +75,3 @@ class Chef
75
75
  end
76
76
  end
77
77
  end
78
-