hammer_cli_foreman_puppet 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb434e53e9e04daa2080f72e8194162bbd4f336e242387ee59324dbb3cd59946
4
- data.tar.gz: a09d9b608bd2ed784d7a75fdc4a156d46102b15cceb152bc5ac3dd8625e80615
3
+ metadata.gz: 70ea47a81549cde7da9bbdce56937da3c20d4936cc7ebc526cf0d671890e2e80
4
+ data.tar.gz: 042c018b0757d76f33b5284247a4f84edfceb1d102f48aabd0497399ddc2abb8
5
5
  SHA512:
6
- metadata.gz: fb79af2cd152c7c74abbff609b07515b2cd4bd1e84da31f147676963ff5c152ac7c0045ab9486aedc0be4d2ab01a5768858d3a28a88337c5579f86c1374abc71
7
- data.tar.gz: ff88674f1581845eb009a482fa1266102327f370248493181a3f3faf39c8336d5d2213c010cdafb60c86425ef2f7ae1f18cab9fa51de3ac34c6466491471a801
6
+ metadata.gz: 1f4fd40cca5fba2861777cea022d2aed231594e654f73091f0f9861b5f0c15cfa31258dacbf5334988430eb37fed18bc837e10ad52b3ba070016d144d5cbd3cc
7
+ data.tar.gz: 833af50bdc2165b5b9f93e9dbc056a57379cec64c21251c0ffb707497699df4c76ec9b125fe80b596e2ca91dad4630b4c89654198149d7801ca05ce379a5b3b3
@@ -17,6 +17,16 @@ module HammerCLIForemanPuppet
17
17
  child '--puppet-classes', 'PUPPET_CLASS_NAMES', '',
18
18
  attribute_name: :option_puppetclass_names
19
19
  end
20
+ option_family(
21
+ format: HammerCLI::Options::Normalizers::List.new,
22
+ aliased_resource: 'config_group',
23
+ description: 'Names/Ids of associated config groups'
24
+ ) do
25
+ parent '--config-group-ids', 'CONFIG_GROUP_IDS', _('IDs of associated config groups'),
26
+ attribute_name: :option_config_group_ids
27
+ child '--config-groups', 'CONFIG_GROUP_NAMES', '',
28
+ attribute_name: :option_config_group_names
29
+ end
20
30
  option_family associate: 'puppet_proxy' do
21
31
  child '--puppet-proxy', 'PUPPET_PROXY_NAME', _('Name of Puppet proxy')
22
32
  end
@@ -40,6 +50,17 @@ module HammerCLIForemanPuppet
40
50
  def self.proxy_id(resolver, name)
41
51
  resolver.smart_proxy_id('option_name' => name)
42
52
  end
53
+
54
+ def self.delete_deprecated_options(command_class)
55
+ %w[--puppetclass-ids --environment-id --config-group-ids].each do |switch|
56
+ family = command_class.option_families.find do |f|
57
+ f.head.switches.include?(switch)
58
+ end
59
+ command_class.declared_options.delete_if do |o|
60
+ family.all.include?(o)
61
+ end
62
+ end
63
+ end
43
64
  end
44
65
  end
45
66
  end
@@ -23,6 +23,16 @@ module HammerCLIForemanPuppet
23
23
  child '--puppet-classes', 'PUPPET_CLASS_NAMES', '',
24
24
  attribute_name: :option_puppetclass_names
25
25
  end
26
+ option_family(
27
+ format: HammerCLI::Options::Normalizers::List.new,
28
+ aliased_resource: 'config_group',
29
+ description: 'Names/Ids of associated config groups'
30
+ ) do
31
+ parent '--config-group-ids', 'CONFIG_GROUP_IDS', _('IDs of associated config groups'),
32
+ attribute_name: :option_config_group_ids
33
+ child '--config-groups', 'CONFIG_GROUP_NAMES', '',
34
+ attribute_name: :option_config_group_names
35
+ end
26
36
  option '--puppet-ca-proxy', 'PUPPET_CA_PROXY_NAME', _('Name of Puppet CA proxy')
27
37
  option '--puppet-proxy', 'PUPPET_PROXY_NAME', _('Name of Puppet proxy')
28
38
 
@@ -42,6 +52,17 @@ module HammerCLIForemanPuppet
42
52
  def self.proxy_id(resolver, name)
43
53
  resolver.smart_proxy_id('option_name' => name)
44
54
  end
55
+
56
+ def self.delete_deprecated_options(command_class)
57
+ %w[--puppetclass-ids --environment-id --config-group-ids].each do |switch|
58
+ family = command_class.option_families.find do |f|
59
+ f.head.switches.include?(switch)
60
+ end
61
+ command_class.declared_options.delete_if do |o|
62
+ family.all.include?(o)
63
+ end
64
+ end
65
+ end
45
66
  end
46
67
  end
47
68
  end
@@ -55,11 +55,16 @@ module HammerCLIForemanPuppet
55
55
  HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new
56
56
  )
57
57
  HammerCLIForeman::Host::CreateCommand.include(HammerCLIForemanPuppet::EnvironmentNameMapping)
58
+ # Delete deprecated options explicitly until they are deleted from API
59
+ HammerCLIForemanPuppet::CommandExtensions::HostPuppetProxy.delete_deprecated_options(HammerCLIForeman::Host::CreateCommand)
58
60
  HammerCLIForeman::Host::CreateCommand.extend_with(
59
61
  HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new,
60
62
  HammerCLIForemanPuppet::CommandExtensions::HostPuppetProxy.new
61
63
  )
64
+
62
65
  HammerCLIForeman::Host::UpdateCommand.include(HammerCLIForemanPuppet::EnvironmentNameMapping)
66
+ # Delete deprecated options explicitly until they are deleted from API
67
+ HammerCLIForemanPuppet::CommandExtensions::HostPuppetProxy.delete_deprecated_options(HammerCLIForeman::Host::UpdateCommand)
63
68
  HammerCLIForeman::Host::UpdateCommand.extend_with(
64
69
  HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new,
65
70
  HammerCLIForemanPuppet::CommandExtensions::HostPuppetProxy.new
@@ -55,11 +55,16 @@ module HammerCLIForemanPuppet
55
55
  HammerCLIForemanPuppet::Hostgroup::PuppetSCParamsCommand
56
56
 
57
57
  HammerCLIForeman::Hostgroup::CreateCommand.include(HammerCLIForemanPuppet::EnvironmentNameMapping)
58
+ # Delete deprecated options explicitly until they are deleted from API
59
+ HammerCLIForemanPuppet::CommandExtensions::HostPuppetProxy.delete_deprecated_options(HammerCLIForeman::Hostgroup::CreateCommand)
58
60
  HammerCLIForeman::Hostgroup::CreateCommand.extend_with(
59
61
  HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new,
60
62
  HammerCLIForemanPuppet::CommandExtensions::HostgroupPuppetProxy.new
61
63
  )
64
+
62
65
  HammerCLIForeman::Hostgroup::UpdateCommand.include(HammerCLIForemanPuppet::EnvironmentNameMapping)
66
+ # Delete deprecated options explicitly until they are deleted from API
67
+ HammerCLIForemanPuppet::CommandExtensions::HostPuppetProxy.delete_deprecated_options(HammerCLIForeman::Hostgroup::UpdateCommand)
63
68
  HammerCLIForeman::Hostgroup::UpdateCommand.extend_with(
64
69
  HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new,
65
70
  HammerCLIForemanPuppet::CommandExtensions::HostgroupPuppetProxy.new
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanPuppet
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.0.5'
3
+ @version ||= Gem::Version.new '0.0.6'
4
4
  end
5
5
  end