Project

General

Profile

« Previous | Next » 

Revision 63540c7c

Added by Eric Helms over 8 years ago

Fixes #11030: Add Python support.

View differences:

README.md
Exposing Pulp's juiciest parts. http://www.pulpproject.org/
Latest Live Tested Version: **pulp-server-2.7.0-0.3.beta.el7.noarch**
Latest Live Tested Version: **pulp-server-2.6.2-1.el7.noarch**
Current stable Runcible: https://github.com/Katello/runcible/tree/0.3
lib/runcible/extensions/python_package.rb
module Runcible
module Extensions
class PythonPackage < Runcible::Extensions::Unit
def self.content_type
'python_package'
end
end
end
end
lib/runcible/models/python_distributor.rb
require 'active_support/json'
require 'securerandom'
module Runcible
module Models
class PythonDistributor < Distributor
def initialize(params = {})
super(params)
end
def self.type_id
'python_distributor'
end
def config
to_ret = as_json
to_ret.delete('auto_publish')
to_ret.delete('id')
to_ret
end
end
end
end
lib/runcible/models/python_importer.rb
module Runcible
module Models
class PythonImporter < Importer
ID = 'python_importer'
REPO_TYPE = 'python-repo'
attr_accessor 'feed', 'max_speed', 'max_downloads', 'upstream_name',
'proxy_port', 'proxy_password', 'proxy_username', 'mask_id',
'packages_names'
def id
PythonImporter::ID
end
def repo_type
PythonImporter::REPO_TYPE
end
def config
as_json
end
end
end
end
test/extensions/python_repository_test.rb
require 'rubygems'
require 'minitest/autorun'
require './test/support/repository_support'
require './lib/runcible'
module Extensions
module TestPythonRepositoryBase
def setup
@support = RepositorySupport.new('python')
@extension = TestRuncible.server.extensions.repository
end
end
class TestPythonRepositoryCreate < MiniTest::Unit::TestCase
include TestPythonRepositoryBase
def teardown
@support.destroy_repo
super
end
def test_create_with_importer
response = @extension.create_with_importer(
RepositorySupport.repo_id,
:id => 'python_importer',
:packages_names => ['django']
)
assert_equal 201, response.code
response = @extension.retrieve(RepositorySupport.repo_id, :details => true)
assert_equal RepositorySupport.repo_id, response['id']
assert_equal 'python_importer', response['importers'].first['importer_type_id']
end
def test_create_with_importer_object
mock_importer = Runcible::Models::PythonImporter.new(
:feed => 'https://pypi.python.org/pypi',
:packages_names => ['django']
)
response = @extension.create_with_importer(RepositorySupport.repo_id, mock_importer)
assert_equal 201, response.code
response = @extension.retrieve(RepositorySupport.repo_id, :details => true)
assert_equal RepositorySupport.repo_id, response['id']
assert_equal 'python_importer', response['importers'].first['importer_type_id']
@extension.expects(:create).with(RepositorySupport.repo_id, has_entry(:notes, anything)).returns(true)
@extension.create_with_importer(RepositorySupport.repo_id, Runcible::Models::PythonImporter.new)
end
def test_create_with_distributors
distributors = [{'type_id' => 'python_distributor', 'auto_publish' => true,
'config' => {'publish_dir' => '/path'}}]
response = @extension.create_with_distributors(RepositorySupport.repo_id, distributors)
assert_equal 201, response.code
assert_equal RepositorySupport.repo_id, response['id']
end
def test_create_with_distributor_object
repo_id = RepositorySupport.repo_id + '_distro'
distributor = Runcible::Models::PythonDistributor.new(:id => '123')
response = @extension.create_with_distributors(repo_id, [distributor])
assert_equal 201, response.code
response = @extension.retrieve(repo_id, :details => true)
assert_equal repo_id, response['id']
assert_equal 'python_distributor', response['distributors'].first['distributor_type_id']
ensure
@support.destroy_repo(repo_id)
end
def test_create_with_importer_and_distributors
distributors = [{'type_id' => 'python_distributor', 'auto_publish' => true,
'config' => {'publish_dir' => '/path'}}]
response = @extension.create_with_importer_and_distributors(
RepositorySupport.repo_id,
{:id => 'python_importer', :packages_names => ['django']},
distributors
)
assert_equal 201, response.code
response = @extension.retrieve(RepositorySupport.repo_id, :details => true)
assert_equal RepositorySupport.repo_id, response['id']
assert_equal 'python_distributor', response['distributors'].first['distributor_type_id']
end
def test_create_with_importer_and_distributors_objects
distributors = [Runcible::Models::PythonDistributor.new(:id => '123')]
importer = Runcible::Models::PythonImporter.new
response = @extension.create_with_importer_and_distributors(RepositorySupport.repo_id, importer, distributors)
assert_equal 201, response.code
response = @extension.retrieve(RepositorySupport.repo_id, :details => true)
assert_equal RepositorySupport.repo_id, response['id']
assert_equal 'python_importer', response['importers'].first['importer_type_id']
end
end
class TestPythonRepositorySync < MiniTest::Unit::TestCase
include TestPythonRepositoryBase
def setup
super
end
def teardown
@support.destroy_repo
ensure
super
end
def test_sync_repo_with_python_importer
@support.create_repo(:importer => true, :importer_config => {:package_names => 'django'})
response = @extension.sync(RepositorySupport.repo_id)
tasks = assert_async_response(response)
assert_includes tasks.first['tags'], 'pulp:action:sync'
response = @extension.unit_search(RepositorySupport.repo_id, {})
refute_empty response
end
end
end
test/fixtures/vcr_cassettes/extensions/python_repository_create/create_with_distributor_object.yml
---
http_interactions:
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id_distro","distributors":[{"distributor_type_id":"python_distributor","distributor_config":{},"auto_publish":false,"distributor_id":"123"}]}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '165'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id_distro
Content-Length:
- '340'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id_distro", "description":
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
{}, "_ns": "repos", "_id": {"$oid": "559ec6868097de0f5dcc8709"}, "id": "integration_test_id_distro",
"_href": "/pulp/api/v2/repositories/integration_test_id_distro/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id_distro/?details=true
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '635'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id_distro", "description":
null, "distributors": [{"repo_id": "integration_test_id_distro", "_ns": "repo_distributors",
"last_publish": null, "auto_publish": false, "scheduled_publishes": [], "distributor_type_id":
"python_distributor", "_id": {"$oid": "559ec6868097de0f5dcc870a"}, "config":
{}, "id": "123"}], "last_unit_added": null, "notes": {}, "last_unit_removed":
null, "content_unit_counts": {}, "_ns": "repos", "importers": [], "_id": {"$oid":
"559ec6868097de0f5dcc8709"}, "id": "integration_test_id_distro", "_href":
"/pulp/api/v2/repositories/integration_test_id_distro/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id_distro/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/3755281c-52ff-4a3e-abc5-f563a9a1f72c/",
"task_id": "3755281c-52ff-4a3e-abc5-f563a9a1f72c"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/3755281c-52ff-4a3e-abc5-f563a9a1f72c/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '707'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete",
"_href": "/pulp/api/v2/tasks/3755281c-52ff-4a3e-abc5-f563a9a1f72c/", "task_id":
"3755281c-52ff-4a3e-abc5-f563a9a1f72c", "tags": ["pulp:repository:integration_test_id_distro",
"pulp:action:delete"], "finish_time": "2015-07-09T19:07:50Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:50Z", "traceback": null, "spawned_tasks":
[], "progress_report": {}, "queue": "reserved_resource_worker-0@katello-runcible.example.com.dq",
"state": "finished", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec686eab2b4ff05203834"},
"id": "559ec6868097de0f106cce61"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 404
message: Not Found
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '442'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"http_request_method": "DELETE", "exception": null, "error_message":
"Missing resource(s): repo_id=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/",
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repo_id":
"integration_test_id"}}, "description": "Missing resource(s): repo_id=integration_test_id",
"sub_errors": []}, "traceback": null, "resources": {"repo_id": "integration_test_id"}}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
recorded_with: VCR 2.9.3
test/fixtures/vcr_cassettes/extensions/python_repository_create/create_with_distributors.yml
---
http_interactions:
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id","distributors":[{"distributor_type_id":"python_distributor","distributor_config":{"publish_dir":"/path"},"auto_publish":true,"distributor_id":null}]}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '177'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:46 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id
Content-Length:
- '319'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
{}, "_ns": "repos", "_id": {"$oid": "559ec6828097de0f5dcc86e5"}, "id": "integration_test_id",
"_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:46 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:46 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/ac9b828f-73c3-48aa-a14e-d488982612b7/",
"task_id": "ac9b828f-73c3-48aa-a14e-d488982612b7"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:46 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/ac9b828f-73c3-48aa-a14e-d488982612b7/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:46 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '700'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete",
"_href": "/pulp/api/v2/tasks/ac9b828f-73c3-48aa-a14e-d488982612b7/", "task_id":
"ac9b828f-73c3-48aa-a14e-d488982612b7", "tags": ["pulp:repository:integration_test_id",
"pulp:action:delete"], "finish_time": "2015-07-09T19:07:46Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:46Z", "traceback": null, "spawned_tasks":
[], "progress_report": {}, "queue": "reserved_resource_worker-0@katello-runcible.example.com.dq",
"state": "finished", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec682eab2b4ff05203820"},
"id": "559ec6828097de0f106cce3e"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:46 GMT
recorded_with: VCR 2.9.3
test/fixtures/vcr_cassettes/extensions/python_repository_create/create_with_importer.yml
---
http_interactions:
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id","importer_type_id":"python_importer","importer_config":{"packages_names":["django"]}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '113'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id
Content-Length:
- '319'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
{}, "_ns": "repos", "_id": {"$oid": "559ec6838097de0f5dcc86eb"}, "id": "integration_test_id",
"_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/?details=true
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '608'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "distributors": [], "last_unit_added": null, "notes": {}, "last_unit_removed":
null, "content_unit_counts": {}, "_ns": "repos", "importers": [{"repo_id":
"integration_test_id", "_ns": "repo_importers", "importer_type_id": "python_importer",
"last_sync": null, "scheduled_syncs": [], "_id": {"$oid": "559ec6838097de0f5dcc86ec"},
"config": {"packages_names": ["django"]}, "id": "python_importer"}], "_id":
{"$oid": "559ec6838097de0f5dcc86eb"}, "id": "integration_test_id", "_href":
"/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/7a6d8b36-610d-4ce4-bb22-236b453462b7/",
"task_id": "7a6d8b36-610d-4ce4-bb22-236b453462b7"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/7a6d8b36-610d-4ce4-bb22-236b453462b7/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '700'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete",
"_href": "/pulp/api/v2/tasks/7a6d8b36-610d-4ce4-bb22-236b453462b7/", "task_id":
"7a6d8b36-610d-4ce4-bb22-236b453462b7", "tags": ["pulp:repository:integration_test_id",
"pulp:action:delete"], "finish_time": "2015-07-09T19:07:47Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:47Z", "traceback": null, "spawned_tasks":
[], "progress_report": {}, "queue": "reserved_resource_worker-0@katello-runcible.example.com.dq",
"state": "finished", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec683eab2b4ff05203824"},
"id": "559ec6838097de0f106cce45"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
recorded_with: VCR 2.9.3
test/fixtures/vcr_cassettes/extensions/python_repository_create/create_with_importer_and_distributors.yml
---
http_interactions:
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id","importer_type_id":"python_importer","importer_config":{"packages_names":["django"]},"distributors":[{"distributor_type_id":"python_distributor","distributor_config":{"publish_dir":"/path"},"auto_publish":true,"distributor_id":null}]}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '262'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id
Content-Length:
- '319'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
{}, "_ns": "repos", "_id": {"$oid": "559ec6838097de0f5dcc86f2"}, "id": "integration_test_id",
"_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/?details=true
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '913'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "distributors": [{"repo_id": "integration_test_id", "_ns": "repo_distributors",
"last_publish": null, "auto_publish": true, "scheduled_publishes": [], "distributor_type_id":
"python_distributor", "_id": {"$oid": "559ec6838097de0f5dcc86f4"}, "config":
{"publish_dir": "/path"}, "id": "f2fa1e11-9441-4d61-8ef1-bdad8cb53bc4"}],
"last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
{}, "_ns": "repos", "importers": [{"repo_id": "integration_test_id", "_ns":
"repo_importers", "importer_type_id": "python_importer", "last_sync": null,
"scheduled_syncs": [], "_id": {"$oid": "559ec6838097de0f5dcc86f3"}, "config":
{"packages_names": ["django"]}, "id": "python_importer"}], "_id": {"$oid":
"559ec6838097de0f5dcc86f2"}, "id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:47 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/af8ff53b-16e5-4d6a-ac1a-8d2f85087278/",
"task_id": "af8ff53b-16e5-4d6a-ac1a-8d2f85087278"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:47 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/af8ff53b-16e5-4d6a-ac1a-8d2f85087278/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:48 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '700'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete",
"_href": "/pulp/api/v2/tasks/af8ff53b-16e5-4d6a-ac1a-8d2f85087278/", "task_id":
"af8ff53b-16e5-4d6a-ac1a-8d2f85087278", "tags": ["pulp:repository:integration_test_id",
"pulp:action:delete"], "finish_time": "2015-07-09T19:07:48Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:48Z", "traceback": null, "spawned_tasks":
[], "progress_report": {}, "queue": "reserved_resource_worker-0@katello-runcible.example.com.dq",
"state": "finished", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec683eab2b4ff05203828"},
"id": "559ec6838097de0f106cce4c"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:48 GMT
recorded_with: VCR 2.9.3
test/fixtures/vcr_cassettes/extensions/python_repository_create/create_with_importer_and_distributors_objects.yml
---
http_interactions:
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id","importer_type_id":"python_importer","importer_config":{},"notes":{"_repo-type":"python-repo"},"distributors":[{"distributor_type_id":"python_distributor","distributor_config":{},"auto_publish":false,"distributor_id":"123"}]}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '253'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:49 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id
Content-Length:
- '346'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "last_unit_added": null, "notes": {"_repo-type": "python-repo"}, "last_unit_removed":
null, "content_unit_counts": {}, "_ns": "repos", "_id": {"$oid": "559ec6858097de0f5dcc8701"},
"id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:49 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/?details=true
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:49 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '858'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "distributors": [{"repo_id": "integration_test_id", "_ns": "repo_distributors",
"last_publish": null, "auto_publish": false, "scheduled_publishes": [], "distributor_type_id":
"python_distributor", "_id": {"$oid": "559ec6858097de0f5dcc8703"}, "config":
{}, "id": "123"}], "last_unit_added": null, "notes": {"_repo-type": "python-repo"},
"last_unit_removed": null, "content_unit_counts": {}, "_ns": "repos", "importers":
[{"repo_id": "integration_test_id", "_ns": "repo_importers", "importer_type_id":
"python_importer", "last_sync": null, "scheduled_syncs": [], "_id": {"$oid":
"559ec6858097de0f5dcc8702"}, "config": {}, "id": "python_importer"}], "_id":
{"$oid": "559ec6858097de0f5dcc8701"}, "id": "integration_test_id", "_href":
"/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:49 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:49 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/a048bd56-bf21-4a16-8583-e440756e2cbf/",
"task_id": "a048bd56-bf21-4a16-8583-e440756e2cbf"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:49 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/a048bd56-bf21-4a16-8583-e440756e2cbf/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '700'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete",
"_href": "/pulp/api/v2/tasks/a048bd56-bf21-4a16-8583-e440756e2cbf/", "task_id":
"a048bd56-bf21-4a16-8583-e440756e2cbf", "tags": ["pulp:repository:integration_test_id",
"pulp:action:delete"], "finish_time": "2015-07-09T19:07:49Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:49Z", "traceback": null, "spawned_tasks":
[], "progress_report": {}, "queue": "reserved_resource_worker-0@katello-runcible.example.com.dq",
"state": "finished", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec685eab2b4ff05203830"},
"id": "559ec6858097de0f106cce5a"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
recorded_with: VCR 2.9.3
test/fixtures/vcr_cassettes/extensions/python_repository_create/create_with_importer_object.yml
---
http_interactions:
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id","importer_type_id":"python_importer","importer_config":{"feed":"https://pypi.python.org/pypi","packages_names":["django"]},"notes":{"_repo-type":"python-repo"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '188'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:48 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id
Content-Length:
- '346'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "last_unit_added": null, "notes": {"_repo-type": "python-repo"}, "last_unit_removed":
null, "content_unit_counts": {}, "_ns": "repos", "_id": {"$oid": "559ec6848097de0f5dcc86fa"},
"id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:48 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/?details=true
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:48 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '675'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "distributors": [], "last_unit_added": null, "notes": {"_repo-type":
"python-repo"}, "last_unit_removed": null, "content_unit_counts": {}, "_ns":
"repos", "importers": [{"repo_id": "integration_test_id", "_ns": "repo_importers",
"importer_type_id": "python_importer", "last_sync": null, "scheduled_syncs":
[], "_id": {"$oid": "559ec6848097de0f5dcc86fb"}, "config": {"feed": "https://pypi.python.org/pypi",
"packages_names": ["django"]}, "id": "python_importer"}], "_id": {"$oid":
"559ec6848097de0f5dcc86fa"}, "id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:48 GMT
- request:
method: delete
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:48 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/6ce5b536-29b0-438b-93cf-4156dcedc420/",
"task_id": "6ce5b536-29b0-438b-93cf-4156dcedc420"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:48 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/6ce5b536-29b0-438b-93cf-4156dcedc420/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:49 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '700'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.tasks.repository.delete",
"_href": "/pulp/api/v2/tasks/6ce5b536-29b0-438b-93cf-4156dcedc420/", "task_id":
"6ce5b536-29b0-438b-93cf-4156dcedc420", "tags": ["pulp:repository:integration_test_id",
"pulp:action:delete"], "finish_time": "2015-07-09T19:07:48Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:48Z", "traceback": null, "spawned_tasks":
[], "progress_report": {}, "queue": "reserved_resource_worker-0@katello-runcible.example.com.dq",
"state": "finished", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec684eab2b4ff0520382c"},
"id": "559ec6848097de0f106cce53"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:49 GMT
recorded_with: VCR 2.9.3
test/fixtures/vcr_cassettes/extensions/python_repository_sync/sync_repo_with_python_importer.yml
---
http_interactions:
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 404
message: Not Found
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '427'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"http_request_method": "GET", "exception": null, "error_message":
"Missing resource(s): repo=integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/",
"http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repo":
"integration_test_id"}}, "description": "Missing resource(s): repo=integration_test_id",
"sub_errors": []}, "traceback": null, "resources": {"repo": "integration_test_id"}}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:50 GMT
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/
body:
encoding: UTF-8
string: '{"id":"integration_test_id","importer_type_id":"python_importer","importer_config":{"feed":"https://pypi.python.org","package_names":"django"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '143'
User-Agent:
- Ruby
response:
status:
code: 201
message: Created
headers:
Date:
- Thu, 09 Jul 2015 19:07:50 GMT
Server:
- Apache/2.4.6 (CentOS)
Location:
- integration_test_id
Content-Length:
- '319'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"scratchpad": {}, "display_name": "integration_test_id", "description":
null, "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
{}, "_ns": "repos", "_id": {"$oid": "559ec6878097de0f5dcc8710"}, "id": "integration_test_id",
"_href": "/pulp/api/v2/repositories/integration_test_id/"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:51 GMT
- request:
method: post
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/repositories/integration_test_id/actions/sync/
body:
encoding: UTF-8
string: '{}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
Content-Length:
- '2'
User-Agent:
- Ruby
response:
status:
code: 202
message: Accepted
headers:
Date:
- Thu, 09 Jul 2015 19:07:51 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Encoding:
- utf-8
Content-Length:
- '172'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/4993b49a-4601-4bec-b739-1d8b13e9bf7a/",
"task_id": "4993b49a-4601-4bec-b739-1d8b13e9bf7a"}], "result": null, "error":
null}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:51 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/4993b49a-4601-4bec-b739-1d8b13e9bf7a/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:51 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '1564'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.managers.repo.sync.sync",
"_href": "/pulp/api/v2/tasks/4993b49a-4601-4bec-b739-1d8b13e9bf7a/", "task_id":
"4993b49a-4601-4bec-b739-1d8b13e9bf7a", "tags": ["pulp:repository:integration_test_id",
"pulp:action:sync"], "finish_time": null, "_ns": "task_status", "start_time":
"2015-07-09T19:07:51Z", "traceback": null, "spawned_tasks": [], "progress_report":
{"python_importer": [{"num_success": 0, "description": "Downloading and processing
metadata.", "step_type": "sync_step_metadata", "sub_steps": [{"num_success":
1, "description": "Downloading Python metadata.", "step_type": "sync_step_download_metadata",
"items_total": 1, "state": "IN_PROGRESS", "error_details": [], "details":
"", "num_failures": 0, "step_id": "2981ffae-a91f-4224-b59a-dd07793941f1",
"num_processed": 1}], "items_total": 1, "state": "NOT_STARTED", "error_details":
[], "details": "", "num_failures": 0, "step_id": "2975872b-d9c2-4684-896b-7b1084a73464",
"num_processed": 0}, {"num_success": 0, "description": "Downloading and processing
Python packages.", "step_type": "sync_step_download_packages", "items_total":
1, "state": "NOT_STARTED", "error_details": [], "details": "", "num_failures":
0, "step_id": "daa2184f-2464-47ff-8020-34633f1ad724", "num_processed": 0}]},
"queue": "reserved_resource_worker-0@katello-runcible.example.com.dq", "state":
"running", "worker_name": "reserved_resource_worker-0@katello-runcible.example.com",
"result": null, "error": null, "_id": {"$oid": "559ec687eab2b4ff05203838"},
"id": "559ec6878097de0f106cce68"}'
http_version:
recorded_at: Thu, 09 Jul 2015 19:07:51 GMT
- request:
method: get
uri: https://admin:HqGPfaSyUkZtxSXTSAddjsLBCDJ4UCrN@katello-runcible.example.com/pulp/api/v2/tasks/4993b49a-4601-4bec-b739-1d8b13e9bf7a/
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Content-Type:
- application/json
User-Agent:
- Ruby
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 09 Jul 2015 19:07:52 GMT
Server:
- Apache/2.4.6 (CentOS)
Content-Length:
- '2911'
Connection:
- close
Content-Type:
- application/json
body:
encoding: UTF-8
string: '{"exception": null, "task_type": "pulp.server.managers.repo.sync.sync",
"_href": "/pulp/api/v2/tasks/4993b49a-4601-4bec-b739-1d8b13e9bf7a/", "task_id":
"4993b49a-4601-4bec-b739-1d8b13e9bf7a", "tags": ["pulp:repository:integration_test_id",
"pulp:action:sync"], "finish_time": "2015-07-09T19:07:52Z", "_ns": "task_status",
"start_time": "2015-07-09T19:07:51Z", "traceback": null, "spawned_tasks":
[], "progress_report": {"python_importer": [{"num_success": 1, "description":
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff