hammer_cli_katello 0.0.26 → 0.1.0
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_katello/activation_key.rb +23 -43
- data/lib/hammer_cli_katello/associating_commands.rb +3 -5
- data/lib/hammer_cli_katello/capsule.rb +1 -3
- data/lib/hammer_cli_katello/commands.rb +1 -7
- data/lib/hammer_cli_katello/content_view.rb +6 -3
- data/lib/hammer_cli_katello/content_view_name_resolvable.rb +21 -0
- data/lib/hammer_cli_katello/content_view_puppet_module.rb +11 -7
- data/lib/hammer_cli_katello/content_view_version.rb +30 -29
- data/lib/hammer_cli_katello/erratum.rb +0 -1
- data/lib/hammer_cli_katello/exception_handler.rb +0 -2
- data/lib/hammer_cli_katello/filter.rb +11 -3
- data/lib/hammer_cli_katello/filter_rule.rb +8 -2
- data/lib/hammer_cli_katello/foreman_search_options_creators.rb +71 -0
- data/lib/hammer_cli_katello/gpg_key.rb +0 -5
- data/lib/hammer_cli_katello/host.rb +1 -0
- data/lib/hammer_cli_katello/host_collection.rb +48 -16
- data/lib/hammer_cli_katello/host_errata.rb +0 -1
- data/lib/hammer_cli_katello/host_extensions.rb +56 -0
- data/lib/hammer_cli_katello/host_package.rb +0 -3
- data/lib/hammer_cli_katello/host_package_group.rb +0 -3
- data/lib/hammer_cli_katello/host_subscription.rb +67 -1
- data/lib/hammer_cli_katello/hostgroup.rb +2 -0
- data/lib/hammer_cli_katello/hostgroup_extensions.rb +48 -0
- data/lib/hammer_cli_katello/i18n.rb +0 -3
- data/lib/hammer_cli_katello/id_resolver.rb +25 -16
- data/lib/hammer_cli_katello/katello_environment_name_resolvable.rb +4 -3
- data/lib/hammer_cli_katello/lifecycle_environment.rb +0 -3
- data/lib/hammer_cli_katello/lifecycle_environment_name_resolvable.rb +4 -3
- data/lib/hammer_cli_katello/organization.rb +0 -3
- data/lib/hammer_cli_katello/organization_options.rb +12 -0
- data/lib/hammer_cli_katello/ostree_branch.rb +0 -1
- data/lib/hammer_cli_katello/output/fields.rb +0 -2
- data/lib/hammer_cli_katello/output/formatters.rb +0 -4
- data/lib/hammer_cli_katello/package.rb +0 -1
- data/lib/hammer_cli_katello/package_group.rb +0 -1
- data/lib/hammer_cli_katello/ping.rb +0 -6
- data/lib/hammer_cli_katello/product.rb +1 -7
- data/lib/hammer_cli_katello/puppet_module.rb +0 -1
- data/lib/hammer_cli_katello/repository.rb +36 -35
- data/lib/hammer_cli_katello/repository_scoped_to_product.rb +0 -4
- data/lib/hammer_cli_katello/repository_set.rb +0 -3
- data/lib/hammer_cli_katello/search_options_creators.rb +40 -18
- data/lib/hammer_cli_katello/subscription.rb +20 -13
- data/lib/hammer_cli_katello/sync_plan.rb +4 -8
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/lib/hammer_cli_katello.rb +21 -26
- data/test/data/3.0/foreman_api.json +1 -1
- data/test/data/3.2/foreman_api.json +1 -0
- data/test/data/Readme.md +5 -0
- data/test/functional/activaton_key/add_host_collection_test.rb +62 -0
- data/test/functional/activaton_key/create_test.rb +33 -0
- data/test/functional/activaton_key/list_test.rb +15 -16
- data/test/functional/activaton_key/product_content_test.rb +23 -0
- data/test/functional/activaton_key/remove_host_collection_test.rb +62 -0
- data/test/functional/activaton_key/subscriptions_test.rb +57 -0
- data/test/functional/activaton_key/update_test.rb +26 -0
- data/test/functional/capsule/content/cancel_synchronization_test.rb +1 -1
- data/test/functional/capsule/content/capsule_content_helpers.rb +0 -2
- data/test/functional/content_view/add_content_view_version_test.rb +34 -0
- data/test/functional/content_view/add_repository_test.rb +20 -0
- data/test/functional/content_view/content_view_helpers.rb +0 -2
- data/test/functional/content_view/create_test.rb +3 -3
- data/test/functional/content_view/filter/create_test.rb +63 -0
- data/test/functional/content_view/list_test.rb +23 -20
- data/test/functional/content_view/publish_test.rb +23 -0
- data/test/functional/content_view/puppet_module/add_test.rb +23 -0
- data/test/functional/content_view/remove_content_view_version_test.rb +34 -0
- data/test/functional/content_view/version/incremental_update_test.rb +4 -4
- data/test/functional/content_view/version/list_test.rb +44 -0
- data/test/functional/content_view/version/promote_test.rb +35 -0
- data/test/functional/filter_rule/create_test.rb +20 -0
- data/test/functional/host/errata/apply_test.rb +5 -4
- data/test/functional/host/extensions/data/host.json +310 -0
- data/test/functional/host/extensions/data/host_list.json +115 -0
- data/test/functional/host/extensions/info_test.rb +27 -0
- data/test/functional/host/extensions/list_test.rb +21 -0
- data/test/functional/host/host_helpers.rb +0 -2
- data/test/functional/host/subscription/attach_test.rb +54 -0
- data/test/functional/host/subscription/auto_attach_test.rb +35 -0
- data/test/functional/host/subscription/register_test.rb +2 -2
- data/test/functional/host/subscription/remove_test.rb +52 -0
- data/test/functional/host_collection/add_host_test.rb +57 -0
- data/test/functional/host_collection/copy_test.rb +64 -0
- data/test/functional/host_collection/create_test.rb +43 -0
- data/test/functional/host_collection/delete_test.rb +57 -0
- data/test/functional/host_collection/hosts_test.rb +40 -0
- data/test/functional/host_collection/info_test.rb +57 -0
- data/test/functional/host_collection/list_test.rb +42 -0
- data/test/functional/host_collection/remove_host_test.rb +57 -0
- data/test/functional/host_collection/update_test.rb +57 -0
- data/test/functional/hostgroup/create_test.rb +55 -0
- data/test/functional/hostgroup/data/hostgroup.json +48 -0
- data/test/functional/hostgroup/info_test.rb +30 -0
- data/test/functional/hostgroup/update_test.rb +55 -0
- data/test/functional/lifecycle_environment/lifecycle_environment_helpers.rb +0 -2
- data/test/functional/organization/organization_helpers.rb +0 -2
- data/test/functional/product/create_test.rb +54 -0
- data/test/functional/product/delete_test.rb +41 -0
- data/test/functional/product/info_test.rb +33 -0
- data/test/functional/product/list_test.rb +58 -0
- data/test/functional/product/product_helpers.rb +14 -0
- data/test/functional/product/remove_sync_plan_test.rb +35 -0
- data/test/functional/product/set_sync_plan_test.rb +49 -0
- data/test/functional/product/update_test.rb +46 -0
- data/test/functional/repository/info_test.rb +3 -3
- data/test/functional/repository/list_test.rb +14 -13
- data/test/functional/repository/remove_content_test.rb +18 -0
- data/test/functional/repository/repository_helpers.rb +9 -3
- data/test/functional/repository/synchronize_test.rb +3 -3
- data/test/functional/repository/upload_test.rb +17 -5
- data/test/functional/subscription/list_test.rb +92 -0
- data/test/functional/sync_plan/sync_plan_helpers.rb +8 -0
- data/test/test_helper.rb +3 -3
- data/test/unit/id_resolver_test.rb +17 -2
- data/test/unit/search_options_creators_test.rb +49 -12
- metadata +105 -7
- data/lib/hammer_cli_katello/content_host.rb +0 -111
@@ -1,5 +1,4 @@
|
|
1
1
|
module HammerCLIKatello
|
2
|
-
|
3
2
|
class Product < HammerCLIKatello::Command
|
4
3
|
resource :products
|
5
4
|
|
@@ -14,11 +13,7 @@ module HammerCLIKatello
|
|
14
13
|
end
|
15
14
|
|
16
15
|
field :repository_count, _("Repositories")
|
17
|
-
|
18
|
-
from :sync_status do
|
19
|
-
field :state, _("Sync State")
|
20
|
-
end
|
21
|
-
|
16
|
+
field :sync_state, _("Sync State")
|
22
17
|
end
|
23
18
|
|
24
19
|
build_options
|
@@ -32,7 +27,6 @@ module HammerCLIKatello
|
|
32
27
|
end
|
33
28
|
|
34
29
|
class InfoCommand < HammerCLIKatello::InfoCommand
|
35
|
-
|
36
30
|
output do
|
37
31
|
field :id, _("ID")
|
38
32
|
field :name, _("Name")
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module HammerCLIKatello
|
2
|
-
|
3
2
|
class Repository < HammerCLIKatello::Command
|
4
3
|
resource :repositories
|
5
4
|
|
@@ -99,9 +98,9 @@ module HammerCLIKatello
|
|
99
98
|
content_counts = data["content_counts"]
|
100
99
|
case data["content_type"]
|
101
100
|
when "yum"
|
102
|
-
data["package_total"]
|
103
|
-
data["package_group_total"]
|
104
|
-
data["errata_total"]
|
101
|
+
data["package_total"] = content_counts["rpm"]
|
102
|
+
data["package_group_total"] = content_counts["package_group"]
|
103
|
+
data["errata_total"] = content_counts["erratum"]
|
105
104
|
when "docker"
|
106
105
|
data["docker_manifest_total"] = content_counts["docker_manifest"]
|
107
106
|
data["docker_tag_total"] = content_counts["docker_tag"]
|
@@ -112,7 +111,6 @@ module HammerCLIKatello
|
|
112
111
|
end
|
113
112
|
end
|
114
113
|
|
115
|
-
# rubocop:disable MethodLength
|
116
114
|
def get_sync_status(state)
|
117
115
|
sync_states = {
|
118
116
|
"failed" => _("Failed"),
|
@@ -236,21 +234,20 @@ module HammerCLIKatello
|
|
236
234
|
repo_id = get_identifier
|
237
235
|
filename = File.basename(file.path)
|
238
236
|
|
239
|
-
|
240
|
-
while (content = file.read(CONTENT_CHUNK_SIZE))
|
241
|
-
params = {
|
242
|
-
:offset => offset,
|
243
|
-
:id => upload_id,
|
244
|
-
:content => content,
|
245
|
-
:repository_id => repo_id,
|
246
|
-
:multipart => true
|
247
|
-
}
|
237
|
+
update_content_upload(upload_id, repo_id, file)
|
248
238
|
|
249
|
-
|
250
|
-
|
251
|
-
|
239
|
+
file.rewind
|
240
|
+
content = file.read
|
241
|
+
|
242
|
+
import_uploads([
|
243
|
+
{
|
244
|
+
id: upload_id,
|
245
|
+
name: filename,
|
246
|
+
size: file.size,
|
247
|
+
checksum: Digest::SHA256.hexdigest(content)
|
248
|
+
}
|
249
|
+
])
|
252
250
|
|
253
|
-
import_upload_ids([upload_id])
|
254
251
|
print_message _("Successfully uploaded file '%s'.") % filename
|
255
252
|
rescue
|
256
253
|
@failure = true
|
@@ -266,36 +263,40 @@ module HammerCLIKatello
|
|
266
263
|
response["upload_id"]
|
267
264
|
end
|
268
265
|
|
269
|
-
def
|
266
|
+
def update_content_upload(upload_id, repo_id, file)
|
267
|
+
offset = 0
|
268
|
+
|
269
|
+
while (content = file.read(CONTENT_CHUNK_SIZE))
|
270
|
+
params = {
|
271
|
+
:offset => offset,
|
272
|
+
:id => upload_id,
|
273
|
+
:content => content,
|
274
|
+
:repository_id => repo_id,
|
275
|
+
:multipart => true
|
276
|
+
}
|
277
|
+
|
278
|
+
content_upload_resource.call(:update, params, request_headers)
|
279
|
+
offset += CONTENT_CHUNK_SIZE
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
def import_uploads(uploads)
|
270
284
|
params = {:id => get_identifier,
|
271
|
-
:
|
285
|
+
:uploads => uploads
|
272
286
|
}
|
273
287
|
resource.call(:import_uploads, params)
|
274
288
|
end
|
275
289
|
end
|
276
290
|
|
277
291
|
class RemoveContentCommand < HammerCLIKatello::SingleResourceCommand
|
278
|
-
include RepositoryScopedToProduct
|
279
|
-
|
280
292
|
resource :repositories, :remove_content
|
281
293
|
command_name "remove-content"
|
282
|
-
|
283
|
-
option ["--content-ids"], "CONTENT_IDS",
|
284
|
-
_("package IDs, puppet module IDs, and/or docker manifest IDs"),
|
285
|
-
:format => HammerCLI::Options::Normalizers::List.new, :required => true
|
286
|
-
|
287
|
-
def request_params
|
288
|
-
super.tap do |params|
|
289
|
-
params[:ids] = option_content_ids
|
290
|
-
params[:uuids] = option_content_ids
|
291
|
-
end
|
292
|
-
end
|
294
|
+
desc _("Remove content from a repository")
|
293
295
|
|
294
296
|
success_message _("Repository content removed")
|
295
297
|
failure_message _("Could not remove content")
|
296
298
|
|
297
|
-
|
298
|
-
build_options :without => %w(uuids ids)
|
299
|
+
build_options
|
299
300
|
end
|
300
301
|
|
301
302
|
class ExportCommand < HammerCLIKatello::SingleResourceCommand
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module HammerCLIKatello
|
2
|
-
|
3
2
|
class RepositorySetCommand < HammerCLI::AbstractCommand
|
4
|
-
|
5
3
|
class ListCommand < HammerCLIKatello::ListCommand
|
6
4
|
resource :repository_sets, :index
|
7
5
|
|
@@ -83,5 +81,4 @@ module HammerCLIKatello
|
|
83
81
|
|
84
82
|
autoload_subcommands
|
85
83
|
end
|
86
|
-
|
87
84
|
end
|
@@ -1,21 +1,50 @@
|
|
1
|
+
require 'hammer_cli_katello/foreman_search_options_creators'
|
2
|
+
|
1
3
|
module HammerCLIKatello
|
2
4
|
module SearchOptionsCreators
|
5
|
+
include HammerCLIKatello::ForemanSearchOptionsCreators
|
6
|
+
|
7
|
+
def create_repository_search_options(options)
|
8
|
+
name = options[HammerCLI.option_accessor_name("name")]
|
9
|
+
organization_id = options[HammerCLI.option_accessor_name("organization_id")]
|
10
|
+
|
11
|
+
search_options = {}
|
12
|
+
search_options['name'] = name if name
|
13
|
+
search_options['organization_id'] = organization_id if organization_id
|
14
|
+
search_options
|
15
|
+
end
|
3
16
|
|
4
17
|
def create_repositories_search_options(options)
|
5
18
|
name = options[HammerCLI.option_accessor_name("name")]
|
6
19
|
names = options[HammerCLI.option_accessor_name("names")]
|
7
20
|
product_id = options[HammerCLI.option_accessor_name("product_id")]
|
21
|
+
organization_id = options[HammerCLI.option_accessor_name("organization_id")]
|
8
22
|
|
9
23
|
search_options = {}
|
10
24
|
search_options['name'] = name if name
|
11
25
|
search_options['names'] = names if names
|
12
26
|
search_options['product_id'] = product_id if product_id
|
27
|
+
search_options['organization_id'] = organization_id if organization_id
|
28
|
+
search_options
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_content_views_search_options(options)
|
32
|
+
name = options[HammerCLI.option_accessor_name('name')]
|
33
|
+
organization_id = options[HammerCLI.option_accessor_name("organization_id")] ||
|
34
|
+
organization_id(scoped_options('organization', options))
|
35
|
+
|
36
|
+
search_options = {}
|
37
|
+
search_options['name'] = name if name
|
38
|
+
if options['option_content_view_name'] || name
|
39
|
+
search_options['organization_id'] = organization_id
|
40
|
+
end
|
13
41
|
search_options
|
14
42
|
end
|
15
43
|
|
16
44
|
def create_lifecycle_environments_search_options(options)
|
17
45
|
name = options[HammerCLI.option_accessor_name("name")]
|
18
|
-
organization_id = options[HammerCLI.option_accessor_name("organization_id")]
|
46
|
+
organization_id = options[HammerCLI.option_accessor_name("organization_id")] ||
|
47
|
+
organization_id(scoped_options('organization', options))
|
19
48
|
|
20
49
|
search_options = {}
|
21
50
|
search_options['name'] = name if name
|
@@ -38,20 +67,15 @@ module HammerCLIKatello
|
|
38
67
|
search_options
|
39
68
|
end
|
40
69
|
|
41
|
-
def
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
create_search_options_without_katello_api(options, api.resource(:smart_proxies))
|
51
|
-
end
|
52
|
-
|
53
|
-
def create_hosts_search_options(options)
|
54
|
-
create_search_options_without_katello_api(options, api.resource(:hosts))
|
70
|
+
def create_host_collections_search_options(options)
|
71
|
+
options[HammerCLI.option_accessor_name("organization_id")] ||= organization_id(
|
72
|
+
scoped_options("organization", options)
|
73
|
+
)
|
74
|
+
search_options = create_search_options_with_katello_api(
|
75
|
+
options, api.resource(:host_collections)
|
76
|
+
) || {}
|
77
|
+
search_options['organization_id'] ||= options['option_organization_id']
|
78
|
+
search_options
|
55
79
|
end
|
56
80
|
|
57
81
|
def create_search_options_with_katello_api(options, resource)
|
@@ -59,12 +83,10 @@ module HammerCLIKatello
|
|
59
83
|
searchables(resource).each do |s|
|
60
84
|
value = options[HammerCLI.option_accessor_name(s.name.to_s)]
|
61
85
|
if value
|
62
|
-
search_options.update(
|
86
|
+
search_options.update(s.name.to_s => value.to_s)
|
63
87
|
end
|
64
88
|
end
|
65
89
|
search_options
|
66
90
|
end
|
67
|
-
|
68
91
|
end # module SearchOptionsCreators
|
69
|
-
|
70
92
|
end # module HammerCLIKatello
|
@@ -3,33 +3,42 @@ require 'hammer_cli_foreman'
|
|
3
3
|
require 'hammer_cli_foreman/commands'
|
4
4
|
|
5
5
|
module HammerCLIKatello
|
6
|
-
|
7
6
|
class SubscriptionCommand < HammerCLI::AbstractCommand
|
8
|
-
|
9
7
|
class ListCommand < HammerCLIKatello::ListCommand
|
10
|
-
|
11
8
|
resource :subscriptions, :index
|
12
9
|
|
13
10
|
output do
|
11
|
+
field :id, _("ID")
|
12
|
+
field :cp_id, _("UUID")
|
14
13
|
field :product_name, _("Name")
|
14
|
+
field :subscription_type, _("Type")
|
15
15
|
field :contract_number, _("Contract")
|
16
16
|
field :account_number, _("Account")
|
17
17
|
field :support_level, _("Support")
|
18
|
-
field :
|
19
|
-
field :consumed, _("Consumed")
|
20
|
-
field :end_date, _("End Date")
|
21
|
-
field :id, _("ID")
|
22
|
-
field :product_name, _("Product")
|
18
|
+
field :end_date, _("End Date"), Fields::Date
|
23
19
|
field :format_quantity, _("Quantity")
|
24
|
-
field :consumed, _("
|
20
|
+
field :consumed, _("Consumed")
|
25
21
|
end
|
26
22
|
|
27
23
|
def extend_data(data)
|
28
24
|
data["format_quantity"] = data["quantity"] == -1 ? _("Unlimited") : data["quantity"]
|
25
|
+
data["subscription_type"] = get_subscription_type(data)
|
29
26
|
data
|
30
27
|
end
|
31
28
|
|
32
29
|
build_options
|
30
|
+
|
31
|
+
def get_subscription_type(data)
|
32
|
+
if !data["virt_only"]
|
33
|
+
_("Physical")
|
34
|
+
elsif data["host"]
|
35
|
+
_("Guests of %s" % data['host']['name'])
|
36
|
+
elsif data["unmapper_guest"]
|
37
|
+
_("Temporary")
|
38
|
+
else
|
39
|
+
_("Virtual")
|
40
|
+
end
|
41
|
+
end
|
33
42
|
end
|
34
43
|
|
35
44
|
class UploadCommand < HammerCLIKatello::Command
|
@@ -66,9 +75,7 @@ module HammerCLIKatello
|
|
66
75
|
success_message _("Manifest is being deleted in task %{id}")
|
67
76
|
failure_message _("Manifest deletion failed")
|
68
77
|
|
69
|
-
build_options
|
70
|
-
o.expand.including(:systems)
|
71
|
-
end
|
78
|
+
build_options(&:expand)
|
72
79
|
end
|
73
80
|
|
74
81
|
class RefreshManifestCommand < HammerCLIKatello::Command
|
@@ -83,7 +90,7 @@ module HammerCLIKatello
|
|
83
90
|
build_options
|
84
91
|
end
|
85
92
|
|
86
|
-
class ManifestHistoryCommand <
|
93
|
+
class ManifestHistoryCommand < HammerCLIKatello::ListCommand
|
87
94
|
command_name "manifest-history"
|
88
95
|
resource :subscriptions, :manifest_history
|
89
96
|
|
@@ -3,7 +3,6 @@ module HammerCLIKatello
|
|
3
3
|
resource :sync_plans
|
4
4
|
|
5
5
|
class ListCommand < HammerCLIKatello::ListCommand
|
6
|
-
|
7
6
|
output do
|
8
7
|
field :id, _("ID")
|
9
8
|
field :name, _("Name")
|
@@ -16,7 +15,6 @@ module HammerCLIKatello
|
|
16
15
|
end
|
17
16
|
|
18
17
|
class InfoCommand < HammerCLIKatello::InfoCommand
|
19
|
-
|
20
18
|
output ListCommand.output_definition do
|
21
19
|
field :description, _("Description")
|
22
20
|
field :created_at, _("Created at"), Fields::Date
|
@@ -27,11 +25,10 @@ module HammerCLIKatello
|
|
27
25
|
end
|
28
26
|
|
29
27
|
class CreateCommand < HammerCLIKatello::CreateCommand
|
30
|
-
|
31
28
|
option "--interval", "INTERVAL", _("how often synchronization should run"),
|
32
29
|
:format => HammerCLI::Options::Normalizers::Enum.new(
|
33
|
-
|
34
|
-
|
30
|
+
%w(hourly daily weekly)
|
31
|
+
)
|
35
32
|
|
36
33
|
option "--sync-date", "SYNC_DATE",
|
37
34
|
_("start date and time of the synchronization defaults to now"),
|
@@ -44,11 +41,10 @@ module HammerCLIKatello
|
|
44
41
|
end
|
45
42
|
|
46
43
|
class UpdateCommand < HammerCLIKatello::UpdateCommand
|
47
|
-
|
48
44
|
option "--interval", "INTERVAL", _("how often synchronization should run"),
|
49
45
|
:format => HammerCLI::Options::Normalizers::Enum.new(
|
50
|
-
|
51
|
-
|
46
|
+
%w(hourly daily weekly)
|
47
|
+
)
|
52
48
|
option "--sync-date", "SYNC_DATE", _("start date and time of the synchronization"),
|
53
49
|
:format => HammerCLI::Options::Normalizers::DateTime.new
|
54
50
|
|
data/lib/hammer_cli_katello.rb
CHANGED
@@ -6,7 +6,6 @@ require 'hammer_cli_foreman/output/fields'
|
|
6
6
|
require 'hammer_cli_foreman_tasks'
|
7
7
|
|
8
8
|
module HammerCLIKatello
|
9
|
-
|
10
9
|
def self.exception_handler_class
|
11
10
|
HammerCLIKatello::ExceptionHandler
|
12
11
|
end
|
@@ -15,6 +14,8 @@ module HammerCLIKatello
|
|
15
14
|
require 'hammer_cli_katello/output/formatters'
|
16
15
|
require 'hammer_cli_katello/katello_environment_name_resolvable'
|
17
16
|
require 'hammer_cli_katello/lifecycle_environment_name_resolvable'
|
17
|
+
require 'hammer_cli_katello/content_view_name_resolvable'
|
18
|
+
require 'hammer_cli_katello/organization_options'
|
18
19
|
require 'hammer_cli_katello/repository_scoped_to_product'
|
19
20
|
require "hammer_cli_katello/commands"
|
20
21
|
require "hammer_cli_katello/associating_commands"
|
@@ -29,103 +30,97 @@ module HammerCLIKatello
|
|
29
30
|
HammerCLI::MainCommand.lazy_subcommand("activation-key", _("Manipulate activation keys."),
|
30
31
|
'HammerCLIKatello::ActivationKeyCommand',
|
31
32
|
'hammer_cli_katello/activation_key'
|
32
|
-
|
33
|
+
)
|
33
34
|
|
34
35
|
HammerCLI::MainCommand.lazy_subcommand!("organization", _("Manipulate organizations"),
|
35
36
|
'HammerCLIKatello::Organization',
|
36
37
|
'hammer_cli_katello/organization'
|
37
|
-
|
38
|
+
)
|
38
39
|
|
39
40
|
HammerCLI::MainCommand.lazy_subcommand("gpg", _("Manipulate GPG Key actions on the server"),
|
40
41
|
'HammerCLIKatello::GpgKeyCommand',
|
41
42
|
'hammer_cli_katello/gpg_key'
|
42
|
-
|
43
|
+
)
|
43
44
|
|
44
45
|
HammerCLI::MainCommand.lazy_subcommand("lifecycle-environment",
|
45
46
|
_("Manipulate lifecycle_environments on the server"),
|
46
47
|
'HammerCLIKatello::LifecycleEnvironmentCommand',
|
47
48
|
'hammer_cli_katello/lifecycle_environment'
|
48
|
-
|
49
|
+
)
|
49
50
|
|
50
51
|
HammerCLI::MainCommand.lazy_subcommand("ping", _("Get the status of the server"),
|
51
52
|
'HammerCLIKatello::PingCommand',
|
52
53
|
'hammer_cli_katello/ping'
|
53
|
-
|
54
|
+
)
|
54
55
|
|
55
56
|
HammerCLI::MainCommand.lazy_subcommand("product", _("Manipulate products."),
|
56
57
|
'HammerCLIKatello::Product',
|
57
58
|
'hammer_cli_katello/product'
|
58
|
-
|
59
|
+
)
|
59
60
|
|
60
61
|
HammerCLI::MainCommand.lazy_subcommand("puppet-module", _("View Puppet Module details."),
|
61
62
|
'HammerCLIKatello::PuppetModule',
|
62
63
|
'hammer_cli_katello/puppet_module'
|
63
|
-
|
64
|
+
)
|
64
65
|
|
65
66
|
HammerCLI::MainCommand.lazy_subcommand("repository", _("Manipulate repositories"),
|
66
67
|
'HammerCLIKatello::Repository',
|
67
68
|
'hammer_cli_katello/repository'
|
68
|
-
|
69
|
+
)
|
69
70
|
|
70
71
|
HammerCLI::MainCommand.lazy_subcommand("repository-set",
|
71
72
|
_("Manipulate repository sets on the server"),
|
72
73
|
'HammerCLIKatello::RepositorySetCommand',
|
73
74
|
'hammer_cli_katello/repository_set'
|
74
|
-
|
75
|
+
)
|
75
76
|
|
76
77
|
HammerCLI::MainCommand.lazy_subcommand("subscription", _("Manipulate subscriptions."),
|
77
78
|
'HammerCLIKatello::SubscriptionCommand',
|
78
79
|
'hammer_cli_katello/subscription'
|
79
|
-
|
80
|
+
)
|
80
81
|
|
81
82
|
HammerCLI::MainCommand.lazy_subcommand('sync-plan', _("Manipulate sync plans"),
|
82
83
|
'HammerCLIKatello::SyncPlan',
|
83
84
|
'hammer_cli_katello/sync_plan'
|
84
|
-
|
85
|
+
)
|
85
86
|
|
86
87
|
HammerCLI::MainCommand.lazy_subcommand('host-collection', _("Manipulate host collections"),
|
87
88
|
'HammerCLIKatello::HostCollection',
|
88
89
|
'hammer_cli_katello/host_collection'
|
89
|
-
|
90
|
-
|
91
|
-
HammerCLI::MainCommand.lazy_subcommand("content-host",
|
92
|
-
_("Manipulate content hosts on the server"),
|
93
|
-
'HammerCLIKatello::ContentHostCommand',
|
94
|
-
'hammer_cli_katello/content_host'
|
95
|
-
)
|
90
|
+
)
|
96
91
|
|
97
92
|
HammerCLI::MainCommand.lazy_subcommand("content-view", _("Manipulate content views."),
|
98
93
|
'HammerCLIKatello::ContentView',
|
99
94
|
'hammer_cli_katello/content_view'
|
100
|
-
|
95
|
+
)
|
101
96
|
|
102
97
|
# Capsule is just an alias to smart proxy
|
103
98
|
HammerCLI::MainCommand.lazy_subcommand("capsule", _("Manipulate capsule"),
|
104
99
|
'HammerCLIForeman::SmartProxy',
|
105
100
|
'hammer_cli_foreman/smart_proxy'
|
106
|
-
|
101
|
+
)
|
107
102
|
|
108
103
|
HammerCLI::MainCommand.lazy_subcommand("package", _("Manipulate packages."),
|
109
104
|
'HammerCLIKatello::PackageCommand',
|
110
105
|
'hammer_cli_katello/package'
|
111
|
-
|
106
|
+
)
|
112
107
|
|
113
108
|
HammerCLI::MainCommand.lazy_subcommand("package-group", _("Manipulate package groups"),
|
114
109
|
'HammerCLIKatello::PackageGroupCommand',
|
115
110
|
'hammer_cli_katello/package_group'
|
116
|
-
|
111
|
+
)
|
117
112
|
|
118
113
|
HammerCLI::MainCommand.lazy_subcommand("erratum", _("Manipulate errata"),
|
119
114
|
'HammerCLIKatello::ErratumCommand',
|
120
115
|
'hammer_cli_katello/erratum'
|
121
|
-
|
116
|
+
)
|
122
117
|
|
123
118
|
HammerCLI::MainCommand.lazy_subcommand("ostree-branch", _("Manipulate ostree branches"),
|
124
119
|
'HammerCLIKatello::OstreeBranchCommand',
|
125
120
|
'hammer_cli_katello/ostree_branch'
|
126
|
-
|
121
|
+
)
|
127
122
|
|
128
123
|
# subcommands to hammer_cli_foreman commands
|
129
124
|
require 'hammer_cli_katello/host'
|
130
|
-
|
125
|
+
require 'hammer_cli_katello/hostgroup'
|
131
126
|
end
|