knife-vrealize 4.0.3 → 6.0.2

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: fc49e40f8108c889eeefee0e36abd650d75360e0d684428dc73fbe0f5343bdb7
4
- data.tar.gz: 804f29de229fb86018eec056a4823ce7467acc6c926213555f21c0a31594dc96
3
+ metadata.gz: 03cb6916378f57db2d333197682719f7612b4936d2ac61f26afcf9d6889c9867
4
+ data.tar.gz: 3733a59cad7f959fa75b6d3c12c2d0333c44658accf8af74cf276b17aa4fac11
5
5
  SHA512:
6
- metadata.gz: 7e049bf4c9c8bf7ebcba24120ed1af301cdd768950254f7df570190ea1e39427067ebabe7c1ec848f59f5801eef44d8c5d2f577539ffacd65a98d4490ec21bfa
7
- data.tar.gz: a0a23e3c51faa889ae4198cc4f5631425f73cb6a33caa8095a2ed52b59dd025bb1732466d2906595f72cdcaad80b98f031c5e5ac0f94eceb0084ba945fc553fb
6
+ metadata.gz: d001888998aaa107fe2028bbc4c7f5cf85e4213d1403f902a2bb85d9a5d25c88dded194a2c4c63c61b019f4a1f134dd40b6bc8a484023b4bf0fe8fe347195fd6
7
+ data.tar.gz: 1927b52b33099ce37136ccc2dd35b994aed6b50e9f8d764cbd33951a0d0416f9e6797326f09820c459f31fe13f7f96d77f8459fee90d008f03071377770b9eca
@@ -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,7 +21,7 @@
21
21
  require "chef/knife/cloud/exceptions"
22
22
  require "chef/knife/cloud/service"
23
23
  require "chef/knife/cloud/helpers"
24
- require "chef/knife/cloud/vra_service_helpers"
24
+ require_relative "vra_service_helpers"
25
25
  require "vra"
26
26
 
27
27
  class Chef
@@ -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 "chef/knife/cloud/vra_service"
24
- require "chef/knife/cloud/vra_service_helpers"
25
- require "chef/knife/cloud/vra_service_options"
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 "chef/knife/cloud/vra_service"
25
- require "chef/knife/cloud/vra_service_helpers"
26
- require "chef/knife/cloud/vra_service_options"
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,20 +21,23 @@
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 "chef/knife/cloud/vra_service"
25
- require "chef/knife/cloud/vra_service_helpers"
26
- require "chef/knife/cloud/vra_service_options"
24
+ require_relative "cloud/vra_service_options"
27
25
 
28
26
  class Chef
29
27
  class Knife
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 "chef/knife/cloud/vra_service"
25
- require "chef/knife/cloud/vra_service_helpers"
26
- require "chef/knife/cloud/vra_service_options"
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,20 +21,23 @@
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 "chef/knife/cloud/vra_service"
25
- require "chef/knife/cloud/vra_service_helpers"
26
- require "chef/knife/cloud/vra_service_options"
24
+ require_relative "cloud/vra_service_options"
27
25
 
28
26
  class Chef
29
27
  class Knife
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 = "4.0.3"
22
+ VERSION = "6.0.2"
23
23
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-vrealize
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: cookstyle
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'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: knife-cloud
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +19,7 @@ dependencies:
33
19
  version: 1.2.0
34
20
  - - "<"
35
21
  - !ruby/object:Gem::Version
36
- version: '3.0'
22
+ version: '5.0'
37
23
  type: :runtime
38
24
  prerelease: false
39
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +29,7 @@ dependencies:
43
29
  version: 1.2.0
44
30
  - - "<"
45
31
  - !ruby/object:Gem::Version
46
- version: '3.0'
32
+ version: '5.0'
47
33
  - !ruby/object:Gem::Dependency
48
34
  name: vmware-vra
49
35
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
102
  requirements:
117
103
  - - ">="
118
104
  - !ruby/object:Gem::Version
119
- version: '2.4'
105
+ version: '2.6'
120
106
  required_rubygems_version: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - ">="