hammer_cli_katello 1.9.1 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_katello/acs.rb +7 -0
  3. data/lib/hammer_cli_katello/acs_bulk_actions.rb +38 -0
  4. data/lib/hammer_cli_katello/content_view_version.rb +21 -0
  5. data/lib/hammer_cli_katello/host_collection.rb +0 -15
  6. data/lib/hammer_cli_katello/host_collection_erratum.rb +8 -24
  7. data/lib/hammer_cli_katello/host_collection_package.rb +20 -57
  8. data/lib/hammer_cli_katello/host_collection_package_group.rb +20 -57
  9. data/lib/hammer_cli_katello/host_errata.rb +4 -12
  10. data/lib/hammer_cli_katello/host_package.rb +18 -59
  11. data/lib/hammer_cli_katello/host_package_group.rb +8 -33
  12. data/lib/hammer_cli_katello/unsupported_katello_agent_command_helper.rb +25 -0
  13. data/lib/hammer_cli_katello/version.rb +1 -1
  14. data/lib/hammer_cli_katello.rb +1 -1
  15. data/locale/bn/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  16. data/locale/bn/hammer-cli-katello.edit.po +3255 -0
  17. data/locale/bn/hammer-cli-katello.po +643 -221
  18. data/locale/bn_IN/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  19. data/locale/bn_IN/hammer-cli-katello.edit.po +3255 -0
  20. data/locale/bn_IN/hammer-cli-katello.po +645 -223
  21. data/locale/bqi/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  22. data/locale/bqi/hammer-cli-katello.edit.po +3251 -0
  23. data/locale/ca/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  24. data/locale/ca/hammer-cli-katello.edit.po +3255 -0
  25. data/locale/ca/hammer-cli-katello.po +651 -229
  26. data/locale/cs_CZ/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  27. data/locale/cs_CZ/hammer-cli-katello.edit.po +3256 -0
  28. data/locale/cs_CZ/hammer-cli-katello.po +676 -254
  29. data/locale/de/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  30. data/locale/de/hammer-cli-katello.edit.po +3329 -0
  31. data/locale/de/hammer-cli-katello.po +1017 -761
  32. data/locale/de_AT/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  33. data/locale/de_AT/hammer-cli-katello.edit.po +3251 -0
  34. data/locale/de_AT/hammer-cli-katello.po +643 -221
  35. data/locale/de_DE/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  36. data/locale/de_DE/hammer-cli-katello.edit.po +3257 -0
  37. data/locale/de_DE/hammer-cli-katello.po +643 -221
  38. data/locale/el/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  39. data/locale/el/hammer-cli-katello.edit.po +3255 -0
  40. data/locale/el/hammer-cli-katello.po +664 -242
  41. data/locale/en/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  42. data/locale/en/hammer-cli-katello.po +645 -222
  43. data/locale/en_GB/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  44. data/locale/en_GB/hammer-cli-katello.edit.po +3256 -0
  45. data/locale/en_GB/hammer-cli-katello.po +647 -225
  46. data/locale/en_US/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  47. data/locale/en_US/hammer-cli-katello.edit.po +3251 -0
  48. data/locale/en_US/hammer-cli-katello.po +643 -221
  49. data/locale/es/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  50. data/locale/es/hammer-cli-katello.edit.po +3322 -0
  51. data/locale/es/hammer-cli-katello.po +1040 -956
  52. data/locale/et_EE/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  53. data/locale/et_EE/hammer-cli-katello.edit.po +3251 -0
  54. data/locale/et_EE/hammer-cli-katello.po +643 -221
  55. data/locale/fr/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  56. data/locale/fr/hammer-cli-katello.edit.po +3347 -0
  57. data/locale/fr/hammer-cli-katello.po +1062 -971
  58. data/locale/gl/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  59. data/locale/gl/hammer-cli-katello.edit.po +3255 -0
  60. data/locale/gl/hammer-cli-katello.po +643 -221
  61. data/locale/gu/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  62. data/locale/gu/hammer-cli-katello.edit.po +3255 -0
  63. data/locale/gu/hammer-cli-katello.po +645 -223
  64. data/locale/hammer-cli-katello.pot +1630 -992
  65. data/locale/he_IL/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  66. data/locale/he_IL/hammer-cli-katello.edit.po +3255 -0
  67. data/locale/he_IL/hammer-cli-katello.po +643 -221
  68. data/locale/hi/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  69. data/locale/hi/hammer-cli-katello.edit.po +3255 -0
  70. data/locale/hi/hammer-cli-katello.po +645 -223
  71. data/locale/id/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  72. data/locale/id/hammer-cli-katello.edit.po +3251 -0
  73. data/locale/id/hammer-cli-katello.po +643 -221
  74. data/locale/it/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  75. data/locale/it/hammer-cli-katello.edit.po +3261 -0
  76. data/locale/it/hammer-cli-katello.po +901 -872
  77. data/locale/ja/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  78. data/locale/ja/hammer-cli-katello.edit.po +3273 -0
  79. data/locale/ja/hammer-cli-katello.po +1008 -982
  80. data/locale/ka/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  81. data/locale/ka/hammer-cli-katello.edit.po +3351 -0
  82. data/locale/ka/hammer-cli-katello.po +700 -287
  83. data/locale/kn/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  84. data/locale/kn/hammer-cli-katello.edit.po +3255 -0
  85. data/locale/kn/hammer-cli-katello.po +645 -223
  86. data/locale/ko/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  87. data/locale/ko/hammer-cli-katello.edit.po +3258 -0
  88. data/locale/ko/hammer-cli-katello.po +907 -874
  89. data/locale/ml_IN/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  90. data/locale/ml_IN/hammer-cli-katello.edit.po +3251 -0
  91. data/locale/ml_IN/hammer-cli-katello.po +643 -221
  92. data/locale/mr/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  93. data/locale/mr/hammer-cli-katello.edit.po +3255 -0
  94. data/locale/mr/hammer-cli-katello.po +645 -223
  95. data/locale/nl_NL/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  96. data/locale/nl_NL/hammer-cli-katello.edit.po +3259 -0
  97. data/locale/nl_NL/hammer-cli-katello.po +648 -224
  98. data/locale/or/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  99. data/locale/or/hammer-cli-katello.edit.po +3255 -0
  100. data/locale/or/hammer-cli-katello.po +645 -223
  101. data/locale/pa/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  102. data/locale/pa/hammer-cli-katello.edit.po +3255 -0
  103. data/locale/pa/hammer-cli-katello.po +645 -223
  104. data/locale/pl/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  105. data/locale/pl/hammer-cli-katello.edit.po +3256 -0
  106. data/locale/pl/hammer-cli-katello.po +647 -225
  107. data/locale/pl_PL/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  108. data/locale/pl_PL/hammer-cli-katello.edit.po +3251 -0
  109. data/locale/pl_PL/hammer-cli-katello.po +643 -221
  110. data/locale/pt/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  111. data/locale/pt/hammer-cli-katello.edit.po +3255 -0
  112. data/locale/pt/hammer-cli-katello.po +643 -221
  113. data/locale/pt_BR/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  114. data/locale/pt_BR/hammer-cli-katello.edit.po +3314 -0
  115. data/locale/pt_BR/hammer-cli-katello.po +1042 -977
  116. data/locale/ro/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  117. data/locale/ro/hammer-cli-katello.edit.po +3251 -0
  118. data/locale/ro/hammer-cli-katello.po +643 -221
  119. data/locale/ro_RO/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  120. data/locale/ro_RO/hammer-cli-katello.edit.po +3251 -0
  121. data/locale/ro_RO/hammer-cli-katello.po +643 -221
  122. data/locale/ru/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  123. data/locale/ru/hammer-cli-katello.edit.po +3260 -0
  124. data/locale/ru/hammer-cli-katello.po +936 -909
  125. data/locale/sl/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  126. data/locale/sl/hammer-cli-katello.edit.po +3255 -0
  127. data/locale/sl/hammer-cli-katello.po +645 -223
  128. data/locale/sv_SE/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  129. data/locale/sv_SE/hammer-cli-katello.edit.po +3256 -0
  130. data/locale/sv_SE/hammer-cli-katello.po +645 -223
  131. data/locale/ta/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  132. data/locale/ta/hammer-cli-katello.edit.po +3255 -0
  133. data/locale/ta/hammer-cli-katello.po +643 -221
  134. data/locale/ta_IN/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  135. data/locale/ta_IN/hammer-cli-katello.edit.po +3255 -0
  136. data/locale/ta_IN/hammer-cli-katello.po +644 -222
  137. data/locale/te/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  138. data/locale/te/hammer-cli-katello.edit.po +3255 -0
  139. data/locale/te/hammer-cli-katello.po +645 -223
  140. data/locale/tr/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  141. data/locale/tr/hammer-cli-katello.edit.po +3255 -0
  142. data/locale/tr/hammer-cli-katello.po +643 -221
  143. data/locale/vi/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  144. data/locale/vi/hammer-cli-katello.edit.po +3251 -0
  145. data/locale/vi/hammer-cli-katello.po +643 -221
  146. data/locale/vi_VN/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  147. data/locale/vi_VN/hammer-cli-katello.edit.po +3251 -0
  148. data/locale/vi_VN/hammer-cli-katello.po +643 -221
  149. data/locale/zh/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  150. data/locale/zh/hammer-cli-katello.edit.po +3251 -0
  151. data/locale/zh/hammer-cli-katello.po +643 -221
  152. data/locale/zh_CN/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  153. data/locale/zh_CN/hammer-cli-katello.edit.po +3268 -0
  154. data/locale/zh_CN/hammer-cli-katello.po +1069 -1018
  155. data/locale/zh_TW/LC_MESSAGES/hammer-cli-katello.mo +0 -0
  156. data/locale/zh_TW/hammer-cli-katello.edit.po +3257 -0
  157. data/locale/zh_TW/hammer-cli-katello.po +721 -665
  158. data/test/data/4.10/foreman_api.json +1 -0
  159. data/test/functional/host/errata/apply_test.rb +7 -37
  160. data/test/functional/host_collection/content_install_test.rb +14 -55
  161. data/test/functional/host_collection/content_remove_test.rb +13 -30
  162. data/test/functional/host_collection/content_update_test.rb +13 -30
  163. data/test/test_helper.rb +1 -1
  164. metadata +54 -4
  165. data/test/functional/host_collection/content_api_expectations.rb +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 363b7920a9305cdc96148bbe0a42d49f9ef914238790d5ea7446039baf42618c
4
- data.tar.gz: a3b4888b67aff36d4d223ac10869526735ec9c24f2b0d4e0bff4daa4ac9fd763
3
+ metadata.gz: f66bd7ae12181e8cd2afcacc8f4075041ce8c3e1eb54143c2aa101ab05c1d382
4
+ data.tar.gz: ff5f5beec4477a942ae4f9c6e57fd9093af0521796b1c01263cfbb88b320a192
5
5
  SHA512:
6
- metadata.gz: 0fbe9e51037901d0661b7ad66243a4a7da36a80ad50651764b8071bb1d80e2547a015fa8aade10c8ebf988aac3d2a35c0c4bd0d3e0e0b97ad511d8eb478062c8
7
- data.tar.gz: 4b05e67e84128edc8bb99637308139c9dc0cddc8af56ae645c15168830b14267d8ad403402efa8ac5b8beabbf95157f4bddaba987581578c89848bdbabb4600e
6
+ metadata.gz: 4ec444e6f8e7673f60223a2c1c65296d7d3b66fa55df4a5eab8718e52be1989db8645e180a4bd95b61780c0850027f027acfdc5d15d7f7afb659dfc2611c040b
7
+ data.tar.gz: 68caae7795b8cc7d23aff003847ad0e62f0b798d35b819bd3bc5cde27a2963143515771755c92758d5fea9184ada8ca5bbe127e2764b92c89254ed32fb24a8d6
@@ -1,3 +1,5 @@
1
+ require 'hammer_cli_katello/acs_bulk_actions'
2
+
1
3
  module HammerCLIKatello
2
4
  class AcsCommand < HammerCLIKatello::Command
3
5
  resource :alternate_content_sources
@@ -95,6 +97,11 @@ module HammerCLIKatello
95
97
 
96
98
  build_options
97
99
  end
100
+
98
101
  autoload_subcommands
102
+
103
+ self.subcommand "bulk",
104
+ HammerCLIKatello::AcsBulkActionsCommand.desc,
105
+ HammerCLIKatello::AcsBulkActionsCommand
99
106
  end
100
107
  end
@@ -0,0 +1,38 @@
1
+ module HammerCLIKatello
2
+ class AcsBulkActionsCommand < HammerCLIKatello::Command
3
+ desc 'Modify alternate content sources in bulk'
4
+ resource :alternate_content_sources_bulk_actions
5
+
6
+ class RefreshAllCommand < HammerCLIKatello::SingleResourceCommand
7
+ action :refresh_all_alternate_content_sources
8
+ command_name 'refresh-all'
9
+ desc _("Refresh all alternate content sources")
10
+ success_message _("Successfully refreshed all alternate content sources")
11
+ failure_message _("Could not refresh all alternate content sources")
12
+
13
+ build_options
14
+ end
15
+
16
+ class RefreshCommand < HammerCLIKatello::SingleResourceCommand
17
+ action :refresh_alternate_content_sources
18
+ command_name 'refresh'
19
+ desc _("Refresh alternate content sources")
20
+ success_message _("Successfully refreshed specified alternate content sources")
21
+ failure_message _("Could not refresh the specified alternate content sources")
22
+
23
+ build_options
24
+ end
25
+
26
+ class DestroyCommand < HammerCLIKatello::SingleResourceCommand
27
+ action :destroy_alternate_content_sources
28
+ command_name 'destroy'
29
+ desc _("Destroy alternate content sources")
30
+ success_message _("Sucessfully destroyed specified alternate content sources")
31
+ failure_message _("Could not destroy the specified alternate content sources")
32
+
33
+ build_options
34
+ end
35
+
36
+ autoload_subcommands
37
+ end
38
+ end
@@ -62,6 +62,27 @@ module HammerCLIKatello
62
62
  from :filter do
63
63
  field :id, _("Id")
64
64
  field :name, _("Name")
65
+ field :content, _('Type')
66
+ field :inclusion, _('Inclusion'), Fields::Boolean
67
+ field :original_packages, _('Original packages'), Fields::Boolean, hide_blank: true
68
+ # rubocop:disable Layout/LineLength
69
+ field :original_module_streams, _('Original module streams'), Fields::Boolean, hide_blank: true
70
+ # rubocop:enable Layout/LineLength
71
+ end
72
+ collection :rules, _("Rules"), hide_blank: true, hide_empty: true do
73
+ field :id, _('Id')
74
+ field :name, _('Name'), Fields::Field, hide_blank: true
75
+ field :uuid, _('UUID'), Fields::Field, hide_blank: true
76
+ field :module_stream_id, _('Module stream Id'), Fields::Field, hide_blank: true
77
+ collection :types, _('Types'), hide_blank: true, hide_empty: true do
78
+ field nil, _('')
79
+ end
80
+ field :architecture, _('Architecture'), Fields::Field, :hide_blank => true
81
+ field :content_view_filter_id, _('Content view filter Id')
82
+ field :errata_id, _('Errata Id'), Fields::Field, :hide_blank => true
83
+ field :date_type, _('Date type'), Fields::Field, :hide_blank => true
84
+ field :start_date, _('Start date'), Fields::Field, :hide_blank => true
85
+ field :end_date, _('End date'), Fields::Field, :hide_blank => true
65
86
  end
66
87
  end
67
88
  field :dependency_solving, _("Dependency Solving"), Fields::Field, :hide_blank => true
@@ -220,21 +220,6 @@ module HammerCLIKatello
220
220
  end
221
221
  end
222
222
 
223
- class InstallContentBaseCommand < ContentBaseCommand
224
- action :install_content
225
- command_name "install"
226
- end
227
-
228
- class UpdateContentBaseCommand < ContentBaseCommand
229
- action :update_content
230
- command_name "update"
231
- end
232
-
233
- class RemoveContentBaseCommand < ContentBaseCommand
234
- action :remove_content
235
- command_name "remove"
236
- end
237
-
238
223
  require 'hammer_cli_katello/host_collection_package'
239
224
  subcommand HammerCLIKatello::HostCollectionPackageCommand.command_name,
240
225
  HammerCLIKatello::HostCollectionPackageCommand.desc,
@@ -1,33 +1,17 @@
1
1
  module HammerCLIKatello
2
2
  class HostCollectionErratumCommand < HammerCLIKatello::Command
3
3
  command_name "erratum"
4
- desc _("Manipulate errata for a host collection")
4
+ desc "Manage errata on your host collections. "\
5
+ "These commands are no longer available. "\
6
+ "Use the remote execution equivalent"
5
7
 
6
- class InstallCommand < HammerCLIKatello::HostCollection::InstallContentBaseCommand
7
- desc _("Install errata on content hosts contained within a host collection")
8
- success_message _("Successfully scheduled installation of errata.")
9
- failure_message _("Could not schedule installation of errata")
10
-
11
- option('--errata',
12
- 'ERRATA',
13
- _("List of Errata to install"),
14
- :required => true,
15
- :format => HammerCLI::Options::Normalizers::List.new,
16
- :attribute_name => :content)
17
-
18
- def execute
19
- warn "This command uses katello agent and will be removed in favor of remote execution " \
20
- "in a future release."
21
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
22
- "katello_errata_install`. Specify the host collection with the --search-query " \
23
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
24
- "`--search-query \"host_collection_id=6\"`."
25
- super
8
+ class InstallCommand < HammerCLIKatello::Command
9
+ command_name "install"
10
+ def self.rex_feature
11
+ "katello_errata_install"
26
12
  end
27
13
 
28
- def content_type
29
- 'errata'
30
- end
14
+ include UnsupportedKatelloAgentCommandHelper
31
15
  end
32
16
 
33
17
  autoload_subcommands
@@ -1,72 +1,35 @@
1
1
  module HammerCLIKatello
2
2
  class HostCollectionPackageCommand < HammerCLIKatello::Command
3
3
  command_name "package"
4
- desc _("Manipulate packages for a host collection")
5
-
6
- module PackageContentType
7
- def self.included(base)
8
- base.option('--packages',
9
- 'PACKAGES',
10
- _("comma-separated list of packages to install"),
11
- :required => true,
12
- :format => HammerCLI::Options::Normalizers::List.new,
13
- :attribute_name => :content)
4
+ desc "Manage packages on your host collections. "\
5
+ "These commands are no longer available. "\
6
+ "Use the remote execution equivalent"
7
+
8
+ class InstallCommand < HammerCLIKatello::Command
9
+ command_name "install"
10
+ def self.rex_feature
11
+ "katello_package_install"
14
12
  end
15
13
 
16
- def content_type
17
- 'package'
18
- end
14
+ include UnsupportedKatelloAgentCommandHelper
19
15
  end
20
16
 
21
- class InstallCommand < HammerCLIKatello::HostCollection::InstallContentBaseCommand
22
- include PackageContentType
23
- desc _("Install packages on content hosts contained within a host collection")
24
- success_message _("Successfully scheduled installation of package(s).")
25
- failure_message _("Could not schedule installation of package(s)")
26
-
27
- def execute
28
- warn "This command uses katello agent and will be removed in favor of remote execution " \
29
- "in a future release."
30
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
31
- "katello_package_install`. Specify the host collection with the --search-query " \
32
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
33
- "`--search-query \"host_collection_id=6\"`."
34
- super
17
+ class UpdateCommand < HammerCLIKatello::Command
18
+ command_name "update"
19
+ def self.rex_feature
20
+ "katello_package_update"
35
21
  end
36
- end
37
22
 
38
- class UpdateCommand < HammerCLIKatello::HostCollection::UpdateContentBaseCommand
39
- include PackageContentType
40
- desc _("Update packages on content hosts contained within a host collection")
41
- success_message _("Successfully scheduled update of package(s).")
42
- failure_message _("Could not schedule update of package(s)")
43
-
44
- def execute
45
- warn "This command uses katello agent and will be removed in favor of remote execution " \
46
- "in a future release."
47
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
48
- "katello_package_update`. Specify the host collection with the --search-query " \
49
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
50
- "`--search-query \"host_collection_id=6\"`."
51
- super
52
- end
23
+ include UnsupportedKatelloAgentCommandHelper
53
24
  end
54
25
 
55
- class RemoveCommand < HammerCLIKatello::HostCollection::RemoveContentBaseCommand
56
- include PackageContentType
57
- desc _("Remove packages on content hosts contained within a host collection")
58
- success_message _("Successfully scheduled removal of package(s).")
59
- failure_message _("Could not schedule removal of package(s)")
60
-
61
- def execute
62
- warn "This command uses katello agent and will be removed in favor of remote execution " \
63
- "in a future release."
64
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
65
- "katello_package_remove`. Specify the host collection with the --search-query " \
66
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
67
- "`--search-query \"host_collection_id=6\"`."
68
- super
26
+ class RemoveCommand < HammerCLIKatello::Command
27
+ command_name "remove"
28
+ def self.rex_feature
29
+ "katello_package_remove"
69
30
  end
31
+
32
+ include UnsupportedKatelloAgentCommandHelper
70
33
  end
71
34
 
72
35
  autoload_subcommands
@@ -1,72 +1,35 @@
1
1
  module HammerCLIKatello
2
2
  class HostCollectionPackageGroupCommand < HammerCLIKatello::Command
3
3
  command_name "package-group"
4
- desc _("Manipulate package-groups for a host collection")
5
-
6
- module PackageGroupContentType
7
- def self.included(base)
8
- base.option('--package-groups',
9
- 'PACKAGE-GROUPS',
10
- _("comma-separated list of package-groups to install"),
11
- :required => true,
12
- :format => HammerCLI::Options::Normalizers::List.new,
13
- :attribute_name => :content)
4
+ desc "Manage package-groups on your host collections. "\
5
+ "These commands are no longer available. "\
6
+ "Use the remote execution equivalent"
7
+
8
+ class InstallCommand < HammerCLIKatello::Command
9
+ command_name "install"
10
+ def self.rex_feature
11
+ "katello_group_install"
14
12
  end
15
13
 
16
- def content_type
17
- 'package_group'
18
- end
14
+ include UnsupportedKatelloAgentCommandHelper
19
15
  end
20
16
 
21
- class InstallCommand < HammerCLIKatello::HostCollection::InstallContentBaseCommand
22
- include PackageGroupContentType
23
- desc _("Install package-groups on content hosts contained within a host collection")
24
- success_message _("Successfully scheduled installation of package-group(s).")
25
- failure_message _("Could not schedule installation of package-group(s)")
26
-
27
- def execute
28
- warn "This command uses katello agent and will be removed in favor of remote execution " \
29
- "in a future release."
30
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
31
- "katello_group_install`. Specify the host collection with the --search-query " \
32
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
33
- "`--search-query \"host_collection_id=6\"`."
34
- super
17
+ class UpdateCommand < HammerCLIKatello::Command
18
+ command_name "update"
19
+ def self.rex_feature
20
+ "katello_group_update"
35
21
  end
36
- end
37
22
 
38
- class UpdateCommand < HammerCLIKatello::HostCollection::UpdateContentBaseCommand
39
- include PackageGroupContentType
40
- desc _("Update package-groups on content hosts contained within a host collection")
41
- success_message _("Successfully scheduled update of package-groups(s).")
42
- failure_message _("Could not schedule update of package-group(s)")
43
-
44
- def execute
45
- warn "This command uses katello agent and will be removed in favor of remote execution " \
46
- "in a future release."
47
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
48
- "katello_group_update`. Specify the host collection with the --search-query " \
49
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
50
- "`--search-query \"host_collection_id=6\"`."
51
- super
52
- end
23
+ include UnsupportedKatelloAgentCommandHelper
53
24
  end
54
25
 
55
- class RemoveCommand < HammerCLIKatello::HostCollection::RemoveContentBaseCommand
56
- include PackageGroupContentType
57
- desc _("Remove package-groups on content hosts contained within a host collection")
58
- success_message _("Successfully scheduled removal of package-groups(s).")
59
- failure_message _("Could not schedule removal of package-group(s)")
60
-
61
- def execute
62
- warn "This command uses katello agent and will be removed in favor of remote execution " \
63
- "in a future release."
64
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
65
- "katello_group_remove`. Specify the host collection with the --search-query " \
66
- "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
67
- "`--search-query \"host_collection_id=6\"`."
68
- super
26
+ class RemoveCommand < HammerCLIKatello::Command
27
+ command_name "remove"
28
+ def self.rex_feature
29
+ "katello_group_remove"
69
30
  end
31
+
32
+ include UnsupportedKatelloAgentCommandHelper
70
33
  end
71
34
 
72
35
  autoload_subcommands
@@ -5,21 +5,13 @@ module HammerCLIKatello
5
5
  desc "Manage errata on your hosts"
6
6
 
7
7
  class ApplyCommand < HammerCLIKatello::SingleResourceCommand
8
- include HammerCLIForemanTasks::Async
9
- resource :host_errata, :apply
10
8
  command_name "apply"
11
- success_message _("Errata is being applied with task %{id}.")
12
- failure_message _("Could not apply errata")
13
9
 
14
- build_options(without: ['ids'])
15
-
16
- def execute
17
- warn "This command uses katello agent and will be removed in favor of remote execution " \
18
- "in a future release."
19
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
20
- "katello_errata_install`."
21
- super
10
+ def self.rex_feature
11
+ "katello_errata_install"
22
12
  end
13
+
14
+ include UnsupportedKatelloAgentCommandHelper
23
15
  end
24
16
 
25
17
  class ListCommand < HammerCLIKatello::ListCommand
@@ -12,84 +12,43 @@ module HammerCLIKatello
12
12
  build_options
13
13
  end
14
14
 
15
- class InstallCommand < HammerCLIKatello::SingleResourceCommand
16
- include HammerCLIForemanTasks::Async
17
- resource :host_packages, :install
15
+ class InstallCommand < HammerCLIKatello::Command
18
16
  command_name "install"
19
- success_message "Packages install successfully."
20
- failure_message "Could not install packages"
21
17
 
22
- validate_options do
23
- option(:option_packages).required
18
+ def self.rex_feature
19
+ "katello_package_install"
24
20
  end
25
21
 
26
- build_options :without => [:groups]
27
-
28
- def execute
29
- warn "This command uses katello agent and will be removed in favor of remote execution " \
30
- "in a future release."
31
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
32
- "katello_package_install`."
33
- super
34
- end
22
+ include UnsupportedKatelloAgentCommandHelper
35
23
  end
36
24
 
37
- class UpgradeCommand < HammerCLIKatello::SingleResourceCommand
38
- include HammerCLIForemanTasks::Async
39
- resource :host_packages, :upgrade
25
+ class UpgradeCommand < HammerCLIKatello::Command
40
26
  command_name "upgrade"
41
- success_message "Packages upgraded successfully."
42
- failure_message "Could not upgrade packages"
43
-
44
- build_options
45
-
46
- def execute
47
- warn "This command uses katello agent and will be removed in favor of remote execution " \
48
- "in a future release."
49
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
50
- "katello_package_update`."
51
- super
27
+ def self.rex_feature
28
+ "katello_package_update"
52
29
  end
30
+
31
+ include UnsupportedKatelloAgentCommandHelper
53
32
  end
54
33
 
55
- class UpgradeAllCommand < HammerCLIKatello::SingleResourceCommand
56
- include HammerCLIForemanTasks::Async
57
- resource :host_packages, :upgrade_all
34
+ class UpgradeAllCommand < HammerCLIKatello::Command
58
35
  command_name "upgrade-all"
59
- success_message "All packages upgraded successfully."
60
- failure_message "Could not upgrade all packages"
61
36
 
62
- build_options
63
-
64
- def execute
65
- warn "This command uses katello agent and will be removed in favor of remote execution " \
66
- "in a future release."
67
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
68
- "katello_package_update`."
69
- super
37
+ def self.rex_feature
38
+ "katello_package_update"
70
39
  end
40
+
41
+ include UnsupportedKatelloAgentCommandHelper
71
42
  end
72
43
 
73
- class RemoveCommand < HammerCLIKatello::SingleResourceCommand
74
- include HammerCLIForemanTasks::Async
75
- resource :host_packages, :remove
44
+ class RemoveCommand < HammerCLIKatello::Command
76
45
  command_name "remove"
77
- success_message "Packages removed successfully."
78
- failure_message "Could not remove packages"
79
46
 
80
- validate_options do
81
- option(:option_packages).required
47
+ def self.rex_feature
48
+ "katello_package_remove"
82
49
  end
83
50
 
84
- build_options :without => [:groups]
85
-
86
- def execute
87
- warn "This command uses katello agent and will be removed in favor of remote execution " \
88
- "in a future release."
89
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
90
- "katello_package_remove`."
91
- super
92
- end
51
+ include UnsupportedKatelloAgentCommandHelper
93
52
  end
94
53
 
95
54
  autoload_subcommands
@@ -1,49 +1,24 @@
1
1
  module HammerCLIKatello
2
2
  class HostPackageGroup < HammerCLIKatello::Command
3
- desc "Manage package-groups on your hosts"
3
+ desc "Manage package-groups on your hosts. These commands are no longer available"\
4
+ "\n Use the remote execution equivalent"
4
5
 
5
6
  class InstallCommand < HammerCLIKatello::SingleResourceCommand
6
- include HammerCLIForemanTasks::Async
7
- resource :host_packages, :install
8
7
  command_name "install"
9
- success_message "Package-groups installed successfully."
10
- failure_message "Could not install package-groups"
11
-
12
- validate_options do
13
- option(:option_groups).required
8
+ def self.rex_feature
9
+ "katello_group_install"
14
10
  end
15
11
 
16
- build_options :without => [:packages]
17
-
18
- def execute
19
- warn "This command uses katello agent and will be removed in favor of remote execution " \
20
- "in a future release."
21
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
22
- "katello_group_install`."
23
- super
24
- end
12
+ include UnsupportedKatelloAgentCommandHelper
25
13
  end
26
14
 
27
15
  class RemoveCommand < HammerCLIKatello::SingleResourceCommand
28
- include HammerCLIForemanTasks::Async
29
- resource :host_packages, :remove
30
16
  command_name "remove"
31
- success_message "Package-groups removed successfully."
32
- failure_message "Could not remove package-groups"
33
-
34
- validate_options do
35
- option(:option_groups).required
17
+ def self.rex_feature
18
+ "katello_group_remove"
36
19
  end
37
20
 
38
- build_options :without => [:packages]
39
-
40
- def execute
41
- warn "This command uses katello agent and will be removed in favor of remote execution " \
42
- "in a future release."
43
- warn "The remote execution equivalent is `hammer job-invocation create --feature " \
44
- "katello_group_remove`."
45
- super
46
- end
21
+ include UnsupportedKatelloAgentCommandHelper
47
22
  end
48
23
 
49
24
  autoload_subcommands
@@ -0,0 +1,25 @@
1
+ module HammerCLIKatello
2
+ module UnsupportedKatelloAgentCommandHelper
3
+ def execute
4
+ print_message(failure_message)
5
+ HammerCLI::EX_UNAVAILABLE
6
+ end
7
+
8
+ def self.host_collection_help_text
9
+ "Specify the host collection with the --search-query " \
10
+ "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
11
+ "`--search-query \"host_collection_id=6\"`"
12
+ end
13
+
14
+ def self.included(base)
15
+ alternate_command = "hammer job-invocation create --feature #{base.rex_feature}"
16
+ message = "Use the remote execution equivalent `#{alternate_command}`."
17
+ if base.name =~ /HostCollection/
18
+ message = "#{message} #{host_collection_help_text}"
19
+ end
20
+ base.desc "Not supported. #{message}"
21
+ base.failure_message "Not supported. #{message}"
22
+ base.option ["-h", "--help"], :flag, "Unsupported Operation - #{message}"
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('1.9.1')
3
+ @version ||= Gem::Version.new('1.10.0')
4
4
  end
5
5
  end
@@ -31,7 +31,7 @@ module HammerCLIKatello
31
31
  require 'hammer_cli_katello/local_helper'
32
32
  require 'hammer_cli_katello/apipie_helper'
33
33
  require 'hammer_cli_katello/content_export_helper'
34
-
34
+ require 'hammer_cli_katello/unsupported_katello_agent_command_helper'
35
35
  # commands
36
36
  HammerCLI::MainCommand.lazy_subcommand("activation-key", _("Manipulate activation keys"),
37
37
  'HammerCLIKatello::ActivationKeyCommand',