hammer_cli_katello 0.24.1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_katello.rb +6 -14
  3. data/lib/hammer_cli_katello/activation_key.rb +5 -5
  4. data/lib/hammer_cli_katello/capsule.rb +2 -3
  5. data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +10 -7
  6. data/lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb +11 -8
  7. data/lib/hammer_cli_katello/content_credential.rb +20 -19
  8. data/lib/hammer_cli_katello/content_export.rb +1 -0
  9. data/lib/hammer_cli_katello/content_export_helper.rb +23 -14
  10. data/lib/hammer_cli_katello/content_view.rb +16 -31
  11. data/lib/hammer_cli_katello/content_view_version.rb +18 -13
  12. data/lib/hammer_cli_katello/cv_import_export_helper.rb +21 -0
  13. data/lib/hammer_cli_katello/deb_package.rb +3 -3
  14. data/lib/hammer_cli_katello/erratum.rb +1 -1
  15. data/lib/hammer_cli_katello/erratum_info_command.rb +1 -1
  16. data/lib/hammer_cli_katello/file.rb +3 -3
  17. data/lib/hammer_cli_katello/filter.rb +2 -2
  18. data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
  19. data/lib/hammer_cli_katello/host_collection.rb +2 -2
  20. data/lib/hammer_cli_katello/host_deb.rb +1 -1
  21. data/lib/hammer_cli_katello/host_errata.rb +1 -1
  22. data/lib/hammer_cli_katello/host_extensions.rb +5 -5
  23. data/lib/hammer_cli_katello/host_package.rb +1 -1
  24. data/lib/hammer_cli_katello/hostgroup_extensions.rb +4 -4
  25. data/lib/hammer_cli_katello/id_resolver.rb +5 -6
  26. data/lib/hammer_cli_katello/lifecycle_environment.rb +2 -2
  27. data/lib/hammer_cli_katello/module_stream.rb +8 -8
  28. data/lib/hammer_cli_katello/organization_options.rb +8 -6
  29. data/lib/hammer_cli_katello/ostree_branch.rb +2 -2
  30. data/lib/hammer_cli_katello/package.rb +5 -5
  31. data/lib/hammer_cli_katello/package_group.rb +4 -4
  32. data/lib/hammer_cli_katello/ping.rb +0 -14
  33. data/lib/hammer_cli_katello/product.rb +3 -3
  34. data/lib/hammer_cli_katello/product_content.rb +2 -2
  35. data/lib/hammer_cli_katello/repository.rb +6 -37
  36. data/lib/hammer_cli_katello/repository_set.rb +4 -4
  37. data/lib/hammer_cli_katello/simple_content_access.rb +40 -0
  38. data/lib/hammer_cli_katello/srpm.rb +2 -2
  39. data/lib/hammer_cli_katello/subscription.rb +2 -3
  40. data/lib/hammer_cli_katello/sync_plan.rb +2 -2
  41. data/lib/hammer_cli_katello/version.rb +1 -1
  42. data/test/data/3.18/foreman_api.json +1 -1
  43. data/test/data/3.19/foreman_api.json +1 -0
  44. data/test/data/4.0/foreman_api.json +1 -0
  45. data/test/functional/capsule/content/info_test.rb +1 -2
  46. data/test/functional/content_credentials/create_test.rb +32 -0
  47. data/test/functional/{repository → content_credentials}/data/test_cert.json +0 -0
  48. data/test/functional/content_credentials/list_test.rb +6 -8
  49. data/test/functional/content_export/complete/version_test.rb +35 -3
  50. data/test/functional/content_export/content_export_helpers.rb +19 -14
  51. data/test/functional/content_export/incremental/version_test.rb +35 -3
  52. data/test/functional/content_export/list_test.rb +33 -3
  53. data/test/functional/content_view/content_view_helpers.rb +3 -1
  54. data/test/functional/content_view/list_test.rb +0 -2
  55. data/test/functional/content_view/publish_test.rb +0 -21
  56. data/test/functional/content_view/version/cv_import_export_helper_test.rb +20 -0
  57. data/test/functional/content_view/version/export_test.rb +12 -0
  58. data/test/functional/content_view/version/import_test.rb +28 -0
  59. data/test/functional/content_view/version/promote_test.rb +1 -2
  60. data/test/functional/content_view/version/republish_repositories_test.rb +1 -2
  61. data/test/functional/host/errata/apply_test.rb +0 -2
  62. data/test/functional/host/errata/recalculate_test.rb +0 -2
  63. data/test/functional/lifecycle_environment/lifecycle_environment_helpers.rb +1 -1
  64. data/test/functional/ping_test.rb +0 -2
  65. data/test/functional/repository/create_test.rb +0 -30
  66. data/test/functional/repository/info_test.rb +4 -4
  67. data/test/functional/repository/list_test.rb +0 -2
  68. data/test/functional/search_helpers.rb +11 -0
  69. data/test/functional/simple_content_access/disable_test.rb +48 -0
  70. data/test/functional/simple_content_access/enable_test.rb +46 -0
  71. data/test/test_helper.rb +1 -1
  72. metadata +18 -18
  73. data/lib/hammer_cli_katello/content_view_puppet_module.rb +0 -60
  74. data/lib/hammer_cli_katello/gpg_key.rb +0 -67
  75. data/lib/hammer_cli_katello/puppet_module.rb +0 -59
  76. data/test/functional/content_view/puppet_module/add_test.rb +0 -24
  77. data/test/functional/content_view/puppet_module/remove_test.rb +0 -54
  78. data/test/functional/gpg_test.rb +0 -39
  79. data/test/functional/repository/data/test_ca.json +0 -43
  80. data/test/functional/repository/data/test_key.json +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a90c77802499a72d618883d73162f061b8465d838be44c8df27e3d79d2fc316
4
- data.tar.gz: d4cd08a9eb8fae1437bad8d9adaba03fb5a71cd2c770b5af6500312fb497283c
3
+ metadata.gz: 186183bd2337627828ad27578924b491161632034de3f51b2896a02312b68519
4
+ data.tar.gz: 903b7f9c68fdfcd7538739a1f98aa896e18924806f69d37576a85f935315f7e1
5
5
  SHA512:
6
- metadata.gz: 3aa81078857f074f4c15104e67a31ca9b85ba05d95510b2805114df31955972acd4795078ae3128849568d2f1c3e1e19d274307ac97d7cc8391edc1f05cd44b9
7
- data.tar.gz: ce940d980543120e2cf86a0374fb61e11c20ce37ee06c2ff381b98da2c5731c6adcb4cac0b59bd80d945233b2589d13889859097a910e838117403ee002137c5
6
+ metadata.gz: ae67f54e90820899048b453b5c6592d0e7ac36ee562d798c74c82365c82de577c158640259eeb222cfb9e5f8ab5e880fd1ce36dcba56eed3f67dadaf2430eef7
7
+ data.tar.gz: aae484692b57eb9405e01b2b2f6e01b8254e7903b53fdbe919e829366e0f28ab46e5184e61111fa637655d029cd000197639a1e5919cc5bc59c041ad93108eb0
@@ -44,15 +44,6 @@ module HammerCLIKatello
44
44
  'hammer_cli_katello/organization'
45
45
  )
46
46
 
47
- HammerCLI::MainCommand.lazy_subcommand("gpg",
48
- _("Manipulate GPG Key actions on the server"),
49
- 'HammerCLIKatello::GpgKeyCommand',
50
- 'hammer_cli_katello/gpg_key',
51
- :warning =>
52
- _('The gpg sub-command is deprecated and will be removed in one of the future versions.' \
53
- ' Please use the content-credentials command instead.')
54
- )
55
-
56
47
  HammerCLI::MainCommand.lazy_subcommand("content-credentials",
57
48
  _("Manipulate content credentials on the server"),
58
49
  'HammerCLIKatello::ContentCredentialCommand',
@@ -70,11 +61,6 @@ module HammerCLIKatello
70
61
  'hammer_cli_katello/product'
71
62
  )
72
63
 
73
- HammerCLI::MainCommand.lazy_subcommand("puppet-module", _("View Puppet Module details"),
74
- 'HammerCLIKatello::PuppetModule',
75
- 'hammer_cli_katello/puppet_module'
76
- )
77
-
78
64
  HammerCLI::MainCommand.lazy_subcommand("repository", _("Manipulate repositories"),
79
65
  'HammerCLIKatello::Repository',
80
66
  'hammer_cli_katello/repository'
@@ -164,6 +150,12 @@ module HammerCLIKatello
164
150
  'hammer_cli_katello/srpm'
165
151
  )
166
152
 
153
+ HammerCLI::MainCommand.lazy_subcommand("simple-content-access",
154
+ _("Simple content access commands"),
155
+ 'HammerCLIKatello::SimpleContentAccess',
156
+ 'hammer_cli_katello/simple_content_access'
157
+ )
158
+
167
159
  # subcommands to hammer_cli_foreman commands
168
160
  require 'hammer_cli_katello/host'
169
161
  require 'hammer_cli_katello/hostgroup'
@@ -11,7 +11,7 @@ module HammerCLIKatello
11
11
  action :index
12
12
 
13
13
  output do
14
- field :id, _("ID")
14
+ field :id, _("Id")
15
15
  field :name, _("Name")
16
16
  field :format_consumed, _("Host Limit")
17
17
  from :environment do
@@ -53,7 +53,7 @@ module HammerCLIKatello
53
53
 
54
54
  output do
55
55
  field :name, _("Name")
56
- field :id, _("ID")
56
+ field :id, _("Id")
57
57
  field :description, _("Description")
58
58
  field :format_limit, _("Host Limit")
59
59
  field :auto_attach, _("Auto Attach")
@@ -67,7 +67,7 @@ module HammerCLIKatello
67
67
  end
68
68
 
69
69
  collection :host_collections, _("Host Collections") do
70
- field :id, _("ID")
70
+ field :id, _("Id")
71
71
  field :name, _("Name")
72
72
  end
73
73
 
@@ -150,7 +150,7 @@ module HammerCLIKatello
150
150
  command_name "subscriptions"
151
151
 
152
152
  output do
153
- field :id, _("ID")
153
+ field :id, _("Id")
154
154
  field :product_name, _("Name")
155
155
  field :format_consumed, _("Attached")
156
156
  field :quantity_attached, _("Quantity")
@@ -230,7 +230,7 @@ module HammerCLIKatello
230
230
  command_name "host-collections"
231
231
 
232
232
  output do
233
- field :id, _("ID")
233
+ field :id, _("Id")
234
234
  field :name, _("Name")
235
235
  end
236
236
 
@@ -13,7 +13,7 @@ module HammerCLIKatello
13
13
  command_name 'lifecycle-environments'
14
14
 
15
15
  output do
16
- field :id, _("ID")
16
+ field :id, _("Id")
17
17
  field :name, _("Name")
18
18
  from :organization do
19
19
  field :name, _("Organization")
@@ -28,7 +28,7 @@ module HammerCLIKatello
28
28
  command_name 'available-lifecycle-environments'
29
29
 
30
30
  output do
31
- field :id, _("ID")
31
+ field :id, _("Id")
32
32
  field :name, _("Name")
33
33
  from :organization do
34
34
  field :name, _("Organization")
@@ -167,7 +167,6 @@ module HammerCLIKatello
167
167
  field :packages, _('Packages')
168
168
  field :package_groups, _('Package groups')
169
169
  field :errata, _('Errata')
170
- field :puppet_modules, _('Puppet modules')
171
170
  end
172
171
  end
173
172
  end
@@ -2,13 +2,16 @@ module HammerCLIKatello
2
2
  module CommandExtensions
3
3
  class LifecycleEnvironment < HammerCLI::CommandExtensions
4
4
  # Remove when support of --environment options is ended.
5
- option '--environment', 'ENVIRONMENT_NAME', _('Lifecycle environment name to search by'),
6
- attribute_name: :option_environment_name,
7
- deprecated: { '--environment' => _('Use --lifecycle-environment instead') }
8
- option '--environment-id', 'ENVIRONMENT_ID', _(''),
9
- format: HammerCLI::Options::Normalizers::Number.new,
10
- attribute_name: :option_environment_id,
11
- deprecated: { '--environment-id' => _('Use --lifecycle-environment-id instead') }
5
+ option_family(
6
+ deprecated: { '--environment' => _("Use %s instead") % '--lifecycle-environment',
7
+ '--environment-id' => _("Use %s instead") % '--lifecycle-environment-id'}
8
+ ) do
9
+ child '--environment', 'ENVIRONMENT_NAME', _('Lifecycle environment name to search by'),
10
+ attribute_name: :option_environment_name
11
+ parent '--environment-id', 'ENVIRONMENT_ID', _(''),
12
+ format: HammerCLI::Options::Normalizers::Number.new,
13
+ attribute_name: :option_environment_id
14
+ end
12
15
 
13
16
  option_sources do |sources, command|
14
17
  sources.find_by_name('IdResolution').insert_relative(
@@ -2,14 +2,17 @@ module HammerCLIKatello
2
2
  module CommandExtensions
3
3
  class LifecycleEnvironments < HammerCLI::CommandExtensions
4
4
  # Remove when support of --environments options is ended.
5
- option '--environments', 'ENVIRONMENT_NAMES', _(''),
6
- format: HammerCLI::Options::Normalizers::List.new,
7
- attribute_name: :option_environment_names,
8
- deprecated: { '--environments' => _('Use --lifecycle-environments instead') }
9
- option '--environment-ids', 'ENVIRONMENT_IDS', _(''),
10
- format: HammerCLI::Options::Normalizers::List.new,
11
- attribute_name: :option_environment_ids,
12
- deprecated: { '--environment-ids' => _('Use --lifecycle-environment-ids instead') }
5
+ option_family(
6
+ format: HammerCLI::Options::Normalizers::List.new,
7
+ deprecation: _("Use %s instead") % '--lifecycle-environment[s|-ids]',
8
+ deprecated: { '--environments' => _("Use %s instead") % '--lifecycle-environments',
9
+ '--environment-ids' => _("Use %s instead") % '--lifecycle-environment-ids'}
10
+ ) do
11
+ parent '--environment-ids', 'ENVIRONMENT_IDS', _(''),
12
+ attribute_name: :option_environment_ids
13
+ child '--environments', 'ENVIRONMENT_NAMES', _(''),
14
+ attribute_name: :option_environment_names
15
+ end
13
16
 
14
17
  option_sources do |sources, command|
15
18
  sources.find_by_name('IdResolution').insert_relative(
@@ -4,8 +4,9 @@ module HammerCLIKatello
4
4
 
5
5
  class ListCommand < HammerCLIKatello::ListCommand
6
6
  output do
7
- field :id, _("ID")
8
- field :name, _("Name")
7
+ field :id, _('Id')
8
+ field :name, _('Name')
9
+ field :content_type, _('Content Type')
9
10
  end
10
11
 
11
12
  build_options
@@ -13,51 +14,51 @@ module HammerCLIKatello
13
14
 
14
15
  class InfoCommand < HammerCLIKatello::InfoCommand
15
16
  output do
16
- field :id, _("ID")
17
- field :name, _("Name")
17
+ field :id, _('Id')
18
+ field :name, _('Name')
18
19
  from :organization do
19
- field :name, _("Organization")
20
+ field :name, _('Organization')
20
21
  end
21
22
 
22
- collection :repositories, "Repositories" do
23
- field :id, _("ID")
24
- field :name, _("Name")
25
- field :content_type, _("Content Type")
23
+ collection :repositories, 'Repositories' do
24
+ field :id, _('Id')
25
+ field :name, _('Name')
26
+ field :content_type, _('Content Type')
26
27
  from :product do
27
- field :name, _("Product")
28
+ field :name, _('Product')
28
29
  end
29
30
  end
30
31
 
31
- field :content, _("Content"), Fields::LongText
32
+ field :content, _('Content'), Fields::LongText
32
33
  end
33
34
 
34
35
  build_options
35
36
  end
36
37
 
37
38
  class CreateCommand < HammerCLIKatello::CreateCommand
38
- success_message _("Content credential created.")
39
- failure_message _("Could not create GPG key")
39
+ success_message _('Content Credential created.')
40
+ failure_message _('Could not create Content Credential')
40
41
 
41
42
  build_options :without => [:content]
42
- option "--key", "GPG_KEY_FILE", _("GPG Key file"),
43
+ option '--path', 'KEY_FILE', _('Key file'),
43
44
  :attribute_name => :option_content,
44
45
  :required => true,
45
46
  :format => HammerCLI::Options::Normalizers::File.new
46
47
  end
47
48
 
48
49
  class UpdateCommand < HammerCLIKatello::UpdateCommand
49
- success_message _("GPG Key updated.")
50
- failure_message _("Could not update GPG Key")
50
+ success_message _('Content Credential updated.')
51
+ failure_message _('Could not update Content Credential')
51
52
 
52
53
  build_options :without => [:content]
53
- option "--key", "GPG_KEY_FILE", _("GPG Key file"),
54
+ option '--path', 'KEY_FILE', _('Key file'),
54
55
  :attribute_name => :option_content,
55
56
  :format => HammerCLI::Options::Normalizers::File.new
56
57
  end
57
58
 
58
59
  class DeleteCommand < HammerCLIKatello::DeleteCommand
59
- success_message _("GPG Key deleted.")
60
- failure_message _("Could not delete the GPG Key")
60
+ success_message _('Content Credential deleted.')
61
+ failure_message _('Could not delete the Content Credential')
61
62
 
62
63
  build_options
63
64
  end
@@ -50,6 +50,7 @@ module HammerCLIKatello
50
50
  field :id, _('ID')
51
51
  field :destination_server, _('Destination Server')
52
52
  field :path, _('Path')
53
+ field :type, _('Type')
53
54
  field :content_view_version, _('Content View Version')
54
55
  field :content_view_version_id, _('Content View Version ID')
55
56
  field :created_at, _('Created at')
@@ -40,7 +40,7 @@ module HammerCLIKatello
40
40
  end
41
41
 
42
42
  def fetch_export_history(export_history_id)
43
- resource.call(:index, :id => export_history_id)["results"].first if export_history_id
43
+ index(:content_exports, :id => export_history_id).first if export_history_id
44
44
  end
45
45
 
46
46
  def fetch_export_history_from_task(task)
@@ -134,6 +134,25 @@ module HammerCLIKatello
134
134
 
135
135
  def self.setup_version(base)
136
136
  base.action(:version)
137
+ setup_version_options(base)
138
+ base.success_message _("Content view version is being exported in task %{id}.")
139
+ base.failure_message _("Could not export the content view version")
140
+
141
+ base.extend_with(
142
+ HammerCLIKatello::CommandExtensions::LifecycleEnvironments.new(only: :option_sources)
143
+ )
144
+ base.include(LifecycleEnvironmentNameMapping)
145
+
146
+ base.class_eval do
147
+ def request_params
148
+ super.tap do |opts|
149
+ opts["id"] = resolver.content_view_version_id(options)
150
+ end
151
+ end
152
+ end
153
+ end
154
+
155
+ def self.setup_version_options(base)
137
156
  base.option "--fail-on-missing-content", :flag,
138
157
  _("Fails if any of the repositories belonging"\
139
158
  " to this version are unexportable.")
@@ -143,30 +162,20 @@ module HammerCLIKatello
143
162
  :required => false
144
163
 
145
164
  base.build_options do |o|
146
- o.expand(:all).including(:content_views, :organizations)
165
+ o.expand(:all).including(:content_views, :organizations, :environments)
166
+ o.without(:environment_ids, :environment_id)
147
167
  end
148
168
 
149
169
  base.validate_options do
150
170
  unless option(:option_id).exist?
151
171
  any(:option_id, :option_content_view_name, :option_content_view_id).required
152
- option(:option_version).required
172
+ any(:option_version, :option_environment_id, :option_environment_name).required
153
173
  unless option(:option_content_view_id).exist?
154
174
  any(:option_organization_id, :option_organization_name, \
155
175
  :option_organization_label).required
156
176
  end
157
177
  end
158
178
  end
159
-
160
- base.success_message _("Content view version is being exported in task %{id}.")
161
- base.failure_message _("Could not export the content view version")
162
-
163
- base.class_eval do
164
- def request_params
165
- super.tap do |opts|
166
- opts["id"] = resolver.content_view_version_id(options)
167
- end
168
- end
169
- end
170
179
  end
171
180
  end
172
181
  end
@@ -1,4 +1,3 @@
1
- require 'hammer_cli_katello/content_view_puppet_module'
2
1
  require 'hammer_cli_katello/content_view_purge'
3
2
  require 'hammer_cli_katello/filter'
4
3
  require 'hammer_cli_katello/content_view_version'
@@ -29,13 +28,12 @@ module HammerCLIKatello
29
28
  include OrganizationOptions
30
29
 
31
30
  output do
32
- field :id, _("ID")
31
+ field :id, _("Id")
33
32
  field :name, _("Name")
34
33
  field :label, _("Label")
35
34
  field :composite, _("Composite")
36
35
  field :description, _("Description")
37
36
  field :content_host_count, _("Content Host Count")
38
- field :force_puppet_environment, _("Force Puppet")
39
37
  field :solve_dependencies, _("Solve Dependencies")
40
38
 
41
39
  from :organization do
@@ -43,43 +41,36 @@ module HammerCLIKatello
43
41
  end
44
42
 
45
43
  collection :_yum_repositories, _("Yum Repositories") do
46
- field :id, _("ID")
44
+ field :id, _("Id")
47
45
  field :name, _("Name")
48
46
  field :label, _("Label")
49
47
  end
50
48
 
51
49
  collection :_docker_repositories, _("Container Image Repositories") do
52
- field :id, _("ID")
50
+ field :id, _("Id")
53
51
  field :name, _("Name")
54
52
  field :label, _("Label")
55
53
  end
56
54
 
57
55
  collection :_ostree_repositories, _("OSTree Repositories") do
58
- field :id, _("ID")
56
+ field :id, _("Id")
59
57
  field :name, _("Name")
60
58
  field :label, _("Label")
61
59
  end
62
60
 
63
- collection :puppet_modules, _("Puppet Modules") do
64
- field :id, _("ID")
65
- field :uuid, _("UUID"), Fields::Field, :hide_blank => true
66
- field :name, _("Name")
67
- field :author, _("Author")
68
- end
69
-
70
61
  collection :environments, _("Lifecycle Environments") do
71
- field :id, _("ID")
62
+ field :id, _("Id")
72
63
  field :name, _("Name")
73
64
  end
74
65
 
75
66
  collection :versions, _("Versions") do
76
- field :id, _("ID")
67
+ field :id, _("Id")
77
68
  field :version, _("Version")
78
69
  field :published, _("Published"), Fields::Date
79
70
  end
80
71
 
81
72
  collection :components, _("Components") do
82
- field :id, _("ID")
73
+ field :id, _("Id")
83
74
  field :name, _("Name")
84
75
  end
85
76
 
@@ -246,13 +237,6 @@ module HammerCLIKatello
246
237
  action :remove
247
238
  command_name "remove"
248
239
 
249
- option ["--content-view-version-ids"], "VERSION_IDS",
250
- _("Version ids to remove"),
251
- :format => HammerCLI::Options::Normalizers::List.new
252
- option ["--lifecycle-environment-ids"], "LIFECYCLE_ENVIRONMENT_IDS",
253
- _("Environment ids to remove"),
254
- :format => HammerCLI::Options::Normalizers::List.new
255
-
256
240
  def option_sources
257
241
  sources = super
258
242
  sources.find_by_name('IdResolution').insert_relative(
@@ -285,10 +269,15 @@ module HammerCLIKatello
285
269
  command_name 'add-version'
286
270
  desc _('Add a content view version to a composite view')
287
271
 
288
- option "--content-view-id", "CONTENT_VIEW_ID",
289
- _("Content view numeric identifier to search by"),
290
- attribute_name: :option_content_view_id,
291
- format: HammerCLI::Options::Normalizers::Number.new
272
+ option_family do
273
+ parent "--content-view-id", "CONTENT_VIEW_ID",
274
+ _("Content view id to search by"),
275
+ attribute_name: :option_content_view_id,
276
+ format: HammerCLI::Options::Normalizers::Number.new
277
+ child "--content-view", "CONTENT_VIEW_NAME",
278
+ _("Content view name to search by"),
279
+ attribute_name: :option_content_view_name
280
+ end
292
281
 
293
282
  validate_options :before, 'IdResolution' do
294
283
  if option(:option_content_view_version_version).exist?
@@ -358,10 +347,6 @@ module HammerCLIKatello
358
347
 
359
348
  autoload_subcommands
360
349
 
361
- subcommand 'puppet-module',
362
- HammerCLIKatello::ContentViewPuppetModule.desc,
363
- HammerCLIKatello::ContentViewPuppetModule
364
-
365
350
  subcommand HammerCLIKatello::Filter.command_name,
366
351
  HammerCLIKatello::Filter.desc,
367
352
  HammerCLIKatello::Filter
@@ -10,7 +10,7 @@ module HammerCLIKatello
10
10
  include LifecycleEnvironmentNameMapping
11
11
 
12
12
  output do
13
- field :id, _("ID")
13
+ field :id, _("Id")
14
14
  field :name, _("Name")
15
15
  field :version, _("Version")
16
16
  field :description, _("Description")
@@ -35,7 +35,7 @@ module HammerCLIKatello
35
35
  resource :content_view_versions, :show
36
36
 
37
37
  output do
38
- field :id, _("ID")
38
+ field :id, _("Id")
39
39
  field :name, _("Name")
40
40
  field :version, _("Version")
41
41
  field :description, _("Description")
@@ -47,23 +47,16 @@ module HammerCLIKatello
47
47
  end
48
48
 
49
49
  collection :environments, _("Lifecycle Environments") do
50
- field :id, _("ID")
50
+ field :id, _("Id")
51
51
  field :name, _("Name")
52
52
  field :label, _("Label")
53
53
  end
54
54
 
55
55
  collection :repositories, _("Repositories") do
56
- field :id, _("ID")
56
+ field :id, _("Id")
57
57
  field :name, _("Name")
58
58
  field :label, _("Label")
59
59
  end
60
-
61
- collection :puppet_modules, _("Puppet Modules") do
62
- field :id, _("ID")
63
- field :name, _("Name")
64
- field :author, _("Author")
65
- field :version, _("Version")
66
- end
67
60
  end
68
61
 
69
62
  build_options do |o|
@@ -281,6 +274,7 @@ module HammerCLIKatello
281
274
  class ExportDefaultCommand < HammerCLIForeman::Command
282
275
  include HammerCLIKatello::LocalHelper
283
276
  include HammerCLIKatello::ApipieHelper
277
+ include HammerCLIKatello::CVImportExportHelper
284
278
 
285
279
  PUBLISHED_REPOS_DIR = "/var/lib/pulp/published/yum/https/repos/".freeze
286
280
 
@@ -297,6 +291,7 @@ module HammerCLIKatello
297
291
  build_options
298
292
 
299
293
  def execute
294
+ validate_pulp3_not_enabled(fail_msg_export)
300
295
  export_dir = options['option_export_dir']
301
296
 
302
297
  Dir.mkdir(export_dir) unless Dir.exist?(export_dir)
@@ -314,6 +309,7 @@ module HammerCLIKatello
314
309
  class LegacyExportCommand < HammerCLIKatello::SingleResourceCommand
315
310
  include HammerCLIForemanTasks::Async
316
311
  include LifecycleEnvironmentNameMapping
312
+ include HammerCLIKatello::CVImportExportHelper
317
313
  desc _('Export a content view (legacy method)')
318
314
 
319
315
  action :export
@@ -321,12 +317,16 @@ module HammerCLIKatello
321
317
 
322
318
  success_message _("Content view is being exported in task %{id}.")
323
319
  failure_message _("Could not export the content view")
324
-
325
320
  build_options do |o|
326
321
  o.expand(:all).including(:environments, :content_views, :organizations)
327
322
  end
328
323
 
329
324
  extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
325
+
326
+ def request_params
327
+ validate_pulp3_not_enabled(fail_msg_export)
328
+ super
329
+ end
330
330
  end
331
331
 
332
332
  class ExportCommand < HammerCLIForeman::Command
@@ -357,6 +357,8 @@ module HammerCLIKatello
357
357
  cvv = show(:content_view_versions, 'id' => options['option_id'])
358
358
  cv = show(:content_views, 'id' => cvv['content_view_id'])
359
359
 
360
+ validate_pulp3_not_enabled(fail_msg_export)
361
+
360
362
  composite = cv["composite"]
361
363
 
362
364
  export_json_options = { :cvv => cvv }
@@ -452,6 +454,8 @@ module HammerCLIKatello
452
454
 
453
455
  # rubocop:disable Metrics/AbcSize
454
456
  def execute
457
+ validate_pulp3_not_enabled(fail_msg_import)
458
+
455
459
  unless File.exist?(options['option_export_tar'])
456
460
  raise _("Export tar #{options['option_export_tar']} does not exist.")
457
461
  end
@@ -494,7 +498,8 @@ module HammerCLIKatello
494
498
  library_repos = index(
495
499
  :repositories,
496
500
  'organization_id' => organization_id,
497
- 'library' => true
501
+ 'library' => true,
502
+ 'label' => repo['label']
498
503
  )
499
504
 
500
505
  library_repo = library_repos.select do |candidate_repo|