hammer_cli_foreman_puppet 0.0.7 → 0.1.0
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 +4 -4
- data/lib/hammer_cli_foreman_puppet/associating_commands.rb +1 -1
- data/lib/hammer_cli_foreman_puppet/class.rb +1 -3
- data/lib/hammer_cli_foreman_puppet/combination.rb +0 -1
- data/lib/hammer_cli_foreman_puppet/command_extensions/combination.rb +3 -3
- data/lib/hammer_cli_foreman_puppet/commands.rb +3 -2
- data/lib/hammer_cli_foreman_puppet/host.rb +4 -5
- data/lib/hammer_cli_foreman_puppet/hostgroup.rb +7 -8
- data/lib/hammer_cli_foreman_puppet/i18n.rb +2 -2
- data/lib/hammer_cli_foreman_puppet/id_resolver.rb +5 -5
- data/lib/hammer_cli_foreman_puppet/option_sources/puppet_environment_params.rb +1 -2
- data/lib/hammer_cli_foreman_puppet/puppet_references.rb +0 -1
- data/lib/hammer_cli_foreman_puppet/smart_class_parameter.rb +6 -6
- data/lib/hammer_cli_foreman_puppet/smart_proxy.rb +2 -2
- data/lib/hammer_cli_foreman_puppet/version.rb +1 -1
- metadata +8 -65
- data/locale/cs_CZ/hammer-cli-foreman-puppet.edit.po +0 -383
- data/locale/de/hammer-cli-foreman-puppet.edit.po +0 -396
- data/locale/en/hammer-cli-foreman-puppet.edit.po +0 -362
- data/locale/es/hammer-cli-foreman-puppet.edit.po +0 -389
- data/locale/fr/hammer-cli-foreman-puppet.edit.po +0 -387
- data/locale/ja/hammer-cli-foreman-puppet.edit.po +0 -386
- data/locale/ka/hammer-cli-foreman-puppet.edit.po +0 -383
- data/locale/pt_BR/hammer-cli-foreman-puppet.edit.po +0 -389
- data/locale/zh_CN/hammer-cli-foreman-puppet.edit.po +0 -385
- data/test/data/2.1/foreman_api.json +0 -1
- data/test/data/3.0/foreman_api.json +0 -1
- data/test/data/3.3/foreman_api.json +0 -1
- data/test/data/README.md +0 -27
- data/test/functional/config_group_test.rb +0 -28
- data/test/functional/host/create_test.rb +0 -195
- data/test/functional/host/update_test.rb +0 -126
- data/test/functional/hostgroup/create_test.rb +0 -178
- data/test/functional/hostgroup/update_test.rb +0 -126
- data/test/functional/proxy_test.rb +0 -86
- data/test/functional/smart_class_parameter_test.rb +0 -97
- data/test/functional/template_test.rb +0 -38
- data/test/functional/test_helper.rb +0 -7
- data/test/test_helper.rb +0 -29
- data/test/unit/apipie_resource_mock.rb +0 -186
- data/test/unit/config_group_test.rb +0 -73
- data/test/unit/helpers/command.rb +0 -163
- data/test/unit/helpers/fake_searchables.rb +0 -19
- data/test/unit/helpers/resource_disabled.rb +0 -24
- data/test/unit/puppet_class_test.rb +0 -72
- data/test/unit/puppet_environment_test.rb +0 -116
- data/test/unit/smart_class_parameter_test.rb +0 -114
- data/test/unit/test_helper.rb +0 -18
- data/test/unit/test_output_adapter.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a122abe687abc3a97d641fa4569a8e52853a5d4611754a22f31c58f6c3d7444e
|
4
|
+
data.tar.gz: e08b06fbe287e8d49186b4f503d4fddc68e6be5b0b9c9f1056efefeb3f16881d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57f4624e3954f5e65ba7923c3152052dde2c6158a287d723f183bd6bb0c720e156bb9e391bfc7ba0498fb2e7ab7bf555908ff5ff7ccbe504a8ccf0b1396be7a9
|
7
|
+
data.tar.gz: 0e56e3d3762ed0ae6f114361a1c2fcd95b7313dc84e4d9c25c409514c42ab99e171ff3b3a0b3a48a090771b336def4b68b02c23c76c7aeefb11f12f9af5d1b9d
|
@@ -1 +1 @@
|
|
1
|
-
require 'hammer_cli_foreman_puppet/associating_commands/associating_commands'
|
1
|
+
require 'hammer_cli_foreman_puppet/associating_commands/associating_commands'
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module HammerCLIForemanPuppet
|
2
2
|
class PuppetClass < HammerCLIForemanPuppet::Command
|
3
|
-
|
4
3
|
resource :puppetclasses
|
5
4
|
|
6
5
|
class ListCommand < HammerCLIForemanPuppet::ListCommand
|
@@ -14,7 +13,7 @@ module HammerCLIForemanPuppet
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def self.unhash_classes(classes)
|
17
|
-
clss = classes.first.inject([]) { |list, (
|
16
|
+
clss = classes.first.inject([]) { |list, (_pp_module, pp_module_classes)| list + pp_module_classes }
|
18
17
|
|
19
18
|
HammerCLI::Output::RecordCollection.new(clss, :meta => classes.meta)
|
20
19
|
end
|
@@ -39,7 +38,6 @@ module HammerCLIForemanPuppet
|
|
39
38
|
extend_with(HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new)
|
40
39
|
end
|
41
40
|
|
42
|
-
|
43
41
|
class SCParamsCommand < HammerCLIForemanPuppet::SmartClassParametersBriefList
|
44
42
|
build_options_for :puppetclasses
|
45
43
|
|
@@ -7,9 +7,9 @@ module HammerCLIForemanPuppet
|
|
7
7
|
end
|
8
8
|
|
9
9
|
class InfoCombination < HammerCLI::CommandExtensions
|
10
|
-
|
11
|
-
|
12
|
-
end
|
10
|
+
output do |definition|
|
11
|
+
definition.insert(:after, :hostgroup_name, HammerCLIForemanPuppet::Combination::InfoCommand.output_definition.fields)
|
13
12
|
end
|
13
|
+
end
|
14
14
|
end
|
15
15
|
end
|
@@ -15,8 +15,8 @@ module HammerCLIForemanPuppet
|
|
15
15
|
def self.included(base)
|
16
16
|
base.extend(ClassMethods)
|
17
17
|
end
|
18
|
-
module ClassMethods
|
19
18
|
|
19
|
+
module ClassMethods
|
20
20
|
def api_connection
|
21
21
|
if HammerCLI.context[:api_connection]
|
22
22
|
HammerCLI.context[:api_connection].get("foreman")
|
@@ -31,6 +31,7 @@ module HammerCLIForemanPuppet
|
|
31
31
|
HammerCLIForemanPuppet::Searchables.new
|
32
32
|
)
|
33
33
|
end
|
34
|
+
|
34
35
|
def resource_name_mapping
|
35
36
|
HammerCLIForemanPuppet::RESOURCE_NAME_MAPPING.dup
|
36
37
|
end
|
@@ -73,4 +74,4 @@ module HammerCLIForemanPuppet
|
|
73
74
|
class RemoveAssociatedCommand < HammerCLIForeman::RemoveAssociatedCommand
|
74
75
|
include HammerCLIForemanPuppet::ResolverCommons
|
75
76
|
end
|
76
|
-
end
|
77
|
+
end
|
@@ -5,7 +5,6 @@ require 'hammer_cli_foreman_puppet/command_extensions/host'
|
|
5
5
|
|
6
6
|
module HammerCLIForemanPuppet
|
7
7
|
class Host < HammerCLIForemanPuppet::Command
|
8
|
-
|
9
8
|
class PuppetClassesCommand < HammerCLIForemanPuppet::ListCommand
|
10
9
|
include EnvironmentNameMapping
|
11
10
|
command_name "puppet-classes"
|
@@ -44,12 +43,12 @@ module HammerCLIForemanPuppet
|
|
44
43
|
end
|
45
44
|
|
46
45
|
HammerCLIForeman::Host.subcommand 'puppet-classes',
|
47
|
-
|
48
|
-
|
46
|
+
HammerCLIForemanPuppet::Host::PuppetClassesCommand.desc,
|
47
|
+
HammerCLIForemanPuppet::Host::PuppetClassesCommand
|
49
48
|
|
50
49
|
HammerCLIForeman::Host.subcommand 'sc-params',
|
51
|
-
|
52
|
-
|
50
|
+
HammerCLIForemanPuppet::Host::SCParamsCommand.desc,
|
51
|
+
HammerCLIForemanPuppet::Host::SCParamsCommand
|
53
52
|
|
54
53
|
HammerCLIForeman::Host::ListCommand.extend_with(
|
55
54
|
HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new
|
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'hammer_cli_foreman/hostgroup'
|
2
|
-
require 'hammer_cli_foreman_puppet/command_extensions/hostgroup
|
2
|
+
require 'hammer_cli_foreman_puppet/command_extensions/hostgroup'
|
3
3
|
|
4
4
|
module HammerCLIForemanPuppet
|
5
5
|
class Hostgroup < HammerCLIForemanPuppet::Command
|
6
|
-
|
7
6
|
class PuppetClassesCommand < HammerCLIForemanPuppet::ListCommand
|
8
7
|
command_name "puppet-classes"
|
9
8
|
resource :puppetclasses
|
@@ -47,12 +46,12 @@ module HammerCLIForemanPuppet
|
|
47
46
|
end
|
48
47
|
|
49
48
|
HammerCLIForeman::Hostgroup.subcommand 'puppet-classes',
|
50
|
-
|
51
|
-
|
49
|
+
HammerCLIForemanPuppet::Hostgroup::PuppetClassesCommand.desc,
|
50
|
+
HammerCLIForemanPuppet::Hostgroup::PuppetClassesCommand
|
52
51
|
|
53
52
|
HammerCLIForeman::Hostgroup.subcommand 'sc-params',
|
54
|
-
|
55
|
-
|
53
|
+
HammerCLIForemanPuppet::Hostgroup::PuppetSCParamsCommand.desc,
|
54
|
+
HammerCLIForemanPuppet::Hostgroup::PuppetSCParamsCommand
|
56
55
|
|
57
56
|
HammerCLIForeman::Hostgroup::CreateCommand.include(HammerCLIForemanPuppet::EnvironmentNameMapping)
|
58
57
|
# Delete deprecated options explicitly until they are deleted from API
|
@@ -75,6 +74,6 @@ module HammerCLIForemanPuppet
|
|
75
74
|
HammerCLIForeman::Hostgroup::ListCommand.extend_with(
|
76
75
|
HammerCLIForemanPuppet::CommandExtensions::HostgroupList.new
|
77
76
|
)
|
78
|
-
#TODO - adding puppet class options
|
79
|
-
#TODO - resolver
|
77
|
+
# TODO: - adding puppet class options
|
78
|
+
# TODO - resolver
|
80
79
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#frozen_string_literal: true
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'hammer_cli/i18n'
|
4
4
|
module HammerCLIForemanPuppet
|
@@ -23,4 +23,4 @@ module HammerCLIForemanPuppet
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
HammerCLI::I18n.add_domain(HammerCLIForemanPuppet::I18n::LocaleDomain.new)
|
26
|
+
HammerCLI::I18n.add_domain(HammerCLIForemanPuppet::I18n::LocaleDomain.new)
|
@@ -15,7 +15,7 @@ module HammerCLIForemanPuppet
|
|
15
15
|
def puppetclass_ids(options)
|
16
16
|
resource_name = :puppetclasses
|
17
17
|
resource = @api.resource(resource_name)
|
18
|
-
|
18
|
+
if (ids = options[HammerCLI.option_accessor_name("ids")])
|
19
19
|
ids
|
20
20
|
elsif (ids = nil_from_searchables(resource_name, options, :plural => true))
|
21
21
|
ids
|
@@ -29,7 +29,7 @@ module HammerCLIForemanPuppet
|
|
29
29
|
resolved_call(resource_name, :index, options, :multi)
|
30
30
|
)
|
31
31
|
raise HammerCLIForeman::ResolverError.new(_("one of %s not found.") % resource.name, resource) if results.count < expected_record_count(options, resource, :multi)
|
32
|
-
|
32
|
+
results.map { |r| r['id'] }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -66,10 +66,10 @@ module HammerCLIForemanPuppet
|
|
66
66
|
|
67
67
|
class Searchables < HammerCLIForeman::Searchables
|
68
68
|
SEARCHABLES = {
|
69
|
-
:environment =>
|
69
|
+
:environment => [s_name(_('Puppet environment name'))],
|
70
70
|
:puppet_environment => [s_name(_('Puppet environment name'))],
|
71
|
-
:puppetclass =>
|
72
|
-
:smart_class_parameter => [
|
71
|
+
:puppetclass => [s_name(_("Puppet class name"))],
|
72
|
+
:smart_class_parameter => [s_name(_("Smart class parameter name"), :editable => false)]
|
73
73
|
}.freeze
|
74
74
|
|
75
75
|
DEFAULT_SEARCHABLES = [s_name(_("Name to search by"))].freeze
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module HammerCLIForemanPuppet
|
2
|
-
|
3
2
|
class SmartClassParametersBriefList < HammerCLIForemanPuppet::ListCommand
|
4
3
|
resource :smart_class_parameters, :index
|
5
4
|
command_name 'sc-params'
|
@@ -110,14 +109,15 @@ module HammerCLIForemanPuppet
|
|
110
109
|
end
|
111
110
|
|
112
111
|
option "--override", "OVERRIDE", _("Override this parameter"),
|
113
|
-
|
112
|
+
:format => HammerCLI::Options::Normalizers::Bool.new
|
114
113
|
option "--required", "REQUIRED", _("This parameter is required"),
|
115
|
-
|
114
|
+
:format => HammerCLI::Options::Normalizers::Bool.new
|
116
115
|
option "--parameter-type", "PARAMETER_TYPE", _("Type of the parameter"),
|
117
|
-
|
118
|
-
|
116
|
+
:format => HammerCLI::Options::Normalizers::Enum.new(
|
117
|
+
%w[string boolean integer real array hash yaml json]
|
118
|
+
)
|
119
119
|
option "--validator-type", "VALIDATOR_TYPE", _("Type of the validator"),
|
120
|
-
|
120
|
+
:format => HammerCLI::Options::Normalizers::Enum.new(['regexp', 'list', ''])
|
121
121
|
option "--override-value-order", "OVERRIDE_VALUE_ORDER", _("The order in which values are resolved"),
|
122
122
|
:format => HammerCLI::Options::Normalizers::List.new
|
123
123
|
|
@@ -53,6 +53,6 @@ module HammerCLIForemanPuppet
|
|
53
53
|
extend_with(HammerCLIForemanPuppet::CommandExtensions::PuppetEnvironment.new)
|
54
54
|
end
|
55
55
|
HammerCLIForeman::SmartProxy.subcommand 'import-classes',
|
56
|
-
|
57
|
-
|
56
|
+
HammerCLIForemanPuppet::ImportPuppetClassesCommand.desc,
|
57
|
+
HammerCLIForemanPuppet::ImportPuppetClassesCommand
|
58
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli_foreman_puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amir Fefer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hammer_cli_foreman
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 4.0.0
|
33
|
-
description:
|
33
|
+
description:
|
34
34
|
email:
|
35
35
|
- amirfefer@gmail.com
|
36
36
|
executables: []
|
@@ -69,62 +69,29 @@ files:
|
|
69
69
|
- lib/hammer_cli_foreman_puppet/smart_proxy.rb
|
70
70
|
- lib/hammer_cli_foreman_puppet/version.rb
|
71
71
|
- locale/cs_CZ/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
72
|
-
- locale/cs_CZ/hammer-cli-foreman-puppet.edit.po
|
73
72
|
- locale/cs_CZ/hammer-cli-foreman-puppet.po
|
74
73
|
- locale/de/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
75
|
-
- locale/de/hammer-cli-foreman-puppet.edit.po
|
76
74
|
- locale/de/hammer-cli-foreman-puppet.po
|
77
75
|
- locale/en/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
78
|
-
- locale/en/hammer-cli-foreman-puppet.edit.po
|
79
76
|
- locale/en/hammer-cli-foreman-puppet.po
|
80
77
|
- locale/es/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
81
|
-
- locale/es/hammer-cli-foreman-puppet.edit.po
|
82
78
|
- locale/es/hammer-cli-foreman-puppet.po
|
83
79
|
- locale/fr/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
84
|
-
- locale/fr/hammer-cli-foreman-puppet.edit.po
|
85
80
|
- locale/fr/hammer-cli-foreman-puppet.po
|
86
81
|
- locale/hammer-cli-foreman-puppet.pot
|
87
82
|
- locale/ja/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
88
|
-
- locale/ja/hammer-cli-foreman-puppet.edit.po
|
89
83
|
- locale/ja/hammer-cli-foreman-puppet.po
|
90
84
|
- locale/ka/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
91
|
-
- locale/ka/hammer-cli-foreman-puppet.edit.po
|
92
85
|
- locale/ka/hammer-cli-foreman-puppet.po
|
93
86
|
- locale/pt_BR/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
94
|
-
- locale/pt_BR/hammer-cli-foreman-puppet.edit.po
|
95
87
|
- locale/pt_BR/hammer-cli-foreman-puppet.po
|
96
88
|
- locale/zh_CN/LC_MESSAGES/hammer-cli-foreman-puppet.mo
|
97
|
-
- locale/zh_CN/hammer-cli-foreman-puppet.edit.po
|
98
89
|
- locale/zh_CN/hammer-cli-foreman-puppet.po
|
99
|
-
- test/data/2.1/foreman_api.json
|
100
|
-
- test/data/3.0/foreman_api.json
|
101
|
-
- test/data/3.3/foreman_api.json
|
102
|
-
- test/data/README.md
|
103
|
-
- test/functional/config_group_test.rb
|
104
|
-
- test/functional/host/create_test.rb
|
105
|
-
- test/functional/host/update_test.rb
|
106
|
-
- test/functional/hostgroup/create_test.rb
|
107
|
-
- test/functional/hostgroup/update_test.rb
|
108
|
-
- test/functional/proxy_test.rb
|
109
|
-
- test/functional/smart_class_parameter_test.rb
|
110
|
-
- test/functional/template_test.rb
|
111
|
-
- test/functional/test_helper.rb
|
112
|
-
- test/test_helper.rb
|
113
|
-
- test/unit/apipie_resource_mock.rb
|
114
|
-
- test/unit/config_group_test.rb
|
115
|
-
- test/unit/helpers/command.rb
|
116
|
-
- test/unit/helpers/fake_searchables.rb
|
117
|
-
- test/unit/helpers/resource_disabled.rb
|
118
|
-
- test/unit/puppet_class_test.rb
|
119
|
-
- test/unit/puppet_environment_test.rb
|
120
|
-
- test/unit/smart_class_parameter_test.rb
|
121
|
-
- test/unit/test_helper.rb
|
122
|
-
- test/unit/test_output_adapter.rb
|
123
90
|
homepage: https://github.com/theforeman/hammer-cli-foreman-puppet
|
124
91
|
licenses:
|
125
92
|
- GPL-3.0
|
126
93
|
metadata: {}
|
127
|
-
post_install_message:
|
94
|
+
post_install_message:
|
128
95
|
rdoc_options: []
|
129
96
|
require_paths:
|
130
97
|
- lib
|
@@ -142,32 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
109
|
- !ruby/object:Gem::Version
|
143
110
|
version: '0'
|
144
111
|
requirements: []
|
145
|
-
rubygems_version: 3.
|
146
|
-
signing_key:
|
112
|
+
rubygems_version: 3.1.6
|
113
|
+
signing_key:
|
147
114
|
specification_version: 4
|
148
115
|
summary: Foreman Puppet plugin for Hammer CLI
|
149
|
-
test_files:
|
150
|
-
- test/data/2.1/foreman_api.json
|
151
|
-
- test/data/3.0/foreman_api.json
|
152
|
-
- test/data/3.3/foreman_api.json
|
153
|
-
- test/data/README.md
|
154
|
-
- test/functional/config_group_test.rb
|
155
|
-
- test/functional/host/create_test.rb
|
156
|
-
- test/functional/host/update_test.rb
|
157
|
-
- test/functional/hostgroup/create_test.rb
|
158
|
-
- test/functional/hostgroup/update_test.rb
|
159
|
-
- test/functional/proxy_test.rb
|
160
|
-
- test/functional/smart_class_parameter_test.rb
|
161
|
-
- test/functional/template_test.rb
|
162
|
-
- test/functional/test_helper.rb
|
163
|
-
- test/test_helper.rb
|
164
|
-
- test/unit/apipie_resource_mock.rb
|
165
|
-
- test/unit/config_group_test.rb
|
166
|
-
- test/unit/helpers/command.rb
|
167
|
-
- test/unit/helpers/fake_searchables.rb
|
168
|
-
- test/unit/helpers/resource_disabled.rb
|
169
|
-
- test/unit/puppet_class_test.rb
|
170
|
-
- test/unit/puppet_environment_test.rb
|
171
|
-
- test/unit/smart_class_parameter_test.rb
|
172
|
-
- test/unit/test_helper.rb
|
173
|
-
- test/unit/test_output_adapter.rb
|
116
|
+
test_files: []
|