hammer_cli_foreman_puppet 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hammer_cli_foreman_puppet/command_extensions/host.rb +21 -0
- data/lib/hammer_cli_foreman_puppet/command_extensions/hostgroup.rb +21 -0
- data/lib/hammer_cli_foreman_puppet/host.rb +5 -0
- data/lib/hammer_cli_foreman_puppet/hostgroup.rb +5 -0
- data/lib/hammer_cli_foreman_puppet/version.rb +1 -1
- data/test/data/3.3/foreman_api.json +1 -0
- data/test/functional/host/create_test.rb +35 -4
- data/test/functional/host/update_test.rb +33 -4
- data/test/functional/hostgroup/create_test.rb +34 -5
- data/test/functional/hostgroup/update_test.rb +33 -4
- data/test/test_helper.rb +1 -1
- data/test/unit/config_group_test.rb +2 -10
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70ea47a81549cde7da9bbdce56937da3c20d4936cc7ebc526cf0d671890e2e80
|
4
|
+
data.tar.gz: 042c018b0757d76f33b5284247a4f84edfceb1d102f48aabd0497399ddc2abb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|