hammer_cli_csv 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/cli_config.yml +2 -1
- data/lib/hammer_cli_csv/base.rb +1 -1
- data/lib/hammer_cli_csv/content_hosts.rb +31 -10
- data/lib/hammer_cli_csv/version.rb +1 -1
- data/locale/Makefile +65 -0
- data/locale/README.md +18 -0
- data/locale/en/LC_MESSAGES/hammer-cli-csv.mo +0 -0
- data/locale/en/hammer-cli-csv.edit.po +454 -0
- data/locale/en/hammer-cli-csv.po +347 -0
- data/locale/en/hammer-cli-csv.po.time_stamp +0 -0
- data/locale/hammer-cli-csv.pot +485 -0
- data/test/fixtures/vcr_cassettes/apipie.yml +16841 -16457
- data/test/fixtures/vcr_cassettes/resources/content_hosts/import_search.yml +39420 -0
- data/test/fixtures/vcr_cassettes/resources/subscriptions/manifest_does_not_exist.yml +18065 -19
- data/test/fixtures/vcr_cassettes/resources/subscriptions/portal_existing_subscription.yml +44306 -40275
- data/test/fixtures/vcr_cassettes/resources/subscriptions/portal_incorrect_login.yml +55 -13
- data/test/fixtures/vcr_cassettes/setup/setup_content_views/setup.yml +18090 -44
- data/test/fixtures/vcr_cassettes/setup/setup_domains/setup.yml +43 -42
- data/test/fixtures/vcr_cassettes/setup/setup_lifecycle_environments/setup.yml +55 -55
- data/test/fixtures/vcr_cassettes/setup/setup_locations/setup.yml +40 -40
- data/test/fixtures/vcr_cassettes/setup/setup_organizations/setup.yml +25 -25
- data/test/fixtures/vcr_cassettes/setup/setup_subscriptions/setup.yml +25 -25
- data/test/resources/content_hosts_test.rb +38 -0
- metadata +11 -2
|
@@ -272,7 +272,7 @@ http_interactions:
|
|
|
272
272
|
message: 'OK '
|
|
273
273
|
headers:
|
|
274
274
|
Date:
|
|
275
|
-
-
|
|
275
|
+
- Wed, 12 Oct 2016 14:11:27 GMT
|
|
276
276
|
Server:
|
|
277
277
|
- WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16)
|
|
278
278
|
Foreman-Version:
|
|
@@ -288,9 +288,9 @@ http_interactions:
|
|
|
288
288
|
Cache-Control:
|
|
289
289
|
- max-age=0, private, must-revalidate
|
|
290
290
|
X-Request-Id:
|
|
291
|
-
-
|
|
291
|
+
- c6e1fafa-59cb-487a-a21b-7a49f8f95d99
|
|
292
292
|
X-Runtime:
|
|
293
|
-
- '0.
|
|
293
|
+
- '0.081399'
|
|
294
294
|
Content-Security-Policy:
|
|
295
295
|
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
|
|
296
296
|
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
|
|
@@ -314,12 +314,12 @@ http_interactions:
|
|
|
314
314
|
Content-Length:
|
|
315
315
|
- '81'
|
|
316
316
|
Set-Cookie:
|
|
317
|
-
- _session_id=
|
|
317
|
+
- _session_id=85e1f5067933b4f510394dc7c372c0f5; path=/; HttpOnly
|
|
318
318
|
body:
|
|
319
319
|
encoding: UTF-8
|
|
320
320
|
string: '{"result":"ok","status":200,"version":"1.14.0-develop","api_version":2}'
|
|
321
321
|
http_version:
|
|
322
|
-
recorded_at:
|
|
322
|
+
recorded_at: Wed, 12 Oct 2016 14:11:27 GMT
|
|
323
323
|
- request:
|
|
324
324
|
method: get
|
|
325
325
|
uri: https://admin:changeme@katello.example.com:50218/api/v2/plugins
|
|
@@ -339,7 +339,7 @@ http_interactions:
|
|
|
339
339
|
message: 'OK '
|
|
340
340
|
headers:
|
|
341
341
|
Date:
|
|
342
|
-
-
|
|
342
|
+
- Wed, 12 Oct 2016 14:11:27 GMT
|
|
343
343
|
Server:
|
|
344
344
|
- WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16)
|
|
345
345
|
Foreman-Version:
|
|
@@ -355,9 +355,9 @@ http_interactions:
|
|
|
355
355
|
Cache-Control:
|
|
356
356
|
- max-age=0, private, must-revalidate
|
|
357
357
|
X-Request-Id:
|
|
358
|
-
-
|
|
358
|
+
- acb3bea2-835a-41ea-8933-0b14612c4d80
|
|
359
359
|
X-Runtime:
|
|
360
|
-
- '0.
|
|
360
|
+
- '0.069202'
|
|
361
361
|
Content-Security-Policy:
|
|
362
362
|
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
|
|
363
363
|
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
|
|
@@ -381,7 +381,7 @@ http_interactions:
|
|
|
381
381
|
Content-Length:
|
|
382
382
|
- '565'
|
|
383
383
|
Set-Cookie:
|
|
384
|
-
- _session_id=
|
|
384
|
+
- _session_id=a52067d8fa99314ec313bf9da9d6f92e; path=/; HttpOnly
|
|
385
385
|
body:
|
|
386
386
|
encoding: ASCII-8BIT
|
|
387
387
|
string: !binary |-
|
|
@@ -411,7 +411,7 @@ http_interactions:
|
|
|
411
411
|
ZW1lbnQgcGx1Z2luIGZvciBGb3JlbWFuIiwidXJsIjoiaHR0cDovL3d3dy5r
|
|
412
412
|
YXRlbGxvLm9yZyIsInZlcnNpb24iOiIzLjMuMCJ9XQp9Cg==
|
|
413
413
|
http_version:
|
|
414
|
-
recorded_at:
|
|
414
|
+
recorded_at: Wed, 12 Oct 2016 14:11:27 GMT
|
|
415
415
|
- request:
|
|
416
416
|
method: get
|
|
417
417
|
uri: https://admin:changeme@katello.example.com:50218/katello/api/organizations?per_page=999999
|
|
@@ -437,7 +437,7 @@ http_interactions:
|
|
|
437
437
|
message: 'OK '
|
|
438
438
|
headers:
|
|
439
439
|
Date:
|
|
440
|
-
-
|
|
440
|
+
- Wed, 12 Oct 2016 14:11:27 GMT
|
|
441
441
|
Server:
|
|
442
442
|
- WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16)
|
|
443
443
|
Foreman-Version:
|
|
@@ -453,9 +453,9 @@ http_interactions:
|
|
|
453
453
|
Cache-Control:
|
|
454
454
|
- max-age=0, private, must-revalidate
|
|
455
455
|
X-Request-Id:
|
|
456
|
-
-
|
|
456
|
+
- e85cdf29-fd82-448c-85e2-943de8b223de
|
|
457
457
|
X-Runtime:
|
|
458
|
-
- '0.
|
|
458
|
+
- '0.080751'
|
|
459
459
|
Content-Security-Policy:
|
|
460
460
|
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
|
|
461
461
|
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
|
|
@@ -479,7 +479,7 @@ http_interactions:
|
|
|
479
479
|
Content-Length:
|
|
480
480
|
- '563'
|
|
481
481
|
Set-Cookie:
|
|
482
|
-
- _session_id=
|
|
482
|
+
- _session_id=032164fd9e82e0623fba39f40546e088; path=/; HttpOnly
|
|
483
483
|
body:
|
|
484
484
|
encoding: ASCII-8BIT
|
|
485
485
|
string: |
|
|
@@ -496,7 +496,7 @@ http_interactions:
|
|
|
496
496
|
"results": [{"label":"Default_Organization","created_at":"2016-09-30 14:47:05 UTC","updated_at":"2016-09-30 14:47:05 UTC","id":1,"name":"Default Organization","title":"Default Organization","description":null},{"label":"testcorp","created_at":"2016-09-30 15:10:48 UTC","updated_at":"2016-09-30 15:10:48 UTC","id":8,"name":"Test Corporation","title":"Test Corporation","description":"Testing today for a better tomorrow"}]
|
|
497
497
|
}
|
|
498
498
|
http_version:
|
|
499
|
-
recorded_at:
|
|
499
|
+
recorded_at: Wed, 12 Oct 2016 14:11:27 GMT
|
|
500
500
|
- request:
|
|
501
501
|
method: get
|
|
502
502
|
uri: https://admin:changeme@katello.example.com:50218/katello/api/organizations/8
|
|
@@ -522,7 +522,7 @@ http_interactions:
|
|
|
522
522
|
message: 'OK '
|
|
523
523
|
headers:
|
|
524
524
|
Date:
|
|
525
|
-
-
|
|
525
|
+
- Wed, 12 Oct 2016 14:11:28 GMT
|
|
526
526
|
Server:
|
|
527
527
|
- WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16)
|
|
528
528
|
Foreman-Version:
|
|
@@ -538,9 +538,9 @@ http_interactions:
|
|
|
538
538
|
Cache-Control:
|
|
539
539
|
- max-age=0, private, must-revalidate
|
|
540
540
|
X-Request-Id:
|
|
541
|
-
-
|
|
541
|
+
- 3d423272-f038-444c-acd3-7eaf10e740a4
|
|
542
542
|
X-Runtime:
|
|
543
|
-
- '
|
|
543
|
+
- '1.389512'
|
|
544
544
|
Content-Security-Policy:
|
|
545
545
|
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
|
|
546
546
|
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
|
|
@@ -564,7 +564,7 @@ http_interactions:
|
|
|
564
564
|
Content-Length:
|
|
565
565
|
- '21677'
|
|
566
566
|
Set-Cookie:
|
|
567
|
-
- _session_id=
|
|
567
|
+
- _session_id=aa6a40b82e4e2612bd822ebf13189d9a; path=/; HttpOnly
|
|
568
568
|
body:
|
|
569
569
|
encoding: ASCII-8BIT
|
|
570
570
|
string: '{"label":"testcorp","owner_details":{"parentOwner":null,"id":"ff808081577b8f0201577ba5d9850003","key":"testcorp","displayName":"Test
|
|
@@ -699,7 +699,7 @@ http_interactions:
|
|
|
699
699
|
global default","template_kind_id":2,"template_kind_name":"PXEGrub"},{"id":1,"name":"PXELinux
|
|
700
700
|
global default","template_kind_id":1,"template_kind_name":"PXELinux"}],"domains":[{"id":1,"name":"test.com"}],"realms":[],"environments":[],"hostgroups":[],"locations":[],"parameters":[],"default_content_view_id":2,"library_id":2}'
|
|
701
701
|
http_version:
|
|
702
|
-
recorded_at:
|
|
702
|
+
recorded_at: Wed, 12 Oct 2016 14:11:28 GMT
|
|
703
703
|
- request:
|
|
704
704
|
method: get
|
|
705
705
|
uri: https://admin:changeme@katello.example.com:50218/katello/api/organizations/8/subscriptions?per_page=999999
|
|
@@ -725,7 +725,7 @@ http_interactions:
|
|
|
725
725
|
message: 'OK '
|
|
726
726
|
headers:
|
|
727
727
|
Date:
|
|
728
|
-
-
|
|
728
|
+
- Wed, 12 Oct 2016 14:11:31 GMT
|
|
729
729
|
Server:
|
|
730
730
|
- WEBrick/1.3.1 (Ruby/2.2.4/2015-12-16)
|
|
731
731
|
Foreman-Version:
|
|
@@ -741,9 +741,9 @@ http_interactions:
|
|
|
741
741
|
Cache-Control:
|
|
742
742
|
- max-age=0, private, must-revalidate
|
|
743
743
|
X-Request-Id:
|
|
744
|
-
-
|
|
744
|
+
- d2eaa71b-8ebb-4e6f-baf5-21739c184c44
|
|
745
745
|
X-Runtime:
|
|
746
|
-
- '
|
|
746
|
+
- '2.139245'
|
|
747
747
|
Content-Security-Policy:
|
|
748
748
|
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
|
|
749
749
|
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
|
|
@@ -767,11 +767,11 @@ http_interactions:
|
|
|
767
767
|
Content-Length:
|
|
768
768
|
- '1972'
|
|
769
769
|
Set-Cookie:
|
|
770
|
-
- _session_id=
|
|
770
|
+
- _session_id=ec89f290defceb9c9c6f6c59bf413f77; path=/; HttpOnly
|
|
771
771
|
body:
|
|
772
772
|
encoding: ASCII-8BIT
|
|
773
773
|
string: |
|
|
774
774
|
{"organization":{},"total":3,"subtotal":3,"page":1,"per_page":"999999","error":null,"search":null,"sort":{"by":null,"order":null},"results":[{"id":1,"cp_id":"ff808081577bae9001577bb702c100da","subscription_id":1,"name":"Red Hat Enterprise Linux for Virtual Datacenters, Premium","start_date":"2016-06-20T04:00:00.000+0000","end_date":"2017-06-20T03:59:59.000+0000","available":1,"quantity":1,"consumed":0,"account_number":5700573,"contract_number":10999116,"support_level":"Premium","product_id":"RH00001","sockets":2,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":0,"multi_entitlement":true,"type":"NORMAL","product_name":"Red Hat Enterprise Linux for Virtual Datacenters, Premium","unmapped_guest":false,"virt_only":false},{"id":4,"cp_id":"ff808081577bae9001577bb703900138","subscription_id":2,"name":"Red Hat Enterprise Linux for Virtual Datacenters, Standard","start_date":"2016-06-20T04:00:00.000+0000","end_date":"2017-06-20T03:59:59.000+0000","available":1,"quantity":1,"consumed":0,"account_number":5700573,"contract_number":10999110,"support_level":"Standard","product_id":"RH00002","sockets":2,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":0,"multi_entitlement":true,"type":"NORMAL","product_name":"Red Hat Enterprise Linux for Virtual Datacenters, Standard","unmapped_guest":false,"virt_only":false},{"id":2,"cp_id":"ff808081577bae9001577bb70420018a","subscription_id":3,"name":"Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)","start_date":"2016-06-20T04:00:00.000+0000","end_date":"2017-06-20T03:59:59.000+0000","available":200,"quantity":200,"consumed":0,"account_number":5700573,"contract_number":10999113,"support_level":"Standard","product_id":"RH00004","sockets":2,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":0,"multi_entitlement":true,"type":"NORMAL","product_name":"Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)","unmapped_guest":false,"virt_only":false}]}
|
|
775
775
|
http_version:
|
|
776
|
-
recorded_at:
|
|
776
|
+
recorded_at: Wed, 12 Oct 2016 14:11:30 GMT
|
|
777
777
|
recorded_with: VCR 3.0.3
|
|
@@ -122,5 +122,43 @@ HELP
|
|
|
122
122
|
|
|
123
123
|
stop_vcr
|
|
124
124
|
end
|
|
125
|
+
|
|
126
|
+
def test_import_search
|
|
127
|
+
start_vcr
|
|
128
|
+
set_user 'admin'
|
|
129
|
+
|
|
130
|
+
file = Tempfile.new('content_hosts_test')
|
|
131
|
+
# rubocop:disable LineLength
|
|
132
|
+
file.write("Name,Count,Organization,Environment,Content View,Host Collections,Virtual,Host,OS,Arch,Sockets,RAM,Cores,SLA,Products,Subscriptions\n")
|
|
133
|
+
file.write("testaaa%d,2,Test Corporation,Library,Default Organization View,,No,,RHEL 6.4,x86_64,2,4 GB,4,Standard,\"69|Red Hat Enterprise Linux Server\",\n")
|
|
134
|
+
file.write("testbbb%d,3,Test Corporation,Library,Default Organization View,,No,,RHEL 6.4,x86_64,4,16 GB,8,Premium,\"69|Red Hat Enterprise Linux Server\",\n")
|
|
135
|
+
# rubocop:enable LineLength
|
|
136
|
+
file.rewind
|
|
137
|
+
|
|
138
|
+
stdout,stderr = capture {
|
|
139
|
+
hammer.run(%W{--reload-cache csv content-hosts --verbose --file #{file.path}})
|
|
140
|
+
}
|
|
141
|
+
assert_equal '', stderr
|
|
142
|
+
|
|
143
|
+
file = Tempfile.new('content_hosts_test')
|
|
144
|
+
# rubocop:disable LineLength
|
|
145
|
+
file.write("Search,Organization,Environment,Content View,Host Collections,Virtual,Host,OS,Arch,Sockets,RAM,Cores,SLA,Products,Subscriptions\n")
|
|
146
|
+
file.write("name ~ testaaa,Test Corporation,Library,Default Organization View,,No,,RHEL 6.4,x86_64,2,4 GB,4,Standard,\"69|Red Hat Enterprise Linux Server\",\"\"\"2|RH00004|Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)|10999113|5700573\"\"\"\n")
|
|
147
|
+
# rubocop:enable LineLength
|
|
148
|
+
file.rewind
|
|
149
|
+
|
|
150
|
+
stdout,stderr = capture {
|
|
151
|
+
hammer.run(%W{--reload-cache csv content-hosts --verbose --file #{file.path}})
|
|
152
|
+
}
|
|
153
|
+
assert_equal '', stderr
|
|
154
|
+
assert_equal "Updating content host 'testaaa0'...done\nUpdating content host 'testaaa1'...done\n", stdout
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
%w{testaaa0 testaaa1 testbbb0 testbbb1 testbbb2}.each do |hostname|
|
|
158
|
+
host_delete(hostname)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
stop_vcr
|
|
162
|
+
end
|
|
125
163
|
end
|
|
126
164
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hammer_cli_csv
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas McKay
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hammer_cli_katello
|
|
@@ -91,6 +91,13 @@ files:
|
|
|
91
91
|
- lib/hammer_cli_csv/utils/config.rb
|
|
92
92
|
- lib/hammer_cli_csv/utils/subscriptions.rb
|
|
93
93
|
- lib/hammer_cli_csv/version.rb
|
|
94
|
+
- locale/Makefile
|
|
95
|
+
- locale/README.md
|
|
96
|
+
- locale/en/LC_MESSAGES/hammer-cli-csv.mo
|
|
97
|
+
- locale/en/hammer-cli-csv.edit.po
|
|
98
|
+
- locale/en/hammer-cli-csv.po
|
|
99
|
+
- locale/en/hammer-cli-csv.po.time_stamp
|
|
100
|
+
- locale/hammer-cli-csv.pot
|
|
94
101
|
- test/apipie_resource_mock.rb
|
|
95
102
|
- test/config.template.yml
|
|
96
103
|
- test/content_views_test.rb
|
|
@@ -132,6 +139,7 @@ files:
|
|
|
132
139
|
- test/fixtures/vcr_cassettes/resources/content_hosts/create_and_update.yml
|
|
133
140
|
- test/fixtures/vcr_cassettes/resources/content_hosts/export.yml
|
|
134
141
|
- test/fixtures/vcr_cassettes/resources/content_hosts/export_subscriptions.yml
|
|
142
|
+
- test/fixtures/vcr_cassettes/resources/content_hosts/import_search.yml
|
|
135
143
|
- test/fixtures/vcr_cassettes/resources/content_hosts/import_single_line.yml
|
|
136
144
|
- test/fixtures/vcr_cassettes/resources/settings/update_settings.yml
|
|
137
145
|
- test/fixtures/vcr_cassettes/resources/settings/update_settings_continue.yml
|
|
@@ -237,6 +245,7 @@ test_files:
|
|
|
237
245
|
- test/fixtures/vcr_cassettes/resources/content_hosts/create_and_update.yml
|
|
238
246
|
- test/fixtures/vcr_cassettes/resources/content_hosts/export.yml
|
|
239
247
|
- test/fixtures/vcr_cassettes/resources/content_hosts/export_subscriptions.yml
|
|
248
|
+
- test/fixtures/vcr_cassettes/resources/content_hosts/import_search.yml
|
|
240
249
|
- test/fixtures/vcr_cassettes/resources/content_hosts/import_single_line.yml
|
|
241
250
|
- test/fixtures/vcr_cassettes/resources/settings/update_settings.yml
|
|
242
251
|
- test/fixtures/vcr_cassettes/resources/settings/update_settings_continue.yml
|