knife-vrealize 3.0.0 → 4.0.3

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright (c) 2015 Chef Software, Inc.
5
+ # Copyright:: 2015-2019, Chef Software, Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,12 +18,12 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
- require 'chef/knife'
22
- require 'chef/knife/cloud/server/delete_options'
23
- require 'chef/knife/cloud/server/delete_command'
24
- require 'chef/knife/cloud/vra_service'
25
- require 'chef/knife/cloud/vra_service_helpers'
26
- require 'chef/knife/cloud/vra_service_options'
21
+ require "chef/knife"
22
+ require "chef/knife/cloud/server/delete_options"
23
+ require "chef/knife/cloud/server/delete_command"
24
+ require "chef/knife/cloud/vra_service"
25
+ require "chef/knife/cloud/vra_service_helpers"
26
+ require "chef/knife/cloud/vra_service_options"
27
27
 
28
28
  class Chef
29
29
  class Knife
@@ -33,12 +33,12 @@ class Chef
33
33
  include VraServiceHelpers
34
34
  include VraServiceOptions
35
35
 
36
- banner 'knife vra server delete RESOURCE_ID [RESOURCE_ID] (options)'
36
+ banner "knife vra server delete RESOURCE_ID [RESOURCE_ID] (options)"
37
37
 
38
38
  # rubocop:disable Style/GuardClause
39
39
  def validate_params!
40
40
  if @name_args.empty?
41
- ui.error('You must supply a resource ID of a server to delete.')
41
+ ui.error("You must supply a resource ID of a server to delete.")
42
42
  exit(1) if @name_args.empty?
43
43
  end
44
44
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright (c) 2015 Chef Software, Inc.
5
+ # Copyright:: 2015-2019, Chef Software, Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,12 +18,12 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
- require 'chef/knife'
22
- require 'chef/knife/cloud/server/list_command'
23
- require 'chef/knife/cloud/server/list_options'
24
- require 'chef/knife/cloud/vra_service'
25
- require 'chef/knife/cloud/vra_service_helpers'
26
- require 'chef/knife/cloud/vra_service_options'
21
+ require "chef/knife"
22
+ require "chef/knife/cloud/server/list_command"
23
+ require "chef/knife/cloud/server/list_options"
24
+ require "chef/knife/cloud/vra_service"
25
+ require "chef/knife/cloud/vra_service_helpers"
26
+ require "chef/knife/cloud/vra_service_options"
27
27
 
28
28
  class Chef
29
29
  class Knife
@@ -32,25 +32,25 @@ class Chef
32
32
  include VraServiceHelpers
33
33
  include VraServiceOptions
34
34
 
35
- banner 'knife vra server list'
35
+ banner "knife vra server list"
36
36
 
37
37
  def before_exec_command
38
38
  @columns_with_info = [
39
- { label: 'Resource ID', key: 'id' },
40
- { label: 'Name', key: 'name' },
41
- { label: 'Status', key: 'status', value_callback: method(:format_status_value) },
42
- { label: 'Catalog Name', key: 'catalog_name' }
39
+ { label: "Resource ID", key: "id" },
40
+ { label: "Name", key: "name" },
41
+ { label: "Status", key: "status", value_callback: method(:format_status_value) },
42
+ { label: "Catalog Name", key: "catalog_name" },
43
43
  ]
44
44
 
45
- @sort_by_field = 'name'
45
+ @sort_by_field = "name"
46
46
  end
47
47
 
48
48
  def format_status_value(status)
49
49
  status = status.downcase
50
50
  status_color = case status
51
- when 'active'
51
+ when "active"
52
52
  :green
53
- when 'deleted'
53
+ when "deleted"
54
54
  :red
55
55
  else
56
56
  :yellow
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright (c) 2015 Chef Software, Inc.
5
+ # Copyright:: 2015-2019, Chef Software, Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,12 +18,12 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
- require 'chef/knife'
22
- require 'chef/knife/cloud/server/show_options'
23
- require 'chef/knife/cloud/server/show_command'
24
- require 'chef/knife/cloud/vra_service'
25
- require 'chef/knife/cloud/vra_service_helpers'
26
- require 'chef/knife/cloud/vra_service_options'
21
+ require "chef/knife"
22
+ require "chef/knife/cloud/server/show_options"
23
+ require "chef/knife/cloud/server/show_command"
24
+ require "chef/knife/cloud/vra_service"
25
+ require "chef/knife/cloud/vra_service_helpers"
26
+ require "chef/knife/cloud/vra_service_options"
27
27
 
28
28
  class Chef
29
29
  class Knife
@@ -33,16 +33,16 @@ class Chef
33
33
  include VraServiceHelpers
34
34
  include VraServiceOptions
35
35
 
36
- banner 'knife vra server show RESOURCE_ID (options)'
36
+ banner "knife vra server show RESOURCE_ID (options)"
37
37
 
38
38
  def validate_params!
39
39
  if @name_args.empty?
40
- ui.error('You must supply a Resource ID for a server to display.')
40
+ ui.error("You must supply a Resource ID for a server to display.")
41
41
  exit 1
42
42
  end
43
43
 
44
44
  if @name_args.size > 1
45
- ui.error('You may only supply one Resource ID.')
45
+ ui.error("You may only supply one Resource ID.")
46
46
  exit 1
47
47
  end
48
48
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright (c) 2015 Chef Software, Inc.
5
+ # Copyright:: 2015-2019, Chef Software, Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,8 +18,8 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
- require 'chef/knife'
22
- require 'vcoworkflows'
21
+ require "chef/knife"
22
+ require "vcoworkflows"
23
23
 
24
24
  class Chef
25
25
  class Knife
@@ -30,33 +30,33 @@ class Chef
30
30
 
31
31
  include Chef::Knife::Cloud::Helpers
32
32
 
33
- banner 'knife vro workflow execute WORKFLOW_NAME [KEY=VALUE] [KEY=VALUE] (options)'
33
+ banner "knife vro workflow execute WORKFLOW_NAME [KEY=VALUE] [KEY=VALUE] (options)"
34
34
 
35
35
  option :vro_base_url,
36
- long: '--vro-base-url API_URL',
37
- description: 'URL for the vro server'
36
+ long: "--vro-base-url API_URL",
37
+ description: "URL for the vro server"
38
38
 
39
39
  option :vro_username,
40
- long: '--vro-username USERNAME',
41
- description: 'Username to use with the vro API'
40
+ long: "--vro-username USERNAME",
41
+ description: "Username to use with the vro API"
42
42
 
43
43
  option :vro_password,
44
- long: '--vro-password PASSWORD',
45
- description: 'Password to use with the vro API'
44
+ long: "--vro-password PASSWORD",
45
+ description: "Password to use with the vro API"
46
46
 
47
47
  option :vro_disable_ssl_verify,
48
- long: '--vro-disable-ssl-verify',
49
- description: 'Skip any SSL verification for the vro API',
48
+ long: "--vro-disable-ssl-verify",
49
+ description: "Skip any SSL verification for the vro API",
50
50
  boolean: true,
51
51
  default: false
52
52
 
53
53
  option :vro_workflow_id,
54
- long: '--vro-workflow-id WORKFLOW_ID',
55
- description: 'ID of the workflow to execute'
54
+ long: "--vro-workflow-id WORKFLOW_ID",
55
+ description: "ID of the workflow to execute"
56
56
 
57
57
  option :request_timeout,
58
- long: '--request-timeout SECONDS',
59
- description: 'number of seconds to wait for the workflow to complete',
58
+ long: "--request-timeout SECONDS",
59
+ description: "number of seconds to wait for the workflow to complete",
60
60
  default: 300
61
61
 
62
62
  def verify_ssl?
@@ -82,7 +82,7 @@ class Chef
82
82
 
83
83
  def parse_and_validate_params!(args)
84
84
  args.each_with_object({}) do |arg, memo|
85
- key, value = arg.split('=')
85
+ key, value = arg.split("=")
86
86
  raise "Invalid parameter, must be in KEY=VALUE format: #{arg}" if key.nil? || value.nil?
87
87
 
88
88
  memo[key] = value
@@ -119,18 +119,18 @@ class Chef
119
119
  end
120
120
 
121
121
  def missing_config_parameters
122
- %i[vro_username vro_password vro_base_url].each_with_object([]) do |param, memo|
122
+ %i{vro_username vro_password vro_base_url}.each_with_object([]) do |param, memo|
123
123
  memo << param if locate_config_value(param).nil?
124
124
  end
125
125
  end
126
126
 
127
127
  def validate!
128
128
  unless missing_config_parameters.empty?
129
- print_error_and_exit('The following parameters are missing but required:' \
130
- "#{missing_config_parameters.join(', ')}")
129
+ print_error_and_exit("The following parameters are missing but required:" \
130
+ "#{missing_config_parameters.join(", ")}")
131
131
  end
132
132
 
133
- print_error_and_exit('You must supply a workflow name.') if @name_args.empty?
133
+ print_error_and_exit("You must supply a workflow name.") if @name_args.empty?
134
134
  end
135
135
 
136
136
  def print_error_and_exit(msg)
@@ -139,7 +139,7 @@ class Chef
139
139
  end
140
140
 
141
141
  def print_results
142
- ui.msg('')
142
+ ui.msg("")
143
143
  print_output_parameters
144
144
  print_execution_log
145
145
  end
@@ -148,18 +148,18 @@ class Chef
148
148
  token = vro_client.token
149
149
  return if token.output_parameters.empty?
150
150
 
151
- ui.msg(ui.color('Output Parameters:', :bold))
151
+ ui.msg(ui.color("Output Parameters:", :bold))
152
152
  token.output_parameters.each do |k, v|
153
153
  msg_pair(k, "#{v.value} (#{v.type})") unless v.value.nil? || (v.value.respond_to?(:empty?) && v.value.empty?)
154
154
  end
155
- ui.msg('')
155
+ ui.msg("")
156
156
  end
157
157
 
158
158
  def print_execution_log
159
159
  log = vro_client.log.to_s
160
160
  return if log.nil? || log.empty?
161
161
 
162
- ui.msg(ui.color('Workflow Execution Log:', :bold))
162
+ ui.msg(ui.color("Workflow Execution Log:", :bold))
163
163
  ui.msg(log)
164
164
  end
165
165
 
@@ -174,13 +174,13 @@ class Chef
174
174
 
175
175
  set_parameters
176
176
 
177
- ui.msg('Starting workflow execution...')
177
+ ui.msg("Starting workflow execution...")
178
178
  execution_id = execute_workflow
179
179
 
180
180
  ui.msg("Workflow execution #{execution_id} started. Waiting for it to complete...")
181
181
  wait_for_workflow
182
182
 
183
- ui.msg('Workflow execution complete.')
183
+ ui.msg("Workflow execution complete.")
184
184
 
185
185
  print_results
186
186
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: Copyright (c) 2015 Chef Software, Inc.
5
+ # Copyright:: 2015-2019, Chef Software, Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,5 +19,5 @@
19
19
  #
20
20
 
21
21
  module KnifeVrealize
22
- VERSION = '3.0.0'
22
+ VERSION = "4.0.3"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-vrealize
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - Chef Partner Engineering
7
+ - Chef Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2019-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cookstyle
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: knife-cloud
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.2.0
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '3.0'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: 1.2.0
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '3.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: vmware-vra
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -80,81 +86,14 @@ dependencies:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
88
  version: '0.5'
83
- - !ruby/object:Gem::Dependency
84
- name: bundler
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.7'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.7'
97
- - !ruby/object:Gem::Dependency
98
- name: github_changelog_generator
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rake
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '10.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '10.0'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '0.35'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '0.35'
139
- description: Knife plugin to interact with VMware vRealize.
89
+ description: Chef Infra Knife plugin to interact with VMware vRealize.
140
90
  email:
141
- - partnereng@chef.io
91
+ - oss@chef.io
142
92
  executables: []
143
93
  extensions: []
144
94
  extra_rdoc_files: []
145
95
  files:
146
- - ".github/ISSUE_TEMPLATE.md"
147
- - ".github/PULL_REQUEST_TEMPLATE.md"
148
- - ".gitignore"
149
- - ".rubocop.yml"
150
- - ".travis.yml"
151
- - CHANGELOG.md
152
- - Gemfile
153
- - Jenkinsfile
154
- - LICENSE.txt
155
- - README.md
156
- - Rakefile
157
- - knife-vrealize.gemspec
96
+ - LICENSE
158
97
  - lib/chef/knife/cloud/vra_service.rb
159
98
  - lib/chef/knife/cloud/vra_service_helpers.rb
160
99
  - lib/chef/knife/cloud/vra_service_options.rb
@@ -165,18 +104,9 @@ files:
165
104
  - lib/chef/knife/vra_server_show.rb
166
105
  - lib/chef/knife/vro_workflow_execute.rb
167
106
  - lib/knife-vrealize/version.rb
168
- - spec/spec_helper.rb
169
- - spec/unit/cloud/vra_service_helpers_spec.rb
170
- - spec/unit/cloud/vra_service_spec.rb
171
- - spec/unit/vra_catalog_list_spec.rb
172
- - spec/unit/vra_server_create_spec.rb
173
- - spec/unit/vra_server_delete_spec.rb
174
- - spec/unit/vra_server_list_spec.rb
175
- - spec/unit/vra_server_show_spec.rb
176
- - spec/unit/vro_workflow_execute_spec.rb
177
- homepage: https://github.com/chef-partners/knife-vrealize
107
+ homepage: https://github.com/chef/knife-vrealize
178
108
  licenses:
179
- - Apache 2.0
109
+ - Apache-2.0
180
110
  metadata: {}
181
111
  post_install_message:
182
112
  rdoc_options: []
@@ -186,25 +116,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
116
  requirements:
187
117
  - - ">="
188
118
  - !ruby/object:Gem::Version
189
- version: '0'
119
+ version: '2.4'
190
120
  required_rubygems_version: !ruby/object:Gem::Requirement
191
121
  requirements:
192
122
  - - ">="
193
123
  - !ruby/object:Gem::Version
194
124
  version: '0'
195
125
  requirements: []
196
- rubyforge_project:
197
- rubygems_version: 2.5.1
126
+ rubygems_version: 3.0.3
198
127
  signing_key:
199
128
  specification_version: 4
200
- summary: Knife plugin to interact with VMware vRealize.
201
- test_files:
202
- - spec/spec_helper.rb
203
- - spec/unit/cloud/vra_service_helpers_spec.rb
204
- - spec/unit/cloud/vra_service_spec.rb
205
- - spec/unit/vra_catalog_list_spec.rb
206
- - spec/unit/vra_server_create_spec.rb
207
- - spec/unit/vra_server_delete_spec.rb
208
- - spec/unit/vra_server_list_spec.rb
209
- - spec/unit/vra_server_show_spec.rb
210
- - spec/unit/vro_workflow_execute_spec.rb
129
+ summary: Chef Infra Knife plugin to interact with VMware vRealize.
130
+ test_files: []