hammer_cli_katello 0.0.7 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWZlM2QzZWY4MTVmYjA3N2QwMTZkNTUwODJhNWYxOGQ5MWY4ZDgzZg==
4
+ NThiOTU1NWE2NGRkODNjYTVhYWYyNTc4YjUwMGFlYjMxMGY1NjI0MA==
5
5
  data.tar.gz: !binary |-
6
- MjE0OTM2ZDg2ZjY1NGYzZjE3NWNmZjY3NDM2MjBiZWVjNWFmMjE3NQ==
6
+ NmM1YjJhZDEwZDYzNmZmNDEzYzA1Y2M2OWRjMzg2ZTkyYmUyNGU5MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzI4OTE0MGY4Nzg1NGRiMDc3NjczYmFmMWIwY2RlZDJmYjA1OGQyZjEyZGJh
10
- YjFmYmJhMTUyYzhmODNjMjc1OWNjNjM2NDg5OWI4MmQ5NGRiYTcyNWQwOTFk
11
- NTQ0YjdjZThmOTA3NWRiNDI5YmI1OGUzODA4MzM0YzQ2OWMyY2Q=
9
+ MjQ1MzAwZTc1Y2Y3NGFlZjdlODM3ZTJiODc4MTgxNzllMzJjZjBiZjUyYTli
10
+ NjBiYzg1ZmQ5MzUzZmM2ZjU1YjMzMmRiNzljZGQ5Y2E4NTFhZjE2YjNjNmE4
11
+ ODE2YTIzNTg2YWM0MDk5NWRhZjNmN2FmNDZiZTQ3NDIwOTVlOTM=
12
12
  data.tar.gz: !binary |-
13
- ZWFjNmEzZjUzMTYyZGEyMzI0MjZlZGUxNWExOGRiYzNkM2I0Njg2ZGE0NzQw
14
- YjA2NWJjYTQxYWMyMjQwYWYyY2Y5ZGE3OWI3NGM1YzYxZmRjMWJhOWE2OWFk
15
- YWI4OTM5YmMwYWMwNThhNDZlMTczNTkxNGM1YjBjNDAyM2ZjMGI=
13
+ NTM1MjQwMTllMDIzMGI4ZmNkYzc4Yjc3OWU5ZWI4MjA5NDQzOTQ5MDUxNjYz
14
+ NDNlODI1NDk5MDRjMmVhZGU5YzM1NDc5MzE3MWY2NDU3NzZiNTU0YWE5Mjkz
15
+ MzlhODgxMDI1ZDZhMTJmMWM0NGY4YTU4MGJlMGNkZDdjZDkxYTQ=
@@ -117,8 +117,4 @@ module HammerCLIKatello
117
117
  'hammer_cli_katello/erratum'
118
118
  )
119
119
 
120
- HammerCLI::MainCommand.lazy_subcommand("docker", _("Manipulate docker content"),
121
- 'HammerCLIKatello::DockerCommand',
122
- 'hammer_cli_katello/docker'
123
- )
124
120
  end
@@ -52,6 +52,7 @@ module HammerCLIKatello
52
52
  field :id, _("ID")
53
53
  field :description, _("Description")
54
54
  field :format_limit, _("Content Host Limit")
55
+ field :auto_attach, _("Auto Attach")
55
56
  from :environment do
56
57
  field :name, _("Lifecycle Environment")
57
58
  end
@@ -20,7 +20,7 @@ module HammerCLIKatello
20
20
  field :uuid, _("ID")
21
21
  field :name, _("Name")
22
22
  from :errata_counts do
23
- field :total, _("Available Errata")
23
+ field :total, _("Installable Errata")
24
24
  end
25
25
  end
26
26
 
@@ -45,7 +45,7 @@ module HammerCLIKatello
45
45
  field :name, _("Content View")
46
46
  end
47
47
  field :entitlementStatus, _("Entitlement Status")
48
- field :releaseVer, _("Release Version")
48
+ field :release_ver, _("Release Version")
49
49
  field :autoheal, _("Autoheal")
50
50
  from :errata_counts do
51
51
  field :security, _("Security Errata")
@@ -113,6 +113,42 @@ module HammerCLIKatello
113
113
  build_options
114
114
  end
115
115
 
116
+ class AvailableIncrementalUpdates < HammerCLIKatello::ListCommand
117
+ resource :systems_bulk_actions, :available_incremental_updates
118
+ command_name 'available-incremental-updates'
119
+
120
+ option("--id", "ID", _("ID of a content host"))
121
+
122
+ def extend_data(data)
123
+ data['environments'] = data['environments'].map { |env| env['name'] }.join(',')
124
+ data
125
+ end
126
+
127
+ output do
128
+ from :content_view_version do
129
+ from :content_view do
130
+ field :name, _("Name")
131
+ end
132
+ field :version, _("Version")
133
+ end
134
+
135
+ field :environments, _("Environments")
136
+ end
137
+
138
+ def request_params
139
+ params = super
140
+ params.delete('exclude')
141
+ params.delete('ids')
142
+
143
+ params[:ids] = params[:id]
144
+ params.delete('id')
145
+
146
+ params
147
+ end
148
+
149
+ build_options :without => [:id]
150
+ end
151
+
116
152
  autoload_subcommands
117
153
 
118
154
  subcommand "package",
@@ -21,7 +21,7 @@ module HammerCLIKatello
21
21
  field :errata_id, _("Erratum ID")
22
22
  field :type, _("Type")
23
23
  field :title, _("Title")
24
- field :available, _("Available")
24
+ field :available, _("Installable")
25
25
  end
26
26
 
27
27
  build_options
@@ -29,11 +29,8 @@ module HammerCLIKatello
29
29
  class CreateCommand < HammerCLIKatello::CreateCommand
30
30
  command_name "add"
31
31
 
32
- option "--id", "ID", _("id of the puppet module to associate")
33
-
34
- def request_params
35
- super.tap { |params| params['uuid'] = params.delete('id') if params['id'] }
36
- end
32
+ option "--id", "ID", _("id of the puppet module to associate"),
33
+ :attribute_name => "option_uuid"
37
34
 
38
35
  success_message _("Puppet module added to content view")
39
36
  failure_message _("Could not add the puppet module")
@@ -72,10 +72,6 @@ module HammerCLIKatello
72
72
  :flag,
73
73
  _("force content view promotion and bypass lifecycle environment restriction")
74
74
 
75
- option "--from-lifecycle-environment", "FROM_ENVIRONMENT",
76
- _("Name of the source environment"), :attribute_name => :option_environment_name
77
- option "--from-lifecycle-environment-id", "FROM_ENVIRONMENT_ID",
78
- _("Id of the source environment"), :attribute_name => :option_environment_id
79
75
  option "--to-lifecycle-environment", "TO_ENVIRONMENT",
80
76
  _("Name of the target environment"), :attribute_name => :option_to_environment_name
81
77
  option "--to-lifecycle-environment-id", "TO_ENVIRONMENT_ID",
@@ -99,7 +95,7 @@ module HammerCLIKatello
99
95
  end
100
96
 
101
97
  build_options do |o|
102
- o.expand(:all).except(:environments)
98
+ o.expand(:all).except(:environments).including(:content_views, :organizations)
103
99
  o.without(:environment_id)
104
100
  end
105
101
  end
@@ -118,6 +114,51 @@ module HammerCLIKatello
118
114
  end
119
115
  end
120
116
 
117
+ class IncrementalUpdate < HammerCLIKatello::Command
118
+ include HammerCLIForemanTasks::Async
119
+
120
+ action :incremental_update
121
+ command_name "incremental-update"
122
+
123
+ success_message _("Incremental update is being performed with task %{id}")
124
+ failure_message _("An error occurred incrementally updating the content view")
125
+
126
+ option('--environment-ids',
127
+ 'ENVIRONMENTS',
128
+ _("list of environment IDs to update the content view version in"),
129
+ :required => true,
130
+ :format => HammerCLI::Options::Normalizers::List.new
131
+ )
132
+
133
+ option('--id',
134
+ 'ID',
135
+ _("ID of a content view version to incrementally update"),
136
+ :required => true
137
+ )
138
+
139
+ def request_params
140
+ params = super
141
+
142
+ params[:content_view_version_environments] = [
143
+ {
144
+ :environment_ids => option_environment_ids,
145
+ :content_view_version_id => params['id']
146
+ }
147
+ ]
148
+
149
+ if params['update_systems']['included'].key?('ids')
150
+ params['update_systems'].delete('excluded')
151
+ else
152
+ params.delete('update_systems')
153
+ end
154
+
155
+ params.delete('id')
156
+ params
157
+ end
158
+
159
+ build_options
160
+ end
161
+
121
162
  autoload_subcommands
122
163
  end
123
164
  end
@@ -10,7 +10,7 @@ module HammerCLIKatello
10
10
 
11
11
  option('--errata',
12
12
  'ERRATA',
13
- _("comma-separated list of errata to install"),
13
+ _("List of Errata to install"),
14
14
  :required => true,
15
15
  :format => HammerCLI::Options::Normalizers::List.new)
16
16
 
@@ -26,7 +26,6 @@ module HammerCLIKatello
26
26
  s("author", _("Puppet module's author to search by")),
27
27
  s("uuid", _("Puppet module's UUID to search by"))
28
28
  ],
29
- :content_view => [s_name(_("Content view name"))],
30
29
  :content_view_version => [s("version", _("Content view version number"))]
31
30
  }
32
31
 
@@ -61,6 +60,7 @@ module HammerCLIKatello
61
60
  def content_view_version_id(options)
62
61
  key_id = HammerCLI.option_accessor_name("id")
63
62
  key_environment_id = HammerCLI.option_accessor_name("environment_id")
63
+ key_content_view_id = HammerCLI.option_accessor_name("content_view_id")
64
64
 
65
65
  return options[key_id] if options[key_id]
66
66
 
@@ -72,6 +72,16 @@ module HammerCLIKatello
72
72
  # Intentionally suppressing the exception,
73
73
  # environment is not always required.
74
74
  end
75
+
76
+ begin
77
+ options[key_content_view_id] ||= content_view_id(
78
+ scoped_options("content_view", options)
79
+ )
80
+ rescue HammerCLIForeman::MissingSeachOptions # rubocop:disable HandleExceptions
81
+ # Intentionally suppressing the exception,
82
+ # content_view is not always required.
83
+ end
84
+
75
85
  find_resource(:content_view_versions, options)['id']
76
86
  end
77
87
 
@@ -87,9 +97,12 @@ module HammerCLIKatello
87
97
 
88
98
  def create_content_view_versions_search_options(options)
89
99
  environment_id = options[HammerCLI.option_accessor_name("environment_id")]
100
+ content_view_id = options[HammerCLI.option_accessor_name("content_view_id")]
90
101
  version = options[HammerCLI.option_accessor_name("version")]
91
102
 
92
103
  search_options = {}
104
+
105
+ search_options['content_view_id'] = content_view_id if content_view_id
93
106
  search_options['environment_id'] = environment_id if environment_id
94
107
  search_options['version'] = version if version
95
108
  search_options
@@ -33,6 +33,10 @@ module HammerCLIKatello
33
33
  field :url, _("URL")
34
34
  field :_publish_via_http, _("Publish Via HTTP")
35
35
  field :full_path, _("Published At")
36
+ field :docker_upstream_name, _("Upstream Repository Name"),
37
+ Fields::Field, :hide_blank => true
38
+ field :container_repository_name, _("Container Repository Name"),
39
+ Fields::Field, :hide_blank => true
36
40
 
37
41
  label _("Product") do
38
42
  from :product do
@@ -61,28 +65,35 @@ module HammerCLIKatello
61
65
  field :package_group_total, _("Package Groups"), Fields::Field, :hide_blank => true
62
66
  field :errata_total, _("Errata"), Fields::Field, :hide_blank => true
63
67
  field :puppet_total, _("Puppet Modules"), Fields::Field, :hide_blank => true
68
+ field :docker_image_total, _("Docker Images"), Fields::Field, :hide_blank => true
69
+ field :docker_tag_total, _("Docker Tags"), Fields::Field, :hide_blank => true
64
70
  end
65
71
  end
66
72
 
67
- def send_request
68
- super.tap do |data|
69
- data["_redhat_repo"] = data["product_type"] == "redhat" ? _("yes") : _("no")
70
- data["_publish_via_http"] = data["unprotected"] ? _("yes") : _("no")
71
- data["_sync_state"] = get_sync_status(data["sync_state"])
72
- setup_content_counts(data)
73
+ def extend_data(data)
74
+ data["_redhat_repo"] = data["product_type"] == "redhat" ? _("yes") : _("no")
75
+ data["_publish_via_http"] = data["unprotected"] ? _("yes") : _("no")
76
+ data["_sync_state"] = get_sync_status(data["sync_state"])
77
+ if data["content_type"] == "yum" && data["gpg_key"]
78
+ data["gpg_key_name"] = data["gpg_key"]["name"]
73
79
  end
80
+
81
+ setup_content_counts(data) if data["content_counts"]
82
+ data
74
83
  end
75
84
 
76
85
  def setup_content_counts(data)
77
- if data["content_type"] == "yum"
78
- if data["content_counts"]
79
- data["package_total"] = data["content_counts"]["rpm"]
80
- data["package_group_total"] = data["content_counts"]["package_group"]
81
- data["errata_total"] = data["content_counts"]["erratum"]
82
- end
83
- data["gpg_key_name"] = data["gpg_key"]["name"] if data["gpg_key"]
84
- else
85
- data["puppet_total"] = data["content_counts"]["puppet_module"] if data["content_counts"]
86
+ content_counts = data["content_counts"]
87
+ case data["content_type"]
88
+ when "yum"
89
+ data["package_total"] = content_counts["rpm"]
90
+ data["package_group_total"] = content_counts["package_group"]
91
+ data["errata_total"] = content_counts["erratum"]
92
+ when "docker"
93
+ data["docker_image_total"] = content_counts["docker_image"]
94
+ data["docker_tag_total"] = content_counts["docker_tag"]
95
+ when "puppet"
96
+ data["puppet_total"] = content_counts["puppet_module"]
86
97
  end
87
98
  end
88
99
 
@@ -44,6 +44,7 @@ module HammerCLIKatello
44
44
  field :basearch, _("Arch")
45
45
  field :releasever, _("Release")
46
46
  end
47
+ field :registry_name, _("Registry Name")
47
48
  field :enabled, _("Enabled"), Fields::Boolean
48
49
  end
49
50
 
@@ -28,15 +28,13 @@ module HammerCLIKatello
28
28
  class CreateCommand < HammerCLIKatello::CreateCommand
29
29
 
30
30
  option "--interval", "INTERVAL", _("how often synchronization should run"),
31
- :default => 'none',
32
31
  :format => HammerCLI::Options::Normalizers::Enum.new(
33
- %w(none hourly daily weekly)
32
+ %w(hourly daily weekly)
34
33
  )
35
34
 
36
35
  option "--sync-date", "SYNC_DATE",
37
36
  _("start date and time of the synchronization defaults to now"),
38
- :format => HammerCLI::Options::Normalizers::DateTime.new,
39
- :default => DateTime.now.strftime("%F %T")
37
+ :format => HammerCLI::Options::Normalizers::DateTime.new
40
38
 
41
39
  success_message _("Sync plan created")
42
40
  failure_message _("Could not create the sync plan")
@@ -48,7 +46,7 @@ module HammerCLIKatello
48
46
 
49
47
  option "--interval", "INTERVAL", _("how often synchronization should run"),
50
48
  :format => HammerCLI::Options::Normalizers::Enum.new(
51
- %w(none hourly daily weekly)
49
+ %w(hourly daily weekly)
52
50
  )
53
51
  option "--sync-date", "SYNC_DATE", _("start date and time of the synchronization"),
54
52
  :format => HammerCLI::Options::Normalizers::DateTime.new
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('0.0.7')
3
+ @version ||= Gem::Version.new('0.0.9')
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
@@ -23,7 +23,7 @@ authors:
23
23
  autorequire:
24
24
  bindir: bin
25
25
  cert_chain: []
26
- date: 2014-12-19 00:00:00.000000000 Z
26
+ date: 2015-03-23 00:00:00.000000000 Z
27
27
  dependencies:
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: hammer_cli_foreman
@@ -67,6 +67,20 @@ dependencies:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: hammer_cli_foreman_docker
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: rake
72
86
  requirement: !ruby/object:Gem::Requirement
@@ -213,9 +227,6 @@ files:
213
227
  - lib/hammer_cli_katello/content_view.rb
214
228
  - lib/hammer_cli_katello/content_view_puppet_module.rb
215
229
  - lib/hammer_cli_katello/content_view_version.rb
216
- - lib/hammer_cli_katello/docker.rb
217
- - lib/hammer_cli_katello/docker_image.rb
218
- - lib/hammer_cli_katello/docker_tag.rb
219
230
  - lib/hammer_cli_katello/erratum.rb
220
231
  - lib/hammer_cli_katello/exception_handler.rb
221
232
  - lib/hammer_cli_katello/filter.rb
@@ -269,9 +280,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
280
  version: '0'
270
281
  requirements: []
271
282
  rubyforge_project:
272
- rubygems_version: 2.2.2
283
+ rubygems_version: 2.4.3
273
284
  signing_key:
274
285
  specification_version: 4
275
286
  summary: Katello commands for Hammer
276
287
  test_files: []
277
- has_rdoc:
@@ -1,13 +0,0 @@
1
- require 'hammer_cli_katello/docker_image'
2
- require 'hammer_cli_katello/docker_tag'
3
-
4
- module HammerCLIKatello
5
- class DockerCommand < HammerCLIKatello::Command
6
- subcommand 'image',
7
- HammerCLIKatello::DockerImageCommand.desc,
8
- HammerCLIKatello::DockerImageCommand
9
- subcommand 'tag',
10
- HammerCLIKatello::DockerTagCommand.desc,
11
- HammerCLIKatello::DockerTagCommand
12
- end
13
- end
@@ -1,36 +0,0 @@
1
- module HammerCLIKatello
2
- class DockerImageCommand < HammerCLIKatello::Command
3
- resource :docker_images
4
- command_name 'image'
5
- desc 'Manage docker images'
6
-
7
- class ListCommand < HammerCLIKatello::ListCommand
8
- output do
9
- field :id, _("ID")
10
- field :image_id, _("Image ID")
11
- field :size, _("Size")
12
- end
13
-
14
- build_options do |o|
15
- o.expand.including(:products, :organizations, :content_views)
16
- end
17
- end
18
-
19
- class InfoCommand < HammerCLIKatello::InfoCommand
20
- output do
21
- field :id, _("ID")
22
- field :image_id, _("Image ID")
23
- field :size, _("Size")
24
-
25
- collection :tags, _("Tags") do
26
- field :repository_id, _("Repository ID")
27
- field :tag, _("Tag")
28
- end
29
- end
30
-
31
- build_options
32
- end
33
-
34
- autoload_subcommands
35
- end
36
- end
@@ -1,35 +0,0 @@
1
- module HammerCLIKatello
2
- class DockerTagCommand < HammerCLIKatello::Command
3
- resource :docker_tags
4
- command_name 'tag'
5
- desc 'Manage docker tags'
6
-
7
- class ListCommand < HammerCLIKatello::ListCommand
8
- output do
9
- field :id, _("ID")
10
- field :tag, _("Tag")
11
- field :repository_id, _("Repository ID")
12
- end
13
-
14
- build_options do |o|
15
- o.expand.including(:products, :organizations, :content_views)
16
- end
17
- end
18
-
19
- class InfoCommand < HammerCLIKatello::InfoCommand
20
- output do
21
- field :id, _("ID")
22
- field :tag, _("Tag")
23
- field :repository_id, _("Repository ID")
24
-
25
- from :image do
26
- field :id, _("Docker Image ID")
27
- end
28
- end
29
-
30
- build_options
31
- end
32
-
33
- autoload_subcommands
34
- end
35
- end