Revision 1f392e3e
Added by Eric D Helms over 6 years ago
lib/runcible/extensions/file.rb | ||
---|---|---|
1 |
module Runcible |
|
2 |
module Extensions |
|
3 |
class File < Runcible::Extensions::Unit |
|
4 |
def self.content_type |
|
5 |
'iso' |
|
6 |
end |
|
7 |
end |
|
8 |
end |
|
9 |
end |
lib/runcible/extensions/repository.rb | ||
---|---|---|
327 | 327 |
update(id, :scratchpad => {:tags => tags}) |
328 | 328 |
end |
329 | 329 |
|
330 |
# Retrieves the file IDs for a single repository |
|
331 |
# |
|
332 |
# @param [String] id the ID of the repository |
|
333 |
# @return [RestClient::Response] the set of repository file IDs |
|
334 |
def file_ids(id) |
|
335 |
criteria = {:type_ids => [Runcible::Extensions::File.content_type], |
|
336 |
:fields => {:unit => [], :association => ['unit_id']}} |
|
337 |
|
|
338 |
unit_search(id, criteria).map { |i| i['unit_id'] } |
|
339 |
end |
|
340 |
|
|
341 |
# Retrieves the files for a single repository |
|
342 |
# |
|
343 |
# @param [String] id the ID of the repository |
|
344 |
# @return [RestClient::Response] the set of repository files |
|
345 |
def files(id) |
|
346 |
criteria = {:type_ids => [Runcible::Extensions::File.content_type]} |
|
347 |
unit_search(id, criteria).map { |i| i['metadata'].with_indifferent_access } |
|
348 |
end |
|
349 |
|
|
330 | 350 |
# Creates or updates a sync schedule for a repository |
331 | 351 |
# |
332 | 352 |
# @param [String] repo_id the ID of the repository |
test/extensions/iso_repository_test.rb | ||
---|---|---|
7 | 7 |
module Extensions |
8 | 8 |
module TestIsoRepositoryBase |
9 | 9 |
def setup |
10 |
@support = RepositorySupport.new |
|
10 |
@support = RepositorySupport.new('iso')
|
|
11 | 11 |
@extension = TestRuncible.server.extensions.repository |
12 | 12 |
end |
13 | 13 |
end |
... | ... | |
18 | 18 |
def setup |
19 | 19 |
super |
20 | 20 |
@repo_url = "file://#{RepositorySupport::FIXTURE_PATH}/iso" |
21 |
@repo_id = 'test_repo_iso_fixture'
|
|
21 |
@repo_id = RepositorySupport.repo_id
|
|
22 | 22 |
end |
23 | 23 |
|
24 | 24 |
def teardown |
... | ... | |
36 | 36 |
response = @extension.retrieve(@repo_id, :details => true) |
37 | 37 |
assert_equal @repo_id, response['id'] |
38 | 38 |
assert_equal 'iso_importer', response['importers'].first['importer_type_id'] |
39 |
end |
|
39 | 40 |
|
40 |
response = @extension.sync(@repo_id) |
|
41 |
def test_sync |
|
42 |
@support.create_repo(:importer => true) |
|
43 |
response = @support.sync_repo |
|
41 | 44 |
assert_async_response(response) |
45 |
end |
|
46 |
|
|
47 |
def test_file_ids |
|
48 |
@support.create_and_sync_repo(:importer => true) |
|
49 |
response = @extension.file_ids(RepositorySupport.repo_id) |
|
50 |
refute_empty response |
|
51 |
end |
|
42 | 52 |
|
43 |
response = @extension.sync_history(@repo_id) |
|
44 |
assert_equal 'success', response.first['result'] |
|
53 |
def test_files |
|
54 |
@support.create_and_sync_repo(:importer => true) |
|
55 |
response = @extension.files(RepositorySupport.repo_id) |
|
56 |
refute_empty response |
|
45 | 57 |
end |
46 | 58 |
end |
47 | 59 |
end |
test/fixtures/vcr_cassettes/extensions/iso_repository_create/create_with_importer_and_distributors_objects.yml | ||
---|---|---|
303 | 303 |
"id": "57238a01898f5c862fa3ea61"}' |
304 | 304 |
http_version: |
305 | 305 |
recorded_at: Fri, 29 Apr 2016 16:21:22 GMT |
306 |
recorded_with: VCR 3.0.1 |
|
306 |
- request: |
|
307 |
method: post |
|
308 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/ |
|
309 |
body: |
|
310 |
encoding: UTF-8 |
|
311 |
string: '{"id":"integration_test_id","importer_type_id":"iso_importer","importer_config":{"feed":"file:///var/www/repositories/iso"},"distributors":[{"distributor_type_id":"iso_distributor","distributor_config":{"serve_http":true,"serve_https":true},"auto_publish":false,"distributor_id":"iso_distributor"}]}' |
|
312 |
headers: |
|
313 |
Accept: |
|
314 |
- application/json |
|
315 |
Accept-Encoding: |
|
316 |
- gzip, deflate |
|
317 |
Content-Type: |
|
318 |
- application/json |
|
319 |
Content-Length: |
|
320 |
- '299' |
|
321 |
User-Agent: |
|
322 |
- Ruby |
|
323 |
response: |
|
324 |
status: |
|
325 |
code: 201 |
|
326 |
message: CREATED |
|
327 |
headers: |
|
328 |
Date: |
|
329 |
- Fri, 01 Jul 2016 14:43:39 GMT |
|
330 |
Server: |
|
331 |
- Apache/2.4.6 (CentOS) |
|
332 |
Content-Length: |
|
333 |
- '319' |
|
334 |
Location: |
|
335 |
- https://devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
336 |
Content-Type: |
|
337 |
- application/json; charset=utf-8 |
|
338 |
body: |
|
339 |
encoding: UTF-8 |
|
340 |
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description": |
|
341 |
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts": |
|
342 |
{}, "_ns": "repos", "_id": {"$oid": "5776819b8af3c82a3af4a904"}, "id": "integration_test_id", |
|
343 |
"_href": "/pulp/api/v2/repositories/integration_test_id/"}' |
|
344 |
http_version: |
|
345 |
recorded_at: Fri, 01 Jul 2016 14:43:39 GMT |
|
346 |
- request: |
|
347 |
method: get |
|
348 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/?details=true |
|
349 |
body: |
|
350 |
encoding: US-ASCII |
|
351 |
string: '' |
|
352 |
headers: |
|
353 |
Accept: |
|
354 |
- application/json |
|
355 |
Accept-Encoding: |
|
356 |
- gzip, deflate |
|
357 |
Content-Type: |
|
358 |
- application/json |
|
359 |
User-Agent: |
|
360 |
- Ruby |
|
361 |
response: |
|
362 |
status: |
|
363 |
code: 200 |
|
364 |
message: OK |
|
365 |
headers: |
|
366 |
Date: |
|
367 |
- Fri, 01 Jul 2016 14:43:39 GMT |
|
368 |
Server: |
|
369 |
- Apache/2.4.6 (CentOS) |
|
370 |
Vary: |
|
371 |
- Accept-Encoding |
|
372 |
Content-Length: |
|
373 |
- '1129' |
|
374 |
Content-Type: |
|
375 |
- application/json; charset=utf-8 |
|
376 |
body: |
|
377 |
encoding: ASCII-8BIT |
|
378 |
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description": |
|
379 |
null, "distributors": [{"repo_id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/distributors/iso_distributor/", |
|
380 |
"_ns": "repo_distributors", "last_publish": null, "distributor_type_id": "iso_distributor", |
|
381 |
"auto_publish": false, "scratchpad": {}, "_id": {"$oid": "5776819b8af3c82a3af4a906"}, |
|
382 |
"config": {"serve_https": true, "serve_http": true}, "id": "iso_distributor"}], |
|
383 |
"last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts": |
|
384 |
{}, "_ns": "repos", "importers": [{"scratchpad": null, "_href": "/pulp/api/v2/repositories/integration_test_id/importers/iso_importer/", |
|
385 |
"_ns": "repo_importers", "importer_type_id": "iso_importer", "last_sync": |
|
386 |
null, "repo_id": "integration_test_id", "_id": {"$oid": "5776819b8af3c82a3af4a905"}, |
|
387 |
"config": {"feed": "file:///var/www/repositories/iso"}, "id": "iso_importer"}], |
|
388 |
"locally_stored_units": 0, "_id": {"$oid": "5776819b8af3c82a3af4a904"}, "total_repository_units": |
|
389 |
0, "id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}' |
|
390 |
http_version: |
|
391 |
recorded_at: Fri, 01 Jul 2016 14:43:39 GMT |
|
392 |
- request: |
|
393 |
method: delete |
|
394 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
395 |
body: |
|
396 |
encoding: US-ASCII |
|
397 |
string: '' |
|
398 |
headers: |
|
399 |
Accept: |
|
400 |
- application/json |
|
401 |
Accept-Encoding: |
|
402 |
- gzip, deflate |
|
403 |
Content-Type: |
|
404 |
- application/json |
|
405 |
User-Agent: |
|
406 |
- Ruby |
|
407 |
response: |
|
408 |
status: |
|
409 |
code: 202 |
|
410 |
message: ACCEPTED |
|
411 |
headers: |
|
412 |
Date: |
|
413 |
- Fri, 01 Jul 2016 14:43:39 GMT |
|
414 |
Server: |
|
415 |
- Apache/2.4.6 (CentOS) |
|
416 |
Content-Length: |
|
417 |
- '172' |
|
418 |
Content-Type: |
|
419 |
- application/json; charset=utf-8 |
|
420 |
body: |
|
421 |
encoding: UTF-8 |
|
422 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/4a693baa-4ecc-47dd-971b-fa5d498967b8/", |
|
423 |
"task_id": "4a693baa-4ecc-47dd-971b-fa5d498967b8"}], "result": null, "error": |
|
424 |
null}' |
|
425 |
http_version: |
|
426 |
recorded_at: Fri, 01 Jul 2016 14:43:39 GMT |
|
427 |
- request: |
|
428 |
method: get |
|
429 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/4a693baa-4ecc-47dd-971b-fa5d498967b8/ |
|
430 |
body: |
|
431 |
encoding: US-ASCII |
|
432 |
string: '' |
|
433 |
headers: |
|
434 |
Accept: |
|
435 |
- application/json |
|
436 |
Accept-Encoding: |
|
437 |
- gzip, deflate |
|
438 |
Content-Type: |
|
439 |
- application/json |
|
440 |
User-Agent: |
|
441 |
- Ruby |
|
442 |
response: |
|
443 |
status: |
|
444 |
code: 200 |
|
445 |
message: OK |
|
446 |
headers: |
|
447 |
Date: |
|
448 |
- Fri, 01 Jul 2016 14:43:40 GMT |
|
449 |
Server: |
|
450 |
- Apache/2.4.6 (CentOS) |
|
451 |
Vary: |
|
452 |
- Accept-Encoding |
|
453 |
Content-Length: |
|
454 |
- '678' |
|
455 |
Content-Type: |
|
456 |
- application/json; charset=utf-8 |
|
457 |
body: |
|
458 |
encoding: ASCII-8BIT |
|
459 |
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete", |
|
460 |
"_href": "/pulp/api/v2/tasks/4a693baa-4ecc-47dd-971b-fa5d498967b8/", "task_id": |
|
461 |
"4a693baa-4ecc-47dd-971b-fa5d498967b8", "tags": ["pulp:repository:integration_test_id", |
|
462 |
"pulp:action:delete"], "finish_time": "2016-07-01T14:43:39Z", "_ns": "task_status", |
|
463 |
"start_time": "2016-07-01T14:43:39Z", "traceback": null, "spawned_tasks": |
|
464 |
[], "progress_report": {}, "queue": "reserved_resource_worker-1@devel.example.com.dq", |
|
465 |
"state": "finished", "worker_name": "reserved_resource_worker-1@devel.example.com", |
|
466 |
"result": null, "error": null, "_id": {"$oid": "5776819b9036949adab88912"}, |
|
467 |
"id": "5776819b9036949adab88912"}' |
|
468 |
http_version: |
|
469 |
recorded_at: Fri, 01 Jul 2016 14:43:40 GMT |
|
470 |
recorded_with: VCR 3.0.3 |
test/fixtures/vcr_cassettes/extensions/iso_repository_create/file_ids.yml | ||
---|---|---|
1 |
--- |
|
2 |
http_interactions: |
|
3 |
- request: |
|
4 |
method: delete |
|
5 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
6 |
body: |
|
7 |
encoding: US-ASCII |
|
8 |
string: '' |
|
9 |
headers: |
|
10 |
Accept: |
|
11 |
- application/json |
|
12 |
Accept-Encoding: |
|
13 |
- gzip, deflate |
|
14 |
Content-Type: |
|
15 |
- application/json |
|
16 |
User-Agent: |
|
17 |
- Ruby |
|
18 |
response: |
|
19 |
status: |
|
20 |
code: 404 |
|
21 |
message: NOT FOUND |
|
22 |
headers: |
|
23 |
Date: |
|
24 |
- Fri, 01 Jul 2016 14:43:43 GMT |
|
25 |
Server: |
|
26 |
- Apache/2.4.6 (CentOS) |
|
27 |
Content-Encoding: |
|
28 |
- utf-8 |
|
29 |
Content-Length: |
|
30 |
- '454' |
|
31 |
Content-Type: |
|
32 |
- application/json; charset=utf-8 |
|
33 |
body: |
|
34 |
encoding: UTF-8 |
|
35 |
string: '{"http_request_method": "DELETE", "exception": null, "error_message": |
|
36 |
"Missing resource(s): repository=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/", |
|
37 |
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repository": |
|
38 |
"integration_test_id"}}, "description": "Missing resource(s): repository=integration_test_id", |
|
39 |
"sub_errors": []}, "traceback": null, "resources": {"repository": "integration_test_id"}}' |
|
40 |
http_version: |
|
41 |
recorded_at: Fri, 01 Jul 2016 14:43:43 GMT |
|
42 |
- request: |
|
43 |
method: get |
|
44 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
45 |
body: |
|
46 |
encoding: US-ASCII |
|
47 |
string: '' |
|
48 |
headers: |
|
49 |
Accept: |
|
50 |
- application/json |
|
51 |
Accept-Encoding: |
|
52 |
- gzip, deflate |
|
53 |
Content-Type: |
|
54 |
- application/json |
|
55 |
User-Agent: |
|
56 |
- Ruby |
|
57 |
response: |
|
58 |
status: |
|
59 |
code: 404 |
|
60 |
message: NOT FOUND |
|
61 |
headers: |
|
62 |
Date: |
|
63 |
- Fri, 01 Jul 2016 14:43:43 GMT |
|
64 |
Server: |
|
65 |
- Apache/2.4.6 (CentOS) |
|
66 |
Content-Encoding: |
|
67 |
- utf-8 |
|
68 |
Content-Length: |
|
69 |
- '452' |
|
70 |
Content-Type: |
|
71 |
- application/json; charset=utf-8 |
|
72 |
body: |
|
73 |
encoding: UTF-8 |
|
74 |
string: '{"http_request_method": "GET", "exception": null, "error_message": |
|
75 |
"Missing resource(s): repository=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/?", |
|
76 |
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repository": |
|
77 |
"integration_test_id"}}, "description": "Missing resource(s): repository=integration_test_id", |
|
78 |
"sub_errors": []}, "traceback": null, "resources": {"repository": "integration_test_id"}}' |
|
79 |
http_version: |
|
80 |
recorded_at: Fri, 01 Jul 2016 14:43:43 GMT |
|
81 |
- request: |
|
82 |
method: post |
|
83 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/ |
|
84 |
body: |
|
85 |
encoding: UTF-8 |
|
86 |
string: '{"id":"integration_test_id","importer_type_id":"iso_importer","importer_config":{"feed":"file:///var/www/repositories/iso"}}' |
|
87 |
headers: |
|
88 |
Accept: |
|
89 |
- application/json |
|
90 |
Accept-Encoding: |
|
91 |
- gzip, deflate |
|
92 |
Content-Type: |
|
93 |
- application/json |
|
94 |
Content-Length: |
|
95 |
- '124' |
|
96 |
User-Agent: |
|
97 |
- Ruby |
|
98 |
response: |
|
99 |
status: |
|
100 |
code: 201 |
|
101 |
message: CREATED |
|
102 |
headers: |
|
103 |
Date: |
|
104 |
- Fri, 01 Jul 2016 14:43:43 GMT |
|
105 |
Server: |
|
106 |
- Apache/2.4.6 (CentOS) |
|
107 |
Content-Length: |
|
108 |
- '319' |
|
109 |
Location: |
|
110 |
- https://devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
111 |
Content-Type: |
|
112 |
- application/json; charset=utf-8 |
|
113 |
body: |
|
114 |
encoding: UTF-8 |
|
115 |
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description": |
|
116 |
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts": |
|
117 |
{}, "_ns": "repos", "_id": {"$oid": "577681a08af3c82a3af4a90a"}, "id": "integration_test_id", |
|
118 |
"_href": "/pulp/api/v2/repositories/integration_test_id/"}' |
|
119 |
http_version: |
|
120 |
recorded_at: Fri, 01 Jul 2016 14:43:44 GMT |
|
121 |
- request: |
|
122 |
method: post |
|
123 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/actions/sync/ |
|
124 |
body: |
|
125 |
encoding: UTF-8 |
|
126 |
string: "{}" |
|
127 |
headers: |
|
128 |
Accept: |
|
129 |
- application/json |
|
130 |
Accept-Encoding: |
|
131 |
- gzip, deflate |
|
132 |
Content-Type: |
|
133 |
- application/json |
|
134 |
Content-Length: |
|
135 |
- '2' |
|
136 |
User-Agent: |
|
137 |
- Ruby |
|
138 |
response: |
|
139 |
status: |
|
140 |
code: 202 |
|
141 |
message: ACCEPTED |
|
142 |
headers: |
|
143 |
Date: |
|
144 |
- Fri, 01 Jul 2016 14:43:44 GMT |
|
145 |
Server: |
|
146 |
- Apache/2.4.6 (CentOS) |
|
147 |
Content-Length: |
|
148 |
- '172' |
|
149 |
Content-Type: |
|
150 |
- application/json; charset=utf-8 |
|
151 |
body: |
|
152 |
encoding: UTF-8 |
|
153 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/189cee85-8aec-415b-b7c4-b5934ab5de92/", |
|
154 |
"task_id": "189cee85-8aec-415b-b7c4-b5934ab5de92"}], "result": null, "error": |
|
155 |
null}' |
|
156 |
http_version: |
|
157 |
recorded_at: Fri, 01 Jul 2016 14:43:44 GMT |
|
158 |
- request: |
|
159 |
method: get |
|
160 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/189cee85-8aec-415b-b7c4-b5934ab5de92/ |
|
161 |
body: |
|
162 |
encoding: US-ASCII |
|
163 |
string: '' |
|
164 |
headers: |
|
165 |
Accept: |
|
166 |
- application/json |
|
167 |
Accept-Encoding: |
|
168 |
- gzip, deflate |
|
169 |
Content-Type: |
|
170 |
- application/json |
|
171 |
User-Agent: |
|
172 |
- Ruby |
|
173 |
response: |
|
174 |
status: |
|
175 |
code: 200 |
|
176 |
message: OK |
|
177 |
headers: |
|
178 |
Date: |
|
179 |
- Fri, 01 Jul 2016 14:43:44 GMT |
|
180 |
Server: |
|
181 |
- Apache/2.4.6 (CentOS) |
|
182 |
Vary: |
|
183 |
- Accept-Encoding |
|
184 |
Content-Length: |
|
185 |
- '2487' |
|
186 |
Content-Type: |
|
187 |
- application/json; charset=utf-8 |
|
188 |
body: |
|
189 |
encoding: ASCII-8BIT |
|
190 |
string: '{"exception": null, "task_type": "pulp.server.managers.repo.sync.sync", |
|
191 |
"_href": "/pulp/api/v2/tasks/189cee85-8aec-415b-b7c4-b5934ab5de92/", "task_id": |
|
192 |
"189cee85-8aec-415b-b7c4-b5934ab5de92", "tags": ["pulp:repository:integration_test_id", |
|
193 |
"pulp:action:sync"], "finish_time": "2016-07-01T14:43:44Z", "_ns": "task_status", |
|
194 |
"start_time": "2016-07-01T14:43:44Z", "traceback": "Traceback (most recent |
|
195 |
call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", |
|
196 |
line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", |
|
197 |
line 473, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File |
|
198 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 103, |
|
199 |
in __call__\n return super(PulpTask, self).__call__(*args, **kwargs)\n File |
|
200 |
\"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n return |
|
201 |
self.run(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py\", |
|
202 |
line 760, in sync\n sync_report = sync_repo(transfer_repo, conduit, call_config)\n File |
|
203 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 658, |
|
204 |
in wrap_f\n return f(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/importer.py\", |
|
205 |
line 103, in sync_repo\n report = self.iso_sync.perform_sync()\n File |
|
206 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
207 |
line 220, in perform_sync\n self.add_catalog_entries(local_available_isos)\n File |
|
208 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
209 |
line 186, in add_catalog_entries\n entry.url = unit.url\nAttributeError: |
|
210 |
''ISO'' object has no attribute ''url''\n", "spawned_tasks": [], "progress_report": |
|
211 |
{"iso_importer": {"error_message": null, "traceback": null, "finished_bytes": |
|
212 |
0, "num_isos": null, "state": "manifest_in_progress", "total_bytes": null, |
|
213 |
"state_times": {"not_started": "2016-07-01T14:43:44", "manifest_in_progress": |
|
214 |
"2016-07-01T14:43:44"}, "num_isos_finished": 0, "iso_error_messages": []}}, |
|
215 |
"queue": "reserved_resource_worker-1@devel.example.com.dq", "state": "error", |
|
216 |
"worker_name": "reserved_resource_worker-1@devel.example.com", "result": null, |
|
217 |
"error": {"code": "PLP0000", "data": {}, "description": "''ISO'' object has |
|
218 |
no attribute ''url''", "sub_errors": []}, "_id": {"$oid": "577681a09036949adab88917"}, |
|
219 |
"id": "577681a09036949adab88917"}' |
|
220 |
http_version: |
|
221 |
recorded_at: Fri, 01 Jul 2016 14:43:44 GMT |
|
222 |
- request: |
|
223 |
method: post |
|
224 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/search/units/ |
|
225 |
body: |
|
226 |
encoding: UTF-8 |
|
227 |
string: '{"criteria":{"type_ids":["iso"],"fields":{"unit":[],"association":["unit_id"]}}}' |
|
228 |
headers: |
|
229 |
Accept: |
|
230 |
- application/json |
|
231 |
Accept-Encoding: |
|
232 |
- gzip, deflate |
|
233 |
Content-Type: |
|
234 |
- application/json |
|
235 |
Content-Length: |
|
236 |
- '80' |
|
237 |
User-Agent: |
|
238 |
- Ruby |
|
239 |
response: |
|
240 |
status: |
|
241 |
code: 200 |
|
242 |
message: OK |
|
243 |
headers: |
|
244 |
Date: |
|
245 |
- Fri, 01 Jul 2016 14:43:44 GMT |
|
246 |
Server: |
|
247 |
- Apache/2.4.6 (CentOS) |
|
248 |
Vary: |
|
249 |
- Accept-Encoding |
|
250 |
Content-Length: |
|
251 |
- '209' |
|
252 |
Content-Type: |
|
253 |
- application/json; charset=utf-8 |
|
254 |
body: |
|
255 |
encoding: ASCII-8BIT |
|
256 |
string: '[{"metadata": {"_id": "f09a24f8-f982-4184-8104-ed4097954a06", "_content_type_id": |
|
257 |
"iso"}, "_id": {"$oid": "577681a08af3c8729bd1c047"}, "unit_id": "f09a24f8-f982-4184-8104-ed4097954a06", |
|
258 |
"unit_type_id": "iso"}]' |
|
259 |
http_version: |
|
260 |
recorded_at: Fri, 01 Jul 2016 14:43:44 GMT |
|
261 |
- request: |
|
262 |
method: delete |
|
263 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
264 |
body: |
|
265 |
encoding: US-ASCII |
|
266 |
string: '' |
|
267 |
headers: |
|
268 |
Accept: |
|
269 |
- application/json |
|
270 |
Accept-Encoding: |
|
271 |
- gzip, deflate |
|
272 |
Content-Type: |
|
273 |
- application/json |
|
274 |
User-Agent: |
|
275 |
- Ruby |
|
276 |
response: |
|
277 |
status: |
|
278 |
code: 202 |
|
279 |
message: ACCEPTED |
|
280 |
headers: |
|
281 |
Date: |
|
282 |
- Fri, 01 Jul 2016 14:43:44 GMT |
|
283 |
Server: |
|
284 |
- Apache/2.4.6 (CentOS) |
|
285 |
Content-Length: |
|
286 |
- '172' |
|
287 |
Content-Type: |
|
288 |
- application/json; charset=utf-8 |
|
289 |
body: |
|
290 |
encoding: UTF-8 |
|
291 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/bbbf395d-7f77-4d5c-bf3f-d6ce752128a7/", |
|
292 |
"task_id": "bbbf395d-7f77-4d5c-bf3f-d6ce752128a7"}], "result": null, "error": |
|
293 |
null}' |
|
294 |
http_version: |
|
295 |
recorded_at: Fri, 01 Jul 2016 14:43:44 GMT |
|
296 |
- request: |
|
297 |
method: get |
|
298 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/bbbf395d-7f77-4d5c-bf3f-d6ce752128a7/ |
|
299 |
body: |
|
300 |
encoding: US-ASCII |
|
301 |
string: '' |
|
302 |
headers: |
|
303 |
Accept: |
|
304 |
- application/json |
|
305 |
Accept-Encoding: |
|
306 |
- gzip, deflate |
|
307 |
Content-Type: |
|
308 |
- application/json |
|
309 |
User-Agent: |
|
310 |
- Ruby |
|
311 |
response: |
|
312 |
status: |
|
313 |
code: 200 |
|
314 |
message: OK |
|
315 |
headers: |
|
316 |
Date: |
|
317 |
- Fri, 01 Jul 2016 14:43:45 GMT |
|
318 |
Server: |
|
319 |
- Apache/2.4.6 (CentOS) |
|
320 |
Vary: |
|
321 |
- Accept-Encoding |
|
322 |
Content-Length: |
|
323 |
- '678' |
|
324 |
Content-Type: |
|
325 |
- application/json; charset=utf-8 |
|
326 |
body: |
|
327 |
encoding: ASCII-8BIT |
|
328 |
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete", |
|
329 |
"_href": "/pulp/api/v2/tasks/bbbf395d-7f77-4d5c-bf3f-d6ce752128a7/", "task_id": |
|
330 |
"bbbf395d-7f77-4d5c-bf3f-d6ce752128a7", "tags": ["pulp:repository:integration_test_id", |
|
331 |
"pulp:action:delete"], "finish_time": "2016-07-01T14:43:44Z", "_ns": "task_status", |
|
332 |
"start_time": "2016-07-01T14:43:44Z", "traceback": null, "spawned_tasks": |
|
333 |
[], "progress_report": {}, "queue": "reserved_resource_worker-1@devel.example.com.dq", |
|
334 |
"state": "finished", "worker_name": "reserved_resource_worker-1@devel.example.com", |
|
335 |
"result": null, "error": null, "_id": {"$oid": "577681a09036949adab88918"}, |
|
336 |
"id": "577681a09036949adab88918"}' |
|
337 |
http_version: |
|
338 |
recorded_at: Fri, 01 Jul 2016 14:43:45 GMT |
|
339 |
recorded_with: VCR 3.0.3 |
test/fixtures/vcr_cassettes/extensions/iso_repository_create/files.yml | ||
---|---|---|
1 |
--- |
|
2 |
http_interactions: |
|
3 |
- request: |
|
4 |
method: delete |
|
5 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
6 |
body: |
|
7 |
encoding: US-ASCII |
|
8 |
string: '' |
|
9 |
headers: |
|
10 |
Accept: |
|
11 |
- application/json |
|
12 |
Accept-Encoding: |
|
13 |
- gzip, deflate |
|
14 |
Content-Type: |
|
15 |
- application/json |
|
16 |
User-Agent: |
|
17 |
- Ruby |
|
18 |
response: |
|
19 |
status: |
|
20 |
code: 404 |
|
21 |
message: NOT FOUND |
|
22 |
headers: |
|
23 |
Date: |
|
24 |
- Fri, 01 Jul 2016 14:43:40 GMT |
|
25 |
Server: |
|
26 |
- Apache/2.4.6 (CentOS) |
|
27 |
Content-Encoding: |
|
28 |
- utf-8 |
|
29 |
Content-Length: |
|
30 |
- '454' |
|
31 |
Content-Type: |
|
32 |
- application/json; charset=utf-8 |
|
33 |
body: |
|
34 |
encoding: UTF-8 |
|
35 |
string: '{"http_request_method": "DELETE", "exception": null, "error_message": |
|
36 |
"Missing resource(s): repository=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/", |
|
37 |
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repository": |
|
38 |
"integration_test_id"}}, "description": "Missing resource(s): repository=integration_test_id", |
|
39 |
"sub_errors": []}, "traceback": null, "resources": {"repository": "integration_test_id"}}' |
|
40 |
http_version: |
|
41 |
recorded_at: Fri, 01 Jul 2016 14:43:40 GMT |
|
42 |
- request: |
|
43 |
method: get |
|
44 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
45 |
body: |
|
46 |
encoding: US-ASCII |
|
47 |
string: '' |
|
48 |
headers: |
|
49 |
Accept: |
|
50 |
- application/json |
|
51 |
Accept-Encoding: |
|
52 |
- gzip, deflate |
|
53 |
Content-Type: |
|
54 |
- application/json |
|
55 |
User-Agent: |
|
56 |
- Ruby |
|
57 |
response: |
|
58 |
status: |
|
59 |
code: 404 |
|
60 |
message: NOT FOUND |
|
61 |
headers: |
|
62 |
Date: |
|
63 |
- Fri, 01 Jul 2016 14:43:40 GMT |
|
64 |
Server: |
|
65 |
- Apache/2.4.6 (CentOS) |
|
66 |
Content-Encoding: |
|
67 |
- utf-8 |
|
68 |
Content-Length: |
|
69 |
- '452' |
|
70 |
Content-Type: |
|
71 |
- application/json; charset=utf-8 |
|
72 |
body: |
|
73 |
encoding: UTF-8 |
|
74 |
string: '{"http_request_method": "GET", "exception": null, "error_message": |
|
75 |
"Missing resource(s): repository=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/?", |
|
76 |
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repository": |
|
77 |
"integration_test_id"}}, "description": "Missing resource(s): repository=integration_test_id", |
|
78 |
"sub_errors": []}, "traceback": null, "resources": {"repository": "integration_test_id"}}' |
|
79 |
http_version: |
|
80 |
recorded_at: Fri, 01 Jul 2016 14:43:40 GMT |
|
81 |
- request: |
|
82 |
method: post |
|
83 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/ |
|
84 |
body: |
|
85 |
encoding: UTF-8 |
|
86 |
string: '{"id":"integration_test_id","importer_type_id":"iso_importer","importer_config":{"feed":"file:///var/www/repositories/iso"}}' |
|
87 |
headers: |
|
88 |
Accept: |
|
89 |
- application/json |
|
90 |
Accept-Encoding: |
|
91 |
- gzip, deflate |
|
92 |
Content-Type: |
|
93 |
- application/json |
|
94 |
Content-Length: |
|
95 |
- '124' |
|
96 |
User-Agent: |
|
97 |
- Ruby |
|
98 |
response: |
|
99 |
status: |
|
100 |
code: 201 |
|
101 |
message: CREATED |
|
102 |
headers: |
|
103 |
Date: |
|
104 |
- Fri, 01 Jul 2016 14:43:40 GMT |
|
105 |
Server: |
|
106 |
- Apache/2.4.6 (CentOS) |
|
107 |
Content-Length: |
|
108 |
- '319' |
|
109 |
Location: |
|
110 |
- https://devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
111 |
Content-Type: |
|
112 |
- application/json; charset=utf-8 |
|
113 |
body: |
|
114 |
encoding: UTF-8 |
|
115 |
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description": |
|
116 |
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts": |
|
117 |
{}, "_ns": "repos", "_id": {"$oid": "5776819c8af3c82a3af4a907"}, "id": "integration_test_id", |
|
118 |
"_href": "/pulp/api/v2/repositories/integration_test_id/"}' |
|
119 |
http_version: |
|
120 |
recorded_at: Fri, 01 Jul 2016 14:43:40 GMT |
|
121 |
- request: |
|
122 |
method: post |
|
123 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/actions/sync/ |
|
124 |
body: |
|
125 |
encoding: UTF-8 |
|
126 |
string: "{}" |
|
127 |
headers: |
|
128 |
Accept: |
|
129 |
- application/json |
|
130 |
Accept-Encoding: |
|
131 |
- gzip, deflate |
|
132 |
Content-Type: |
|
133 |
- application/json |
|
134 |
Content-Length: |
|
135 |
- '2' |
|
136 |
User-Agent: |
|
137 |
- Ruby |
|
138 |
response: |
|
139 |
status: |
|
140 |
code: 202 |
|
141 |
message: ACCEPTED |
|
142 |
headers: |
|
143 |
Date: |
|
144 |
- Fri, 01 Jul 2016 14:43:40 GMT |
|
145 |
Server: |
|
146 |
- Apache/2.4.6 (CentOS) |
|
147 |
Content-Length: |
|
148 |
- '172' |
|
149 |
Content-Type: |
|
150 |
- application/json; charset=utf-8 |
|
151 |
body: |
|
152 |
encoding: UTF-8 |
|
153 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/a003b404-521c-4834-8673-007570545fea/", |
|
154 |
"task_id": "a003b404-521c-4834-8673-007570545fea"}], "result": null, "error": |
|
155 |
null}' |
|
156 |
http_version: |
|
157 |
recorded_at: Fri, 01 Jul 2016 14:43:40 GMT |
|
158 |
- request: |
|
159 |
method: get |
|
160 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/a003b404-521c-4834-8673-007570545fea/ |
|
161 |
body: |
|
162 |
encoding: US-ASCII |
|
163 |
string: '' |
|
164 |
headers: |
|
165 |
Accept: |
|
166 |
- application/json |
|
167 |
Accept-Encoding: |
|
168 |
- gzip, deflate |
|
169 |
Content-Type: |
|
170 |
- application/json |
|
171 |
User-Agent: |
|
172 |
- Ruby |
|
173 |
response: |
|
174 |
status: |
|
175 |
code: 200 |
|
176 |
message: OK |
|
177 |
headers: |
|
178 |
Date: |
|
179 |
- Fri, 01 Jul 2016 14:43:41 GMT |
|
180 |
Server: |
|
181 |
- Apache/2.4.6 (CentOS) |
|
182 |
Vary: |
|
183 |
- Accept-Encoding |
|
184 |
Content-Length: |
|
185 |
- '2487' |
|
186 |
Content-Type: |
|
187 |
- application/json; charset=utf-8 |
|
188 |
body: |
|
189 |
encoding: ASCII-8BIT |
|
190 |
string: '{"exception": null, "task_type": "pulp.server.managers.repo.sync.sync", |
|
191 |
"_href": "/pulp/api/v2/tasks/a003b404-521c-4834-8673-007570545fea/", "task_id": |
|
192 |
"a003b404-521c-4834-8673-007570545fea", "tags": ["pulp:repository:integration_test_id", |
|
193 |
"pulp:action:sync"], "finish_time": "2016-07-01T14:43:40Z", "_ns": "task_status", |
|
194 |
"start_time": "2016-07-01T14:43:40Z", "traceback": "Traceback (most recent |
|
195 |
call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", |
|
196 |
line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", |
|
197 |
line 473, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File |
|
198 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 103, |
|
199 |
in __call__\n return super(PulpTask, self).__call__(*args, **kwargs)\n File |
|
200 |
\"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n return |
|
201 |
self.run(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py\", |
|
202 |
line 760, in sync\n sync_report = sync_repo(transfer_repo, conduit, call_config)\n File |
|
203 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 658, |
|
204 |
in wrap_f\n return f(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/importer.py\", |
|
205 |
line 103, in sync_repo\n report = self.iso_sync.perform_sync()\n File |
|
206 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
207 |
line 220, in perform_sync\n self.add_catalog_entries(local_available_isos)\n File |
|
208 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
209 |
line 186, in add_catalog_entries\n entry.url = unit.url\nAttributeError: |
|
210 |
''ISO'' object has no attribute ''url''\n", "spawned_tasks": [], "progress_report": |
|
211 |
{"iso_importer": {"error_message": null, "traceback": null, "finished_bytes": |
|
212 |
0, "num_isos": null, "state": "manifest_in_progress", "total_bytes": null, |
|
213 |
"state_times": {"not_started": "2016-07-01T14:43:40", "manifest_in_progress": |
|
214 |
"2016-07-01T14:43:40"}, "num_isos_finished": 0, "iso_error_messages": []}}, |
|
215 |
"queue": "reserved_resource_worker-1@devel.example.com.dq", "state": "error", |
|
216 |
"worker_name": "reserved_resource_worker-1@devel.example.com", "result": null, |
|
217 |
"error": {"code": "PLP0000", "data": {}, "description": "''ISO'' object has |
|
218 |
no attribute ''url''", "sub_errors": []}, "_id": {"$oid": "5776819c9036949adab88913"}, |
|
219 |
"id": "5776819c9036949adab88913"}' |
|
220 |
http_version: |
|
221 |
recorded_at: Fri, 01 Jul 2016 14:43:41 GMT |
|
222 |
- request: |
|
223 |
method: post |
|
224 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/search/units/ |
|
225 |
body: |
|
226 |
encoding: UTF-8 |
|
227 |
string: '{"criteria":{"type_ids":["iso"]}}' |
|
228 |
headers: |
|
229 |
Accept: |
|
230 |
- application/json |
|
231 |
Accept-Encoding: |
|
232 |
- gzip, deflate |
|
233 |
Content-Type: |
|
234 |
- application/json |
|
235 |
Content-Length: |
|
236 |
- '33' |
|
237 |
User-Agent: |
|
238 |
- Ruby |
|
239 |
response: |
|
240 |
status: |
|
241 |
code: 200 |
|
242 |
message: OK |
|
243 |
headers: |
|
244 |
Date: |
|
245 |
- Fri, 01 Jul 2016 14:43:41 GMT |
|
246 |
Server: |
|
247 |
- Apache/2.4.6 (CentOS) |
|
248 |
Vary: |
|
249 |
- Accept-Encoding |
|
250 |
Content-Length: |
|
251 |
- '722' |
|
252 |
Content-Type: |
|
253 |
- application/json; charset=utf-8 |
|
254 |
body: |
|
255 |
encoding: ASCII-8BIT |
|
256 |
string: '[{"updated": "2016-07-01T14:43:40Z", "repo_id": "integration_test_id", |
|
257 |
"created": "2016-07-01T14:43:40Z", "_ns": "repo_content_units", "unit_id": |
|
258 |
"f09a24f8-f982-4184-8104-ed4097954a06", "unit_type_id": "iso", "_id": {"$oid": |
|
259 |
"5776819c8af3c8729bd1c043"}, "id": "5776819c8af3c8729bd1c043", "metadata": |
|
260 |
{"_storage_path": "/var/lib/pulp/content/units/iso/67/129ce9f2d826ee819b3e14e9478a33786d0a1ce7d3644328c1dc7b275cb798/super_real.iso", |
|
261 |
"name": "super_real.iso", "checksum": "5528306022e1a897e4c1f2b7bde80c7cae12c6e2e2b20e8f1c8ff572c2396392", |
|
262 |
"_last_updated": 1467378687, "_content_type_id": "iso", "downloaded": true, |
|
263 |
"pulp_user_metadata": {}, "_ns": "units_iso", "_id": "f09a24f8-f982-4184-8104-ed4097954a06", |
|
264 |
"size": 14}}]' |
|
265 |
http_version: |
|
266 |
recorded_at: Fri, 01 Jul 2016 14:43:41 GMT |
|
267 |
- request: |
|
268 |
method: delete |
|
269 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
270 |
body: |
|
271 |
encoding: US-ASCII |
|
272 |
string: '' |
|
273 |
headers: |
|
274 |
Accept: |
|
275 |
- application/json |
|
276 |
Accept-Encoding: |
|
277 |
- gzip, deflate |
|
278 |
Content-Type: |
|
279 |
- application/json |
|
280 |
User-Agent: |
|
281 |
- Ruby |
|
282 |
response: |
|
283 |
status: |
|
284 |
code: 202 |
|
285 |
message: ACCEPTED |
|
286 |
headers: |
|
287 |
Date: |
|
288 |
- Fri, 01 Jul 2016 14:43:41 GMT |
|
289 |
Server: |
|
290 |
- Apache/2.4.6 (CentOS) |
|
291 |
Content-Length: |
|
292 |
- '172' |
|
293 |
Content-Type: |
|
294 |
- application/json; charset=utf-8 |
|
295 |
body: |
|
296 |
encoding: UTF-8 |
|
297 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/9e857859-b4e8-4388-80ec-1841dfb157fd/", |
|
298 |
"task_id": "9e857859-b4e8-4388-80ec-1841dfb157fd"}], "result": null, "error": |
|
299 |
null}' |
|
300 |
http_version: |
|
301 |
recorded_at: Fri, 01 Jul 2016 14:43:41 GMT |
|
302 |
- request: |
|
303 |
method: get |
|
304 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/9e857859-b4e8-4388-80ec-1841dfb157fd/ |
|
305 |
body: |
|
306 |
encoding: US-ASCII |
|
307 |
string: '' |
|
308 |
headers: |
|
309 |
Accept: |
|
310 |
- application/json |
|
311 |
Accept-Encoding: |
|
312 |
- gzip, deflate |
|
313 |
Content-Type: |
|
314 |
- application/json |
|
315 |
User-Agent: |
|
316 |
- Ruby |
|
317 |
response: |
|
318 |
status: |
|
319 |
code: 200 |
|
320 |
message: OK |
|
321 |
headers: |
|
322 |
Date: |
|
323 |
- Fri, 01 Jul 2016 14:43:41 GMT |
|
324 |
Server: |
|
325 |
- Apache/2.4.6 (CentOS) |
|
326 |
Vary: |
|
327 |
- Accept-Encoding |
|
328 |
Content-Length: |
|
329 |
- '678' |
|
330 |
Content-Type: |
|
331 |
- application/json; charset=utf-8 |
|
332 |
body: |
|
333 |
encoding: ASCII-8BIT |
|
334 |
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete", |
|
335 |
"_href": "/pulp/api/v2/tasks/9e857859-b4e8-4388-80ec-1841dfb157fd/", "task_id": |
|
336 |
"9e857859-b4e8-4388-80ec-1841dfb157fd", "tags": ["pulp:repository:integration_test_id", |
|
337 |
"pulp:action:delete"], "finish_time": "2016-07-01T14:43:41Z", "_ns": "task_status", |
|
338 |
"start_time": "2016-07-01T14:43:41Z", "traceback": null, "spawned_tasks": |
|
339 |
[], "progress_report": {}, "queue": "reserved_resource_worker-1@devel.example.com.dq", |
|
340 |
"state": "finished", "worker_name": "reserved_resource_worker-1@devel.example.com", |
|
341 |
"result": null, "error": null, "_id": {"$oid": "5776819d9036949adab88914"}, |
|
342 |
"id": "5776819d9036949adab88914"}' |
|
343 |
http_version: |
|
344 |
recorded_at: Fri, 01 Jul 2016 14:43:41 GMT |
|
345 |
recorded_with: VCR 3.0.3 |
test/fixtures/vcr_cassettes/extensions/iso_repository_create/sync.yml | ||
---|---|---|
1 |
--- |
|
2 |
http_interactions: |
|
3 |
- request: |
|
4 |
method: get |
|
5 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
6 |
body: |
|
7 |
encoding: US-ASCII |
|
8 |
string: '' |
|
9 |
headers: |
|
10 |
Accept: |
|
11 |
- application/json |
|
12 |
Accept-Encoding: |
|
13 |
- gzip, deflate |
|
14 |
Content-Type: |
|
15 |
- application/json |
|
16 |
User-Agent: |
|
17 |
- Ruby |
|
18 |
response: |
|
19 |
status: |
|
20 |
code: 404 |
|
21 |
message: NOT FOUND |
|
22 |
headers: |
|
23 |
Date: |
|
24 |
- Fri, 01 Jul 2016 14:43:41 GMT |
|
25 |
Server: |
|
26 |
- Apache/2.4.6 (CentOS) |
|
27 |
Content-Encoding: |
|
28 |
- utf-8 |
|
29 |
Content-Length: |
|
30 |
- '452' |
|
31 |
Content-Type: |
|
32 |
- application/json; charset=utf-8 |
|
33 |
body: |
|
34 |
encoding: UTF-8 |
|
35 |
string: '{"http_request_method": "GET", "exception": null, "error_message": |
|
36 |
"Missing resource(s): repository=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/?", |
|
37 |
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repository": |
|
38 |
"integration_test_id"}}, "description": "Missing resource(s): repository=integration_test_id", |
|
39 |
"sub_errors": []}, "traceback": null, "resources": {"repository": "integration_test_id"}}' |
|
40 |
http_version: |
|
41 |
recorded_at: Fri, 01 Jul 2016 14:43:41 GMT |
|
42 |
- request: |
|
43 |
method: post |
|
44 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/ |
|
45 |
body: |
|
46 |
encoding: UTF-8 |
|
47 |
string: '{"id":"integration_test_id","importer_type_id":"iso_importer","importer_config":{"feed":"file:///var/www/repositories/iso"}}' |
|
48 |
headers: |
|
49 |
Accept: |
|
50 |
- application/json |
|
51 |
Accept-Encoding: |
|
52 |
- gzip, deflate |
|
53 |
Content-Type: |
|
54 |
- application/json |
|
55 |
Content-Length: |
|
56 |
- '124' |
|
57 |
User-Agent: |
|
58 |
- Ruby |
|
59 |
response: |
|
60 |
status: |
|
61 |
code: 201 |
|
62 |
message: CREATED |
|
63 |
headers: |
|
64 |
Date: |
|
65 |
- Fri, 01 Jul 2016 14:43:42 GMT |
|
66 |
Server: |
|
67 |
- Apache/2.4.6 (CentOS) |
|
68 |
Content-Length: |
|
69 |
- '319' |
|
70 |
Location: |
|
71 |
- https://devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
72 |
Content-Type: |
|
73 |
- application/json; charset=utf-8 |
|
74 |
body: |
|
75 |
encoding: UTF-8 |
|
76 |
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description": |
|
77 |
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts": |
|
78 |
{}, "_ns": "repos", "_id": {"$oid": "5776819e8af3c82a3990a07a"}, "id": "integration_test_id", |
|
79 |
"_href": "/pulp/api/v2/repositories/integration_test_id/"}' |
|
80 |
http_version: |
|
81 |
recorded_at: Fri, 01 Jul 2016 14:43:42 GMT |
|
82 |
- request: |
|
83 |
method: post |
|
84 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/actions/sync/ |
|
85 |
body: |
|
86 |
encoding: UTF-8 |
|
87 |
string: "{}" |
|
88 |
headers: |
|
89 |
Accept: |
|
90 |
- application/json |
|
91 |
Accept-Encoding: |
|
92 |
- gzip, deflate |
|
93 |
Content-Type: |
|
94 |
- application/json |
|
95 |
Content-Length: |
|
96 |
- '2' |
|
97 |
User-Agent: |
|
98 |
- Ruby |
|
99 |
response: |
|
100 |
status: |
|
101 |
code: 202 |
|
102 |
message: ACCEPTED |
|
103 |
headers: |
|
104 |
Date: |
|
105 |
- Fri, 01 Jul 2016 14:43:42 GMT |
|
106 |
Server: |
|
107 |
- Apache/2.4.6 (CentOS) |
|
108 |
Content-Length: |
|
109 |
- '172' |
|
110 |
Content-Type: |
|
111 |
- application/json; charset=utf-8 |
|
112 |
body: |
|
113 |
encoding: UTF-8 |
|
114 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/caa5c47b-dbff-41b9-a5aa-12f1bcffca7f/", |
|
115 |
"task_id": "caa5c47b-dbff-41b9-a5aa-12f1bcffca7f"}], "result": null, "error": |
|
116 |
null}' |
|
117 |
http_version: |
|
118 |
recorded_at: Fri, 01 Jul 2016 14:43:42 GMT |
|
119 |
- request: |
|
120 |
method: get |
|
121 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/caa5c47b-dbff-41b9-a5aa-12f1bcffca7f/ |
|
122 |
body: |
|
123 |
encoding: US-ASCII |
|
124 |
string: '' |
|
125 |
headers: |
|
126 |
Accept: |
|
127 |
- application/json |
|
128 |
Accept-Encoding: |
|
129 |
- gzip, deflate |
|
130 |
Content-Type: |
|
131 |
- application/json |
|
132 |
User-Agent: |
|
133 |
- Ruby |
|
134 |
response: |
|
135 |
status: |
|
136 |
code: 200 |
|
137 |
message: OK |
|
138 |
headers: |
|
139 |
Date: |
|
140 |
- Fri, 01 Jul 2016 14:43:42 GMT |
|
141 |
Server: |
|
142 |
- Apache/2.4.6 (CentOS) |
|
143 |
Vary: |
|
144 |
- Accept-Encoding |
|
145 |
Content-Length: |
|
146 |
- '2487' |
|
147 |
Content-Type: |
|
148 |
- application/json; charset=utf-8 |
|
149 |
body: |
|
150 |
encoding: ASCII-8BIT |
|
151 |
string: '{"exception": null, "task_type": "pulp.server.managers.repo.sync.sync", |
|
152 |
"_href": "/pulp/api/v2/tasks/caa5c47b-dbff-41b9-a5aa-12f1bcffca7f/", "task_id": |
|
153 |
"caa5c47b-dbff-41b9-a5aa-12f1bcffca7f", "tags": ["pulp:repository:integration_test_id", |
|
154 |
"pulp:action:sync"], "finish_time": "2016-07-01T14:43:42Z", "_ns": "task_status", |
|
155 |
"start_time": "2016-07-01T14:43:42Z", "traceback": "Traceback (most recent |
|
156 |
call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", |
|
157 |
line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", |
|
158 |
line 473, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File |
|
159 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 103, |
|
160 |
in __call__\n return super(PulpTask, self).__call__(*args, **kwargs)\n File |
|
161 |
\"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n return |
|
162 |
self.run(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py\", |
|
163 |
line 760, in sync\n sync_report = sync_repo(transfer_repo, conduit, call_config)\n File |
|
164 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 658, |
|
165 |
in wrap_f\n return f(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/importer.py\", |
|
166 |
line 103, in sync_repo\n report = self.iso_sync.perform_sync()\n File |
|
167 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
168 |
line 220, in perform_sync\n self.add_catalog_entries(local_available_isos)\n File |
|
169 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
170 |
line 186, in add_catalog_entries\n entry.url = unit.url\nAttributeError: |
|
171 |
''ISO'' object has no attribute ''url''\n", "spawned_tasks": [], "progress_report": |
|
172 |
{"iso_importer": {"error_message": null, "traceback": null, "finished_bytes": |
|
173 |
0, "num_isos": null, "state": "manifest_in_progress", "total_bytes": null, |
|
174 |
"state_times": {"not_started": "2016-07-01T14:43:42", "manifest_in_progress": |
|
175 |
"2016-07-01T14:43:42"}, "num_isos_finished": 0, "iso_error_messages": []}}, |
|
176 |
"queue": "reserved_resource_worker-1@devel.example.com.dq", "state": "error", |
|
177 |
"worker_name": "reserved_resource_worker-1@devel.example.com", "result": null, |
|
178 |
"error": {"code": "PLP0000", "data": {}, "description": "''ISO'' object has |
|
179 |
no attribute ''url''", "sub_errors": []}, "_id": {"$oid": "5776819e9036949adab88915"}, |
|
180 |
"id": "5776819e9036949adab88915"}' |
|
181 |
http_version: |
|
182 |
recorded_at: Fri, 01 Jul 2016 14:43:42 GMT |
|
183 |
- request: |
|
184 |
method: get |
|
185 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/caa5c47b-dbff-41b9-a5aa-12f1bcffca7f/ |
|
186 |
body: |
|
187 |
encoding: US-ASCII |
|
188 |
string: '' |
|
189 |
headers: |
|
190 |
Accept: |
|
191 |
- application/json |
|
192 |
Accept-Encoding: |
|
193 |
- gzip, deflate |
|
194 |
Content-Type: |
|
195 |
- application/json |
|
196 |
User-Agent: |
|
197 |
- Ruby |
|
198 |
response: |
|
199 |
status: |
|
200 |
code: 200 |
|
201 |
message: OK |
|
202 |
headers: |
|
203 |
Date: |
|
204 |
- Fri, 01 Jul 2016 14:43:43 GMT |
|
205 |
Server: |
|
206 |
- Apache/2.4.6 (CentOS) |
|
207 |
Vary: |
|
208 |
- Accept-Encoding |
|
209 |
Content-Length: |
|
210 |
- '2487' |
|
211 |
Content-Type: |
|
212 |
- application/json; charset=utf-8 |
|
213 |
body: |
|
214 |
encoding: ASCII-8BIT |
|
215 |
string: '{"exception": null, "task_type": "pulp.server.managers.repo.sync.sync", |
|
216 |
"_href": "/pulp/api/v2/tasks/caa5c47b-dbff-41b9-a5aa-12f1bcffca7f/", "task_id": |
|
217 |
"caa5c47b-dbff-41b9-a5aa-12f1bcffca7f", "tags": ["pulp:repository:integration_test_id", |
|
218 |
"pulp:action:sync"], "finish_time": "2016-07-01T14:43:42Z", "_ns": "task_status", |
|
219 |
"start_time": "2016-07-01T14:43:42Z", "traceback": "Traceback (most recent |
|
220 |
call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", |
|
221 |
line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", |
|
222 |
line 473, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File |
|
223 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 103, |
|
224 |
in __call__\n return super(PulpTask, self).__call__(*args, **kwargs)\n File |
|
225 |
\"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n return |
|
226 |
self.run(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py\", |
|
227 |
line 760, in sync\n sync_report = sync_repo(transfer_repo, conduit, call_config)\n File |
|
228 |
\"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 658, |
|
229 |
in wrap_f\n return f(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/importer.py\", |
|
230 |
line 103, in sync_repo\n report = self.iso_sync.perform_sync()\n File |
|
231 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
232 |
line 220, in perform_sync\n self.add_catalog_entries(local_available_isos)\n File |
|
233 |
\"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/sync.py\", |
|
234 |
line 186, in add_catalog_entries\n entry.url = unit.url\nAttributeError: |
|
235 |
''ISO'' object has no attribute ''url''\n", "spawned_tasks": [], "progress_report": |
|
236 |
{"iso_importer": {"error_message": null, "traceback": null, "finished_bytes": |
|
237 |
0, "num_isos": null, "state": "manifest_in_progress", "total_bytes": null, |
|
238 |
"state_times": {"not_started": "2016-07-01T14:43:42", "manifest_in_progress": |
|
239 |
"2016-07-01T14:43:42"}, "num_isos_finished": 0, "iso_error_messages": []}}, |
|
240 |
"queue": "reserved_resource_worker-1@devel.example.com.dq", "state": "error", |
|
241 |
"worker_name": "reserved_resource_worker-1@devel.example.com", "result": null, |
|
242 |
"error": {"code": "PLP0000", "data": {}, "description": "''ISO'' object has |
|
243 |
no attribute ''url''", "sub_errors": []}, "_id": {"$oid": "5776819e9036949adab88915"}, |
|
244 |
"id": "5776819e9036949adab88915"}' |
|
245 |
http_version: |
|
246 |
recorded_at: Fri, 01 Jul 2016 14:43:43 GMT |
|
247 |
- request: |
|
248 |
method: delete |
|
249 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/repositories/integration_test_id/ |
|
250 |
body: |
|
251 |
encoding: US-ASCII |
|
252 |
string: '' |
|
253 |
headers: |
|
254 |
Accept: |
|
255 |
- application/json |
|
256 |
Accept-Encoding: |
|
257 |
- gzip, deflate |
|
258 |
Content-Type: |
|
259 |
- application/json |
|
260 |
User-Agent: |
|
261 |
- Ruby |
|
262 |
response: |
|
263 |
status: |
|
264 |
code: 202 |
|
265 |
message: ACCEPTED |
|
266 |
headers: |
|
267 |
Date: |
|
268 |
- Fri, 01 Jul 2016 14:43:43 GMT |
|
269 |
Server: |
|
270 |
- Apache/2.4.6 (CentOS) |
|
271 |
Content-Length: |
|
272 |
- '172' |
|
273 |
Content-Type: |
|
274 |
- application/json; charset=utf-8 |
|
275 |
body: |
|
276 |
encoding: UTF-8 |
|
277 |
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/b1d873e0-ac2b-4d4a-91ee-da1434e37bb0/", |
|
278 |
"task_id": "b1d873e0-ac2b-4d4a-91ee-da1434e37bb0"}], "result": null, "error": |
|
279 |
null}' |
|
280 |
http_version: |
|
281 |
recorded_at: Fri, 01 Jul 2016 14:43:43 GMT |
|
282 |
- request: |
|
283 |
method: get |
|
284 |
uri: https://admin:admin@devel.example.com/pulp/api/v2/tasks/b1d873e0-ac2b-4d4a-91ee-da1434e37bb0/ |
|
285 |
body: |
|
286 |
encoding: US-ASCII |
|
287 |
string: '' |
|
288 |
headers: |
|
289 |
Accept: |
|
290 |
- application/json |
|
291 |
Accept-Encoding: |
|
292 |
- gzip, deflate |
|
293 |
Content-Type: |
|
294 |
- application/json |
|
295 |
User-Agent: |
|
296 |
- Ruby |
|
297 |
response: |
|
298 |
status: |
|
299 |
code: 200 |
|
300 |
message: OK |
|
301 |
headers: |
|
302 |
Date: |
|
303 |
- Fri, 01 Jul 2016 14:43:43 GMT |
|
304 |
Server: |
|
305 |
- Apache/2.4.6 (CentOS) |
|
306 |
Vary: |
|
307 |
- Accept-Encoding |
|
308 |
Content-Length: |
|
309 |
- '678' |
|
310 |
Content-Type: |
|
311 |
- application/json; charset=utf-8 |
|
312 |
body: |
|
313 |
encoding: ASCII-8BIT |
|
314 |
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete", |
|
315 |
"_href": "/pulp/api/v2/tasks/b1d873e0-ac2b-4d4a-91ee-da1434e37bb0/", "task_id": |
|
316 |
"b1d873e0-ac2b-4d4a-91ee-da1434e37bb0", "tags": ["pulp:repository:integration_test_id", |
|
317 |
"pulp:action:delete"], "finish_time": "2016-07-01T14:43:43Z", "_ns": "task_status", |
|
318 |
"start_time": "2016-07-01T14:43:43Z", "traceback": null, "spawned_tasks": |
|
319 |
[], "progress_report": {}, "queue": "reserved_resource_worker-1@devel.example.com.dq", |
|
320 |
"state": "finished", "worker_name": "reserved_resource_worker-1@devel.example.com", |
|
321 |
"result": null, "error": null, "_id": {"$oid": "5776819f9036949adab88916"}, |
|
322 |
"id": "5776819f9036949adab88916"}' |
|
323 |
http_version: |
|
324 |
recorded_at: Fri, 01 Jul 2016 14:43:43 GMT |
|
325 |
recorded_with: VCR 3.0.3 |
test/support/repository_support.rb | ||
---|---|---|
27 | 27 |
elsif @repo_type == 'python' |
28 | 28 |
@distributors = [Runcible::Models::PythonDistributor.new] |
29 | 29 |
@repo_url = "https://pypi.python.org" |
30 |
elsif @repo_type == 'iso' |
|
31 |
@distributors = [Runcible::Models::IsoDistributor.new(true, true, :id => 'iso_distributor')] |
|
32 |
@repo_url = "file://#{RepositorySupport::FIXTURE_PATH}/iso" |
|
30 | 33 |
elsif @repo_type == 'ostree' |
31 | 34 |
@distributors = [Runcible::Models::OstreeDistributor.new(:ostree_publish_directory => '/path', |
32 | 35 |
:id => 'ostree_dist', |
test/unit/base_test.rb | ||
---|---|---|
34 | 34 |
end |
35 | 35 |
|
36 | 36 |
def test_process_response_returns_string |
37 |
response = OpenStruct.new(:body => 'true')
|
|
37 |
response = OpenStruct.new(:body => 'Test body')
|
|
38 | 38 |
data = @my_runcible.process_response(response) |
39 | 39 |
|
40 |
assert_equal 'true', data.body
|
|
40 |
assert_equal 'Test body', data.body
|
|
41 | 41 |
end |
42 | 42 |
|
43 | 43 |
def test_verbose_logger |
Also available in: Unified diff
Fixes #15617: Add ISO repository support (#179)