hammer_cli_katello 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDg1YWQ5ZjNjNDBhZWEzNjYzYmNhYjEzNmUxYmM4MTQ2MmExODhmMA==
5
- data.tar.gz: !binary |-
6
- NTQ0ZGIxYTVlODUzNjk2ZTMzNTViY2M2ZWFiNjYxODE0YmUwZjdhZg==
2
+ SHA1:
3
+ metadata.gz: 7123a0103baa87b866772e66d76ddc247cd659c0
4
+ data.tar.gz: a9a0d569eb59f55624cfb4b5e96e0dee515325d9
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MTRlM2I3NDkyMThjMjI4YjljN2Q5MGYwZjlkZDBlMDc5YjgzY2UxMDQ3NTMy
10
- MGQ4MDAyOGJiNDFkOGJkYWU1MzBkYjI3OWQ1MmQ3ODAzZDZkYTljYmM2MjM3
11
- ZDI0MTE1NWExMGY4N2IwOGQ0ZjI1NjZiYzEwMTA5M2ZlMDMyOTg=
12
- data.tar.gz: !binary |-
13
- NTY4YjYxZjAxNzdlMzA3YzU1Nzk2ZGYyOTdlYzBiY2MyMTMwOTk5YWFkZDli
14
- MzI1OTRlN2Q5MzMzMjVjOWQxNDJkODc3YmE2NjhjYjZjMDA4ZDJhYzI1MDVj
15
- YmUwNDhmY2I3ODYxMjExNmZmNjU5ODFiOGY3NzUzOTExY2I4MTk=
6
+ metadata.gz: 4a8266309a3aa8f130777e6fa3db6a9d445693e4b6a04f16a44b06f1068f08fcaa17041ac9ecd873060f731f99efb4d231fe90b1ce072443a999dfa7c7aa4a0a
7
+ data.tar.gz: 325876dc84fd353574a2038311c60773785fc668ebc505658fb99d18d64b046a6c62b81549cb5bfc7968c4545a011cda1877bb7fc46b932d3908ef1bb11c1811
@@ -2,9 +2,6 @@ module HammerCLIKatello
2
2
 
3
3
  class ActivationKeyCommand < HammerCLIKatello::Command
4
4
  resource :activation_keys
5
- class Common
6
- INTEGER_FORMAT = /^-?\d+/
7
- end
8
5
 
9
6
  class ListCommand < HammerCLIKatello::ListCommand
10
7
  include LifecycleEnvironmentNameResolvable
@@ -81,12 +78,10 @@ module HammerCLIKatello
81
78
  success_message _("Activation key created")
82
79
  failure_message _("Could not create the activation key")
83
80
 
84
- def request_params
85
- params = super
86
- if params.key?('max_content_hosts') && !params['max_content_hosts'].match(Common::INTEGER_FORMAT)
87
- fail ::HammerCLI::Validator::ValidationError, 'Content host limit must be an integer'
88
- end
89
- params
81
+ option "--unlimited-content-hosts", :flag, "Set content hosts max to unlimited"
82
+
83
+ validate_options do
84
+ all(:option_unlimited_content_hosts, :option_max_content_hosts).rejected
90
85
  end
91
86
 
92
87
  build_options
@@ -111,6 +106,10 @@ module HammerCLIKatello
111
106
  success_message _("Activation key updated")
112
107
  failure_message _("Could not update the activation key")
113
108
 
109
+ validate_options do
110
+ all(:option_unlimited_content_hosts, :option_max_content_hosts).rejected
111
+ end
112
+
114
113
  build_options
115
114
  end
116
115
 
@@ -2,6 +2,26 @@ module HammerCLIKatello
2
2
  class Capsule < HammerCLIForeman::Command
3
3
  resource :capsules
4
4
 
5
+ module LifecycleEnvironmentNameResolvable
6
+ def lifecycle_environment_resolve_options(options)
7
+ {
8
+ HammerCLI.option_accessor_name("name") => options['option_environment_name'],
9
+ HammerCLI.option_accessor_name("id") => options['option_environment_id'],
10
+ HammerCLI.option_accessor_name("organization_id") => options["option_organization_id"],
11
+ HammerCLI.option_accessor_name("organization_name") => options["option_organization_name"]
12
+ }
13
+ end
14
+
15
+ def all_options
16
+ result = super.clone
17
+ if result['option_environment_name']
18
+ result['option_environment_id'] = resolver.lifecycle_environment_id(
19
+ lifecycle_environment_resolve_options(result))
20
+ end
21
+ result
22
+ end
23
+ end
24
+
5
25
  class ListCommand < HammerCLIKatello::ListCommand
6
26
  action :index
7
27
 
@@ -69,32 +89,47 @@ module HammerCLIKatello
69
89
  end
70
90
 
71
91
  class AddLifecycleEnvironmentCommand < HammerCLIKatello::Command
92
+ include LifecycleEnvironmentNameResolvable
72
93
  resource :capsule_content, :add_lifecycle_environment
73
94
  command_name 'add-lifecycle-environment'
74
95
 
75
96
  success_message _("Lifecycle environment successfully added to the capsule")
76
97
  failure_message _("Could not add the lifecycle environment to the capsule")
77
98
 
99
+ option "--organization-id", "ID", _("Organization ID"),
100
+ :attribute_name => :option_organization_id
101
+ option "--organization", "NAME", _("Organization name"),
102
+ :attribute_name => :option_organization_name
78
103
  build_options
79
104
  end
80
105
 
81
106
  class RemoveLifecycleEnvironmentCommand < HammerCLIKatello::Command
107
+ include LifecycleEnvironmentNameResolvable
82
108
  resource :capsule_content, :remove_lifecycle_environment
83
109
  command_name 'remove-lifecycle-environment'
84
110
 
85
111
  success_message _("Lifecycle environment successfully removed from the capsule")
86
112
  failure_message _("Could not remove the lifecycle environment from the capsule")
87
113
 
114
+ option "--organization-id", "ID", _("Organization ID"),
115
+ :attribute_name => :option_organization_id
116
+ option "--organization", "NAME", _("Organization name"),
117
+ :attribute_name => :option_organization_name
88
118
  build_options
89
119
  end
90
120
 
91
121
  class SyncCommand < HammerCLIForemanTasks::AsyncCommand
122
+ include LifecycleEnvironmentNameResolvable
92
123
  resource :capsule_content, :sync
93
124
  command_name "synchronize"
94
125
 
95
126
  success_message _("Capsule content is being synchronized in task %{id}")
96
127
  failure_message _("Could not synchronize capsule content")
97
128
 
129
+ option "--organization-id", "ID", _("Organization ID"),
130
+ :attribute_name => :option_organization_id
131
+ option "--organization", "NAME", _("Organization name"),
132
+ :attribute_name => :option_organization_name
98
133
  build_options
99
134
  end
100
135
 
@@ -104,6 +104,19 @@ module HammerCLIKatello
104
104
  build_options
105
105
  end
106
106
 
107
+ class CopyCommand < HammerCLIKatello::CreateCommand
108
+ action :copy
109
+
110
+ desc _("Copy a content view")
111
+ command_name "copy"
112
+
113
+ option "--name", "NAME", _("New content view name"), :attribute_name => :option_name
114
+ build_options
115
+
116
+ success_message _("Content view copied")
117
+ failure_message _("Could not copy the content view")
118
+ end
119
+
107
120
  class UpdateCommand < HammerCLIKatello::UpdateCommand
108
121
  success_message _("Content view updated")
109
122
  failure_message _("Could not update the content view")
@@ -8,7 +8,7 @@ module HammerCLIKatello
8
8
 
9
9
  class ListCommand < HammerCLIKatello::ListCommand
10
10
  output do
11
- field :uuid, _("ID")
11
+ field :uuid, _("UUID")
12
12
  field :name, _("Name")
13
13
  field :author, _("Author")
14
14
  field :version, _("Version")
@@ -29,13 +29,15 @@ 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
- :attribute_name => "option_uuid"
32
+ option "--id", "ID", _("(deprecated) id of the puppet module to associate"),
33
+ :attribute_name => "option_uuid",
34
+ :deprecated => _("This option will be removed in Katello 2.5, Use --uuid")
34
35
 
35
36
  success_message _("Puppet module added to content view")
36
37
  failure_message _("Could not add the puppet module")
37
38
 
38
- build_options :without => :uuid
39
+ #build_options :without => :uuid
40
+ build_options
39
41
  end
40
42
 
41
43
  class DeleteCommand < HammerCLIKatello::DeleteCommand
@@ -25,6 +25,7 @@ module HammerCLIKatello
25
25
  field :name, _("Name")
26
26
  field :type, _("Type")
27
27
  field :inclusion, _("Inclusion")
28
+ field :description, _("Description")
28
29
 
29
30
  collection :repositories, _("Repositories") do
30
31
  field :id, _("ID")
@@ -39,6 +39,10 @@ module HammerCLIKatello
39
39
 
40
40
  class IdResolver < HammerCLIForeman::IdResolver
41
41
 
42
+ def capsule_content_id(options)
43
+ smart_proxy_id(options)
44
+ end
45
+
42
46
  def system_id(options)
43
47
  options[HammerCLI.option_accessor_name("id")] || find_resource(:systems, options)['uuid']
44
48
  end
@@ -125,6 +129,14 @@ module HammerCLIKatello
125
129
  create_search_options_without_katello_api(options, api.resource(:organizations))
126
130
  end
127
131
 
132
+ def create_smart_proxies_search_options(options)
133
+ create_search_options_without_katello_api(options, api.resource(:smart_proxies))
134
+ end
135
+
136
+ def create_capsules_search_options(options)
137
+ create_search_options_without_katello_api(options, api.resource(:smart_proxies))
138
+ end
139
+
128
140
  def create_search_options_with_katello_api(options, resource)
129
141
  search_options = {}
130
142
  searchables(resource).each do |s|
@@ -9,7 +9,7 @@ module HammerCLIKatello
9
9
  base.option(
10
10
  "--prior",
11
11
  "PRIOR",
12
- _("Name of the prior enviroment")
12
+ _("Name of the prior environment")
13
13
  )
14
14
  base.validate_options do
15
15
  any(:option_prior, :option_prior_id).required
@@ -28,17 +28,10 @@ module HammerCLIKatello
28
28
  end
29
29
  end
30
30
 
31
- label "pulp_auth" do
31
+ label "pulp_auth", :hide_blank => true do
32
32
  from "pulp_auth" do
33
- field "status", _("Status")
34
- field "_response", _("Server Response")
35
- end
36
- end
37
-
38
- label "elasticsearch" do
39
- from "elasticsearch" do
40
- field "status", _("Status")
41
- field "_response", _("Server Response")
33
+ field "status", _("Status"), Fields::Field, :hide_blank => true
34
+ field "_response", _("Server Response"), Fields::Field, :hide_blank => true
42
35
  end
43
36
  end
44
37
 
@@ -71,7 +64,7 @@ module HammerCLIKatello
71
64
  def get_server_response(service_hash)
72
65
  if service_hash['duration_ms']
73
66
  _("Duration: %sms") % service_hash['duration_ms']
74
- else
67
+ elsif service_hash['message']
75
68
  _("Message: %s") % service_hash['message']
76
69
  end
77
70
  end
@@ -12,7 +12,7 @@ module HammerCLIKatello
12
12
  end
13
13
 
14
14
  build_options do |o|
15
- o.expand(:all).including(:organizations, :content_views)
15
+ o.expand(:all).including(:organizations, :products, :content_views)
16
16
  end
17
17
  end
18
18
 
@@ -54,7 +54,7 @@ module HammerCLIKatello
54
54
 
55
55
  label _("Sync") do
56
56
  field :_sync_state, _("Status")
57
- field :last_sync, _("Last Sync Date"), Fields::Date, :hide_blank => true
57
+ field :last_sync_words, _("Last Sync Date"), Fields::Field, :hide_blank => true
58
58
  end
59
59
 
60
60
  field :created_at, _("Created"), Fields::Date
@@ -73,15 +73,25 @@ module HammerCLIKatello
73
73
  def extend_data(data)
74
74
  data["_redhat_repo"] = data["product_type"] == "redhat" ? _("yes") : _("no")
75
75
  data["_publish_via_http"] = data["unprotected"] ? _("yes") : _("no")
76
- data["_sync_state"] = get_sync_status(data["sync_state"])
76
+
77
77
  if data["content_type"] == "yum" && data["gpg_key"]
78
78
  data["gpg_key_name"] = data["gpg_key"]["name"]
79
79
  end
80
80
 
81
+ setup_sync_state(data)
81
82
  setup_content_counts(data) if data["content_counts"]
82
83
  data
83
84
  end
84
85
 
86
+ def setup_sync_state(data)
87
+ if data['last_sync']
88
+ data['_sync_state'] = get_sync_status(data["last_sync"]["result"])
89
+ data['last_sync'] = data['last_sync_words']
90
+ else
91
+ data['_sync_state'] = _("Not Synced")
92
+ end
93
+ end
94
+
85
95
  def setup_content_counts(data)
86
96
  content_counts = data["content_counts"]
87
97
  case data["content_type"]
@@ -39,7 +39,7 @@ module HammerCLIKatello
39
39
  command_name "available-repositories"
40
40
 
41
41
  output do
42
- field :repo_name, _("Name")
42
+ field :name, _("Name")
43
43
  from :substitutions do
44
44
  field :basearch, _("Arch")
45
45
  field :releasever, _("Release")
@@ -57,7 +57,7 @@ module HammerCLIKatello
57
57
  :required => true, :format => BinaryFile.new
58
58
  end
59
59
 
60
- class DeleteManfiestCommand < HammerCLIKatello::Command
60
+ class DeleteManifestCommand < HammerCLIKatello::Command
61
61
  include HammerCLIForemanTasks::Async
62
62
 
63
63
  resource :subscriptions, :delete_manifest
@@ -71,7 +71,7 @@ module HammerCLIKatello
71
71
  end
72
72
  end
73
73
 
74
- class RefreshManfiestCommand < HammerCLIKatello::Command
74
+ class RefreshManifestCommand < HammerCLIKatello::Command
75
75
  include HammerCLIForemanTasks::Async
76
76
 
77
77
  resource :subscriptions, :refresh_manifest
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('0.0.18')
3
+ @version ||= Gem::Version.new('0.0.19')
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.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
@@ -23,96 +23,90 @@ authors:
23
23
  autorequire:
24
24
  bindir: bin
25
25
  cert_chain: []
26
- date: 2015-09-23 00:00:00.000000000 Z
26
+ date: 2015-12-16 00:00:00.000000000 Z
27
27
  dependencies:
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: hammer_cli_foreman
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.1.3
35
- - - <
36
- - !ruby/object:Gem::Version
37
- version: 0.5.0
34
+ version: '0.5'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
41
38
  requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: 0.1.3
45
- - - <
39
+ - - "~>"
46
40
  - !ruby/object:Gem::Version
47
- version: 0.5.0
41
+ version: '0.5'
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: hammer_cli_foreman_tasks
50
44
  requirement: !ruby/object:Gem::Requirement
51
45
  requirements:
52
- - - ~>
46
+ - - "~>"
53
47
  - !ruby/object:Gem::Version
54
48
  version: 0.0.3
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
52
  requirements:
59
- - - ~>
53
+ - - "~>"
60
54
  - !ruby/object:Gem::Version
61
55
  version: 0.0.3
62
56
  - !ruby/object:Gem::Dependency
63
57
  name: hammer_cli_foreman_bootdisk
64
58
  requirement: !ruby/object:Gem::Requirement
65
59
  requirements:
66
- - - ! '>='
60
+ - - ">="
67
61
  - !ruby/object:Gem::Version
68
62
  version: '0'
69
63
  type: :runtime
70
64
  prerelease: false
71
65
  version_requirements: !ruby/object:Gem::Requirement
72
66
  requirements:
73
- - - ! '>='
67
+ - - ">="
74
68
  - !ruby/object:Gem::Version
75
69
  version: '0'
76
70
  - !ruby/object:Gem::Dependency
77
71
  name: hammer_cli_foreman_docker
78
72
  requirement: !ruby/object:Gem::Requirement
79
73
  requirements:
80
- - - ! '>='
74
+ - - ">="
81
75
  - !ruby/object:Gem::Version
82
76
  version: '0'
83
77
  type: :runtime
84
78
  prerelease: false
85
79
  version_requirements: !ruby/object:Gem::Requirement
86
80
  requirements:
87
- - - ! '>='
81
+ - - ">="
88
82
  - !ruby/object:Gem::Version
89
83
  version: '0'
90
84
  - !ruby/object:Gem::Dependency
91
85
  name: rake
92
86
  requirement: !ruby/object:Gem::Requirement
93
87
  requirements:
94
- - - ! '>='
88
+ - - ">="
95
89
  - !ruby/object:Gem::Version
96
90
  version: '0'
97
91
  type: :development
98
92
  prerelease: false
99
93
  version_requirements: !ruby/object:Gem::Requirement
100
94
  requirements:
101
- - - ! '>='
95
+ - - ">="
102
96
  - !ruby/object:Gem::Version
103
97
  version: '0'
104
98
  - !ruby/object:Gem::Dependency
105
99
  name: thor
106
100
  requirement: !ruby/object:Gem::Requirement
107
101
  requirements:
108
- - - ! '>='
102
+ - - ">="
109
103
  - !ruby/object:Gem::Version
110
104
  version: '0'
111
105
  type: :development
112
106
  prerelease: false
113
107
  version_requirements: !ruby/object:Gem::Requirement
114
108
  requirements:
115
- - - ! '>='
109
+ - - ">="
116
110
  - !ruby/object:Gem::Version
117
111
  version: '0'
118
112
  - !ruby/object:Gem::Dependency
@@ -133,56 +127,56 @@ dependencies:
133
127
  name: minitest-spec-context
134
128
  requirement: !ruby/object:Gem::Requirement
135
129
  requirements:
136
- - - ! '>='
130
+ - - ">="
137
131
  - !ruby/object:Gem::Version
138
132
  version: '0'
139
133
  type: :development
140
134
  prerelease: false
141
135
  version_requirements: !ruby/object:Gem::Requirement
142
136
  requirements:
143
- - - ! '>='
137
+ - - ">="
144
138
  - !ruby/object:Gem::Version
145
139
  version: '0'
146
140
  - !ruby/object:Gem::Dependency
147
141
  name: simplecov
148
142
  requirement: !ruby/object:Gem::Requirement
149
143
  requirements:
150
- - - ! '>='
144
+ - - ">="
151
145
  - !ruby/object:Gem::Version
152
146
  version: '0'
153
147
  type: :development
154
148
  prerelease: false
155
149
  version_requirements: !ruby/object:Gem::Requirement
156
150
  requirements:
157
- - - ! '>='
151
+ - - ">="
158
152
  - !ruby/object:Gem::Version
159
153
  version: '0'
160
154
  - !ruby/object:Gem::Dependency
161
155
  name: mocha
162
156
  requirement: !ruby/object:Gem::Requirement
163
157
  requirements:
164
- - - ! '>='
158
+ - - ">="
165
159
  - !ruby/object:Gem::Version
166
160
  version: '0'
167
161
  type: :development
168
162
  prerelease: false
169
163
  version_requirements: !ruby/object:Gem::Requirement
170
164
  requirements:
171
- - - ! '>='
165
+ - - ">="
172
166
  - !ruby/object:Gem::Version
173
167
  version: '0'
174
168
  - !ruby/object:Gem::Dependency
175
169
  name: ci_reporter
176
170
  requirement: !ruby/object:Gem::Requirement
177
171
  requirements:
178
- - - ! '>='
172
+ - - ">="
179
173
  - !ruby/object:Gem::Version
180
174
  version: '0'
181
175
  type: :development
182
176
  prerelease: false
183
177
  version_requirements: !ruby/object:Gem::Requirement
184
178
  requirements:
185
- - - ! '>='
179
+ - - ">="
186
180
  - !ruby/object:Gem::Version
187
181
  version: '0'
188
182
  - !ruby/object:Gem::Dependency
@@ -203,14 +197,14 @@ dependencies:
203
197
  name: rubocop-checkstyle_formatter
204
198
  requirement: !ruby/object:Gem::Requirement
205
199
  requirements:
206
- - - ! '>='
200
+ - - ">="
207
201
  - !ruby/object:Gem::Version
208
202
  version: '0'
209
203
  type: :development
210
204
  prerelease: false
211
205
  version_requirements: !ruby/object:Gem::Requirement
212
206
  requirements:
213
- - - ! '>='
207
+ - - ">="
214
208
  - !ruby/object:Gem::Version
215
209
  version: '0'
216
210
  description: Hammer-CLI-Katello is a plugin for Hammer to provide connectivity to
@@ -277,17 +271,17 @@ require_paths:
277
271
  - lib
278
272
  required_ruby_version: !ruby/object:Gem::Requirement
279
273
  requirements:
280
- - - ! '>='
274
+ - - ">="
281
275
  - !ruby/object:Gem::Version
282
276
  version: '0'
283
277
  required_rubygems_version: !ruby/object:Gem::Requirement
284
278
  requirements:
285
- - - ! '>='
279
+ - - ">="
286
280
  - !ruby/object:Gem::Version
287
281
  version: '0'
288
282
  requirements: []
289
283
  rubyforge_project:
290
- rubygems_version: 2.4.3
284
+ rubygems_version: 2.4.8
291
285
  signing_key:
292
286
  specification_version: 4
293
287
  summary: Katello commands for Hammer