hammer_cli_foreman 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of hammer_cli_foreman might be problematic. Click here for more details.

Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +18 -0
  3. data/lib/hammer_cli_foreman.rb +4 -0
  4. data/lib/hammer_cli_foreman/auth_source.rb +10 -0
  5. data/lib/hammer_cli_foreman/auth_source_ldap.rb +70 -0
  6. data/lib/hammer_cli_foreman/commands.rb +47 -3
  7. data/lib/hammer_cli_foreman/credentials.rb +35 -4
  8. data/lib/hammer_cli_foreman/exceptions.rb +10 -1
  9. data/lib/hammer_cli_foreman/external_usergroup.rb +83 -0
  10. data/lib/hammer_cli_foreman/host.rb +26 -22
  11. data/lib/hammer_cli_foreman/hostgroup.rb +12 -5
  12. data/lib/hammer_cli_foreman/i18n.rb +4 -0
  13. data/lib/hammer_cli_foreman/id_resolver.rb +81 -13
  14. data/lib/hammer_cli_foreman/operating_system.rb +5 -44
  15. data/lib/hammer_cli_foreman/option_builders.rb +64 -5
  16. data/lib/hammer_cli_foreman/organization.rb +3 -3
  17. data/lib/hammer_cli_foreman/param_filters.rb +18 -2
  18. data/lib/hammer_cli_foreman/references.rb +9 -1
  19. data/lib/hammer_cli_foreman/role.rb +2 -5
  20. data/lib/hammer_cli_foreman/usergroup.rb +4 -0
  21. data/lib/hammer_cli_foreman/version.rb +1 -1
  22. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  23. data/locale/de/hammer-cli-foreman.po +2169 -0
  24. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  25. data/locale/en/hammer-cli-foreman.po +1 -1
  26. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  27. data/locale/en_GB/hammer-cli-foreman.po +254 -81
  28. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  29. data/locale/es/hammer-cli-foreman.po +268 -94
  30. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  31. data/locale/fr/hammer-cli-foreman.po +258 -84
  32. data/locale/hammer-cli-foreman.pot +428 -321
  33. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  34. data/locale/it/hammer-cli-foreman.po +2168 -0
  35. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  36. data/locale/ja/hammer-cli-foreman.po +2167 -0
  37. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  38. data/locale/ko/hammer-cli-foreman.po +2167 -0
  39. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  40. data/locale/pt_BR/hammer-cli-foreman.po +2167 -0
  41. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  42. data/locale/ru/hammer-cli-foreman.po +2166 -0
  43. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  44. data/locale/zh_CN/hammer-cli-foreman.po +2166 -0
  45. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  46. data/locale/zh_TW/hammer-cli-foreman.po +2166 -0
  47. data/test/unit/auth_source_ldap_test.rb +95 -0
  48. data/test/unit/credentials_test.rb +20 -7
  49. data/test/unit/data/1.6/foreman_api.json +1 -1
  50. data/test/unit/data/1.6/foreman_api_back.json +1 -0
  51. data/test/unit/data/1.6/whatever.json +1 -0
  52. data/test/unit/external_usergroup_test.rb +103 -0
  53. data/test/unit/helpers/command.rb +5 -1
  54. data/test/unit/host_test.rb +4 -4
  55. data/test/unit/hostgroup_test.rb +5 -5
  56. data/test/unit/media_test.rb +2 -2
  57. data/test/unit/operating_system_test.rb +7 -1
  58. data/test/unit/param_filters_test.rb +65 -0
  59. data/test/unit/smart_class_parameter_test.rb +1 -1
  60. metadata +335 -309
  61. data/lib/hammer_cli_foreman/smart_variables.rb +0 -111
@@ -1,111 +0,0 @@
1
- module HammerCLIForeman
2
-
3
- class SmartVariableBriefList < HammerCLIForeman::AssociatedResourceListCommand
4
- resource :smart_variables, :index
5
-
6
- output do
7
- field :id, _("Id")
8
-
9
- field :parameter, _("Parameter")
10
- field :default_value, _("Default Value")
11
- field :override, _("Override")
12
- end
13
-
14
- def send_request
15
- res = super
16
- # FIXME: API returns doubled records, probably just if filtered by puppetclasses
17
- # it seems group by environment is missing
18
- # having the uniq to fix that
19
- HammerCLI::Output::RecordCollection.new(res.uniq, :meta => res.meta)
20
- end
21
-
22
- def self.build_options(options={})
23
- options[:without] ||= [:host_id, :hostgroup_id, :puppetclass_id, :environment_id]
24
- super(options)
25
- end
26
- end
27
-
28
- class SmartVariableList < SmartVariableBriefList
29
-
30
- output do
31
- from :puppetclass do
32
- field :name, _("Puppet class")
33
- field :id, _("Class Id"), Fields::Id
34
- end
35
- end
36
- end
37
-
38
- class SmartVariable < HammerCLIForeman::Command
39
-
40
- resource :smart_variables
41
-
42
- class ListCommand < HammerCLIForeman::ListCommand
43
-
44
- output SmartVariablesList.output_definition
45
-
46
- build_options
47
- end
48
-
49
- class InfoCommand < HammerCLIForeman::InfoCommand
50
-
51
- output ListCommand.output_definition do
52
- field :description, _("Description")
53
- field :parameter_type, _("Type")
54
- field :required, _("Required")
55
-
56
- label _("Validator") do
57
- field :validator_type, _("Type")
58
- field :validator_rule, _("Rule")
59
- end
60
- label _("Override values") do
61
- field :override_value_order, _("Order"), Fields::List
62
- field :override_values_count, _("Count")
63
- collection :override_values, "Values" do
64
- label _("Value") do
65
- field :id, _('Id')
66
- field :match, _('Match')
67
- field :value, _('Value')
68
- end
69
- end
70
- end
71
- HammerCLIForeman::References.environments(self)
72
- HammerCLIForeman::References.timestamps(self)
73
- end
74
-
75
- def extend_data(res)
76
- res['override_value_order'] = res['override_value_order'].split("\n")
77
- res
78
- end
79
-
80
- build_options
81
- end
82
-
83
- class UpdateCommand < HammerCLIForeman::UpdateCommand
84
-
85
- success_message _("Parameter updated")
86
- failure_message _("Could not update the parameter")
87
-
88
- build_options :without => [:parameter_type, :validator_type, :override, :required]
89
-
90
- option "--override", "OVERRIDE", _("Override this parameter."),
91
- :format => HammerCLI::Options::Normalizers::Bool.new
92
- option "--required", "REQUIRED", _("This parameter is required."),
93
- :format => HammerCLI::Options::Normalizers::Bool.new
94
- option "--parameter-type", "PARAMETER_TYPE", _("Type of the parameter."),
95
- :format => HammerCLI::Options::Normalizers::Enum.new(
96
- ['string', 'boolean', 'integer', 'real', 'array', 'hash', 'yaml', 'json'])
97
- option "--validator-type", "VALIDATOR_TYPE", _("Type of the validator."),
98
- :format => HammerCLI::Options::Normalizers::Enum.new(['regexp', 'list', ''])
99
- end
100
-
101
- class AddOverrideValueCommand < HammerCLIForeman::UpdateCommand
102
-
103
- end
104
-
105
- autoload_subcommands
106
-
107
- end
108
-
109
- HammerCLI::MainCommand.subcommand 'smart-variable', _("Manipulate smart variables."), HammerCLIForeman::SmartVariable
110
-
111
- end