hammer_cli_katello 1.3.0 → 1.3.1
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/content_units.rb +66 -0
- data/lib/hammer_cli_katello/repository.rb +0 -11
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/lib/hammer_cli_katello.rb +5 -5
- data/test/data/4.3/foreman_api.json +1 -1
- data/test/functional/content_units/info_test.rb +29 -0
- data/test/functional/content_units/list_test.rb +106 -0
- metadata +7 -3
- data/lib/hammer_cli_katello/ostree_branch.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9299bc667628d32e5cdabeb70fff4b381bd71664bb999abede682076e8b1b82a
|
4
|
+
data.tar.gz: 0b6db8c43b4a4994dd78063760bf57801c14cc1cc88fb727d6fffeb36085ed47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ebe7f1d033e4d15a965d731947684e13fc52e74aa9838e5e4ed821ea76f724d02a0b8cf67b16198e563b2732b53ef2a75de0c20e4e69809de52b16994475d0
|
7
|
+
data.tar.gz: f53d1b937657cbcc786a868127d29a549a56bab4e76e484d141abd2aac0864b65dc76ca3b4cefb3ccd67ddca12e9f87f4318d537f6cd9f0ca3e0c9d879cea309
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module HammerCLIKatello
|
2
|
+
class ContentUnitsCommand < HammerCLIKatello::Command
|
3
|
+
resource :generic_content_units
|
4
|
+
|
5
|
+
class ListCommand < HammerCLIKatello::ListCommand
|
6
|
+
extend RepositoryScopedToProduct
|
7
|
+
|
8
|
+
validate_repo_name_requires_product_options(:option_repository_name)
|
9
|
+
|
10
|
+
output do
|
11
|
+
field :id, _("Id")
|
12
|
+
field :name, _("Name")
|
13
|
+
field :version, _("Version")
|
14
|
+
field :filename, _("Filename"), Fields::Field, hide_blank: true
|
15
|
+
end
|
16
|
+
|
17
|
+
validate_options :before, 'IdResolution' do
|
18
|
+
organization_options = [:option_organization_id, :option_organization_name,
|
19
|
+
:option_organization_label]
|
20
|
+
if any(:option_product_name, :option_content_view_name).exist?
|
21
|
+
any(*organization_options).required
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
build_options do |o|
|
26
|
+
o.expand.including(:products, :organizations, :content_views)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class InfoCommand < HammerCLIKatello::InfoCommand
|
31
|
+
output do
|
32
|
+
field :id, _("Id")
|
33
|
+
field :name, _("Name")
|
34
|
+
field :version, _("Version")
|
35
|
+
field :filename, _("Filename"), Fields::Field, hide_blank: true
|
36
|
+
end
|
37
|
+
|
38
|
+
validate_options :before, 'IdResolution' do
|
39
|
+
organization_options = [:option_organization_id, :option_organization_name,
|
40
|
+
:option_organization_label]
|
41
|
+
product_options = [:option_product_id, :option_product_name]
|
42
|
+
repository_options = [:option_repository_id, :option_repository_name]
|
43
|
+
content_view_version_options = [:option_content_view_version_id,
|
44
|
+
:option_content_view_version_version]
|
45
|
+
|
46
|
+
if option(:option_product_name).exist?
|
47
|
+
any(*organization_options).required
|
48
|
+
end
|
49
|
+
|
50
|
+
if option(:option_repository_name).exist?
|
51
|
+
any(*product_options).required
|
52
|
+
end
|
53
|
+
|
54
|
+
if option(:option_name).exist?
|
55
|
+
any(*(repository_options + content_view_version_options)).required
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
build_options do |o|
|
60
|
+
o.expand.including(:products, :organizations, :content_views, :content_view_versions)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
autoload_subcommands
|
65
|
+
end
|
66
|
+
end
|
@@ -110,7 +110,6 @@ module HammerCLIKatello
|
|
110
110
|
field :docker_manifest_total, _("Container Image Manifests"), Fields::Field,
|
111
111
|
:hide_blank => true
|
112
112
|
field :docker_tag_total, _("Container Image Tags"), Fields::Field, :hide_blank => true
|
113
|
-
field :ostree_branch_total, _("OSTree Branches"), Fields::Field, :hide_blank => true
|
114
113
|
field :file_total, _("Files"), Fields::Field, :hide_blank => true
|
115
114
|
field :module_stream_total, _("Module Streams"), Fields::Field, :hide_blank => true
|
116
115
|
end
|
@@ -159,21 +158,11 @@ module HammerCLIKatello
|
|
159
158
|
data["docker_manifest_list_total"] = content_counts["docker_manifest_list"]
|
160
159
|
data["docker_manifest_total"] = content_counts["docker_manifest"]
|
161
160
|
data["docker_tag_total"] = content_counts["docker_tag"]
|
162
|
-
when "ostree"
|
163
|
-
setup_ostree(data)
|
164
161
|
when "file"
|
165
162
|
data["file_total"] = content_counts["file"]
|
166
163
|
end
|
167
164
|
end
|
168
165
|
|
169
|
-
def setup_ostree(data)
|
170
|
-
content_counts = data["content_counts"]
|
171
|
-
data["ostree_branch_total"] = content_counts["ostree_branch"]
|
172
|
-
if data["ostree_upstream_sync_policy"] == "custom"
|
173
|
-
data["_ostree_upstream_sync_depth"] = data["ostree_upstream_sync_depth"]
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
166
|
def get_sync_status(state)
|
178
167
|
sync_states = {
|
179
168
|
"failed" => _("Failed"), "success" => _("Success"), "finished" => _("Finished"),
|
data/lib/hammer_cli_katello.rb
CHANGED
@@ -117,16 +117,16 @@ module HammerCLIKatello
|
|
117
117
|
'hammer_cli_katello/erratum'
|
118
118
|
)
|
119
119
|
|
120
|
-
HammerCLI::MainCommand.lazy_subcommand("ostree-branch", _("Manipulate ostree branches"),
|
121
|
-
'HammerCLIKatello::OstreeBranchCommand',
|
122
|
-
'hammer_cli_katello/ostree_branch'
|
123
|
-
)
|
124
|
-
|
125
120
|
HammerCLI::MainCommand.lazy_subcommand("file", _("Manipulate files"),
|
126
121
|
'HammerCLIKatello::FileCommand',
|
127
122
|
'hammer_cli_katello/file'
|
128
123
|
)
|
129
124
|
|
125
|
+
HammerCLI::MainCommand.lazy_subcommand("content-units", _("Manipulate content units"),
|
126
|
+
'HammerCLIKatello::ContentUnitsCommand',
|
127
|
+
'hammer_cli_katello/content_units'
|
128
|
+
)
|
129
|
+
|
130
130
|
HammerCLI::MainCommand.lazy_subcommand("content-export",
|
131
131
|
_("Prepare content for export to a disconnected Katello"),
|
132
132
|
'HammerCLIKatello::ContentExport',
|