knife-vrealize 5.0.2 → 6.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc3c96c272f00e8d5bc3922de2db7b6ae0955d9cb7520c18e8ab64c882ea3312
4
- data.tar.gz: 7f74f3e6e96c360d807358fc4b3ecc29cea6d4b3758e9d2c3b752f44edad114b
3
+ metadata.gz: 0d4dafa146bc6df4768a50e5c1b23dfcebcd681e9ae6ef051730ff0a277e3689
4
+ data.tar.gz: 4fa38fb23055ff6e23952a975410605153051ac831e48b6ea1398427072abc6f
5
5
  SHA512:
6
- metadata.gz: 05aee0b54656edde368d422c94957a8266e5d88170fbb033669b15a3a47f2b91dd4bf0961180e6565f5c3c8f0db52c3e5ec5b9be8b4220812b4c16397376806f
7
- data.tar.gz: e5e1f2fcec20fb0af51ccac43d9923868220fdbdf748092c009b2a568d1a4cb302ae57f416564b81cf8e9a0180303dc4f5ab1d5f4b8aa762ba20cb791fda0180
6
+ metadata.gz: bc2207db033c162545c15093010be180fffa0d9ee173687dad160e22a4f913de9765d0d8d2014864025aa53b81335cb0088f243175c69f168b54e269f5bf8569
7
+ data.tar.gz: 9ec9d6219ff4074a6d40d1a3620e6694c7f012617499ed71e80594a3615180918c1e2dc5206502b211ba1e12badacfb2e67b2caa5183c309529aafb995dcf5a5
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -30,7 +30,7 @@ class Chef
30
30
  class VraService < Service
31
31
  include VraServiceHelpers
32
32
  def initialize(options = {})
33
- super(options)
33
+ super(config: options)
34
34
 
35
35
  @username = options[:username]
36
36
  @password = options[:password]
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -27,16 +27,16 @@ class Chef
27
27
  include Chef::Knife::Cloud::Helpers
28
28
 
29
29
  def create_service_instance
30
- Chef::Knife::Cloud::VraService.new(username: locate_config_value(:vra_username),
31
- password: locate_config_value(:vra_password),
32
- base_url: locate_config_value(:vra_base_url),
33
- tenant: locate_config_value(:vra_tenant),
34
- page_size: locate_config_value(:vra_page_size),
30
+ Chef::Knife::Cloud::VraService.new(username: config[:vra_username],
31
+ password: config[:vra_password],
32
+ base_url: config[:vra_base_url],
33
+ tenant: config[:vra_tenant],
34
+ page_size: config[:vra_page_size],
35
35
  verify_ssl: verify_ssl?)
36
36
  end
37
37
 
38
38
  def verify_ssl?
39
- !locate_config_value(:vra_disable_ssl_verify)
39
+ !config[:vra_disable_ssl_verify]
40
40
  end
41
41
 
42
42
  def wait_for_request(request, wait_time = 600, refresh_rate = 2)
@@ -78,7 +78,7 @@ class Chef
78
78
 
79
79
  # rubocop:disable Style/GuardClause
80
80
  def check_for_missing_config_values!(*keys)
81
- missing = keys.select { |x| locate_config_value(x).nil? }
81
+ missing = keys.select { |x| config[x].nil? }
82
82
 
83
83
  unless missing.empty?
84
84
  ui.error("The following required parameters are missing: #{missing.join(", ")}")
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -20,19 +20,22 @@
20
20
 
21
21
  require "chef/knife"
22
22
  require "chef/knife/cloud/list_resource_command"
23
- require_relative "cloud/vra_service"
24
- require_relative "cloud/vra_service_helpers"
25
23
  require_relative "cloud/vra_service_options"
26
24
 
27
25
  class Chef
28
26
  class Knife
29
27
  class Cloud
30
28
  class VraCatalogList < ResourceListCommand
31
- include VraServiceHelpers
32
29
  include VraServiceOptions
33
30
 
34
31
  banner "knife vra catalog list"
35
32
 
33
+ deps do
34
+ require_relative "cloud/vra_service"
35
+ require_relative "cloud/vra_service_helpers"
36
+ include VraServiceHelpers
37
+ end
38
+
36
39
  option :entitled,
37
40
  long: "--entitled-only",
38
41
  description: "only list entitled vRA catalog entries",
@@ -52,10 +55,12 @@ class Chef
52
55
  end
53
56
 
54
57
  def query_resource
55
- @service.list_catalog_items(locate_config_value(:entitled))
58
+ @service.list_catalog_items(config[:entitled])
56
59
  end
57
60
 
58
61
  def format_status_value(status)
62
+ return "-" if status.nil?
63
+
59
64
  status = status.downcase
60
65
  color = if status == "published"
61
66
  :green
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -21,20 +21,23 @@
21
21
  require "chef/knife"
22
22
  require "chef/knife/cloud/server/create_command"
23
23
  require "chef/knife/cloud/server/create_options"
24
- require_relative "cloud/vra_service"
25
- require_relative "cloud/vra_service_helpers"
26
24
  require_relative "cloud/vra_service_options"
25
+ require_relative "cloud/vra_service_helpers"
27
26
 
28
27
  class Chef
29
28
  class Knife
30
29
  class Cloud
31
30
  class VraServerCreate < ServerCreateCommand
32
- include VraServiceHelpers
33
31
  include VraServiceOptions
34
32
  include ServerCreateOptions
33
+ include VraServiceHelpers
35
34
 
36
35
  banner "knife vra server create CATALOG_ID (options)"
37
36
 
37
+ deps do
38
+ require_relative "cloud/vra_service"
39
+ end
40
+
38
41
  option :cpus,
39
42
  long: "--cpus NUM_CPUS",
40
43
  description: "Number of CPUs the server should have"
@@ -97,22 +100,22 @@ class Chef
97
100
 
98
101
  @create_options = {
99
102
  catalog_id: @name_args.first,
100
- cpus: locate_config_value(:cpus),
101
- memory: locate_config_value(:memory),
102
- requested_for: locate_config_value(:requested_for),
103
- subtenant_id: locate_config_value(:subtenant_id),
104
- lease_days: locate_config_value(:lease_days),
105
- notes: locate_config_value(:notes),
103
+ cpus: config[:cpus],
104
+ memory: config[:memory],
105
+ requested_for: config[:requested_for],
106
+ subtenant_id: config[:subtenant_id],
107
+ lease_days: config[:lease_days],
108
+ notes: config[:notes],
106
109
  extra_params: extra_params,
107
- wait_time: locate_config_value(:server_create_timeout),
108
- refresh_rate: locate_config_value(:request_refresh_rate),
110
+ wait_time: config[:server_create_timeout],
111
+ refresh_rate: config[:request_refresh_rate],
109
112
  }
110
113
  end
111
114
 
112
115
  def before_bootstrap
113
116
  super
114
117
 
115
- config[:chef_node_name] = locate_config_value(:chef_node_name) ? locate_config_value(:chef_node_name) : server.name
118
+ config[:chef_node_name] ||= server.name
116
119
  config[:bootstrap_ip_address] = hostname_for_server
117
120
  end
118
121
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -21,8 +21,6 @@
21
21
  require "chef/knife"
22
22
  require "chef/knife/cloud/server/delete_options"
23
23
  require "chef/knife/cloud/server/delete_command"
24
- require_relative "cloud/vra_service"
25
- require_relative "cloud/vra_service_helpers"
26
24
  require_relative "cloud/vra_service_options"
27
25
 
28
26
  class Chef
@@ -30,11 +28,16 @@ class Chef
30
28
  class Cloud
31
29
  class VraServerDelete < ServerDeleteCommand
32
30
  include ServerDeleteOptions
33
- include VraServiceHelpers
34
31
  include VraServiceOptions
35
32
 
36
33
  banner "knife vra server delete RESOURCE_ID [RESOURCE_ID] (options)"
37
34
 
35
+ deps do
36
+ require_relative "cloud/vra_service"
37
+ require_relative "cloud/vra_service_helpers"
38
+ include VraServiceHelpers
39
+ end
40
+
38
41
  # rubocop:disable Style/GuardClause
39
42
  def validate_params!
40
43
  if @name_args.empty?
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -21,19 +21,22 @@
21
21
  require "chef/knife"
22
22
  require "chef/knife/cloud/server/list_command"
23
23
  require "chef/knife/cloud/server/list_options"
24
- require_relative "cloud/vra_service"
25
- require_relative "cloud/vra_service_helpers"
26
24
  require_relative "cloud/vra_service_options"
27
25
 
28
26
  class Chef
29
27
  class Knife
30
28
  class Cloud
31
29
  class VraServerList < ServerListCommand
32
- include VraServiceHelpers
33
30
  include VraServiceOptions
34
31
 
35
32
  banner "knife vra server list"
36
33
 
34
+ deps do
35
+ require_relative "cloud/vra_service"
36
+ require_relative "cloud/vra_service_helpers"
37
+ include VraServiceHelpers
38
+ end
39
+
37
40
  def before_exec_command
38
41
  @columns_with_info = [
39
42
  { label: "Resource ID", key: "id" },
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -21,8 +21,6 @@
21
21
  require "chef/knife"
22
22
  require "chef/knife/cloud/server/show_options"
23
23
  require "chef/knife/cloud/server/show_command"
24
- require_relative "cloud/vra_service"
25
- require_relative "cloud/vra_service_helpers"
26
24
  require_relative "cloud/vra_service_options"
27
25
 
28
26
  class Chef
@@ -30,11 +28,16 @@ class Chef
30
28
  class Cloud
31
29
  class VraServerShow < ServerShowCommand
32
30
  include ServerShowOptions
33
- include VraServiceHelpers
34
31
  include VraServiceOptions
35
32
 
36
33
  banner "knife vra server show RESOURCE_ID (options)"
37
34
 
35
+ deps do
36
+ require_relative "cloud/vra_service"
37
+ require_relative "cloud/vra_service_helpers"
38
+ include VraServiceHelpers
39
+ end
40
+
38
41
  def validate_params!
39
42
  if @name_args.empty?
40
43
  ui.error("You must supply a Resource ID for a server to display.")
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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");
@@ -60,14 +60,14 @@ class Chef
60
60
  default: 300
61
61
 
62
62
  def verify_ssl?
63
- !locate_config_value(:vro_disable_ssl_verify)
63
+ !config[:vro_disable_ssl_verify]
64
64
  end
65
65
 
66
66
  def vro_config
67
67
  @vro_config ||= VcoWorkflows::Config.new(
68
- url: locate_config_value(:vro_base_url),
69
- username: locate_config_value(:vro_username),
70
- password: locate_config_value(:vro_password),
68
+ url: config[:vro_base_url],
69
+ username: config[:vro_username],
70
+ password: config[:vro_password],
71
71
  verify_ssl: verify_ssl?
72
72
  )
73
73
  end
@@ -105,7 +105,7 @@ class Chef
105
105
  end
106
106
 
107
107
  def wait_for_workflow
108
- wait_time = locate_config_value(:request_timeout)
108
+ wait_time = config[:request_timeout]
109
109
  Timeout.timeout(wait_time) do
110
110
  loop do
111
111
  token = vro_client.token
@@ -120,7 +120,7 @@ class Chef
120
120
 
121
121
  def missing_config_parameters
122
122
  %i{vro_username vro_password vro_base_url}.each_with_object([]) do |param, memo|
123
- memo << param if locate_config_value(param).nil?
123
+ memo << param if config[param].nil?
124
124
  end
125
125
  end
126
126
 
@@ -129,7 +129,6 @@ class Chef
129
129
  print_error_and_exit("The following parameters are missing but required:" \
130
130
  "#{missing_config_parameters.join(", ")}")
131
131
  end
132
-
133
132
  print_error_and_exit("You must supply a workflow name.") if @name_args.empty?
134
133
  end
135
134
 
@@ -165,7 +164,7 @@ class Chef
165
164
 
166
165
  def set_parameters
167
166
  self.workflow_name = @name_args.shift
168
- self.workflow_id = locate_config_value(:vro_workflow_id)
167
+ self.workflow_id = config[:vro_workflow_id]
169
168
  self.parameters = parse_and_validate_params!(@name_args)
170
169
  end
171
170
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  #
4
4
  # Author:: Chef Partner Engineering (<partnereng@chef.io>)
5
- # Copyright:: 2015-2019, Chef Software, Inc.
5
+ # Copyright:: Copyright (c) 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 = "5.0.2"
22
+ VERSION = "6.0.4"
23
23
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-vrealize
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: knife
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: knife-cloud
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -37,6 +51,9 @@ dependencies:
37
51
  - - "~>"
38
52
  - !ruby/object:Gem::Version
39
53
  version: '2'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '3'
40
57
  type: :runtime
41
58
  prerelease: false
42
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,6 +61,9 @@ dependencies:
44
61
  - - "~>"
45
62
  - !ruby/object:Gem::Version
46
63
  version: '2'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '3'
47
67
  - !ruby/object:Gem::Dependency
48
68
  name: vcoworkflows
49
69
  requirement: !ruby/object:Gem::Requirement
@@ -102,14 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
122
  requirements:
103
123
  - - ">="
104
124
  - !ruby/object:Gem::Version
105
- version: '2.5'
125
+ version: '2.7'
106
126
  required_rubygems_version: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - ">="
109
129
  - !ruby/object:Gem::Version
110
130
  version: '0'
111
131
  requirements: []
112
- rubygems_version: 3.0.3
132
+ rubygems_version: 3.1.4
113
133
  signing_key:
114
134
  specification_version: 4
115
135
  summary: Chef Infra Knife plugin to interact with VMware vRealize.