Project

Profile

Help

Issue #8052

Some repositories cannot be synchronized with error: Artifact() got an unexpected keyword argument 'sha'

Added by pieta about 2 months ago. Updated 16 days ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
OS:
CentOS 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 90
Quarter:

Description

The repositories listed below are not syncing:

Red Hat Enterprise Linux 6 Server RPMs x86_64 6.1 Red Hat Enterprise Linux 6 Server RPMs x86_64 6.3 Red Hat Enterprise Linux 6 Server RPMs x86_64 6.5 Red Hat Enterprise Linux 6 Server RPMs x86_64 6.6 Red Hat Enterprise Linux 7 Server - Supplementary RPMs x86_64 7.0 Red Hat Enterprise Linux 7 Server RPMs x86_64 7.0 Red Hat Enterprise Linux 7 Server - Supplementary RPMs x86_64 7.1

Dec 29 08:20:37 oplrepo-cpd-dmz pulpcore-worker-3: pulp: pulp_rpm.app.tasks.synchronizing:INFO: Synchronizing: repository=Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6_1-7436226 remote=Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6_1-7436734 Dec 29 08:20:38 oplrepo-cpd-dmz pulpcore-api: - - [29/Dec/2020:07:20:38 +0000] "GET /pulp/api/v3/tasks/79a9cc2c-7786-475a-a6a8-4f83ab7d2d12/ HTTP/1.1" 200 606 "-" "OpenAPI-Generator/3.7.1/ruby" Dec 29 08:20:39 oplrepo-cpd-dmz pulpcore-api: - - [29/Dec/2020:07:20:39 +0000] "GET /pulp/api/v3/tasks/79a9cc2c-7786-475a-a6a8-4f83ab7d2d12/ HTTP/1.1" 200 606 "-" "OpenAPI-Generator/3.7.1/ruby" Dec 29 08:20:39 oplrepo-cpd-dmz pulpcore-api: - - [29/Dec/2020:07:20:39 +0000] "GET /pulp/api/v3/tasks/79a9cc2c-7786-475a-a6a8-4f83ab7d2d12/ HTTP/1.1" 200 606 "-" "OpenAPI-Generator/3.7.1/ruby" Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-api: - - [29/Dec/2020:07:20:40 +0000] "GET /pulp/api/v3/tasks/79a9cc2c-7786-475a-a6a8-4f83ab7d2d12/ HTTP/1.1" 200 606 "-" "OpenAPI-Generator/3.7.1/ruby" Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: asyncio:ERROR: Task was destroyed but it is pending! Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: task: <Task pending coro=<Event.wait() done, defined at /usr/lib64/python3.6/asyncio/locks.py:269> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5e591d20d8>()]> cb=[_wait.._on_completion() at /usr/lib64/python3.6/asyncio/tasks.py:380]> Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: asyncio:ERROR: Task was destroyed but it is pending! Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: task: <Task pending coro=<Event.wait() done, defined at /usr/lib64/python3.6/asyncio/locks.py:269> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5e591d2198>()]> cb=[_wait.._on_completion() at /usr/lib64/python3.6/asyncio/tasks.py:380]> Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: asyncio:ERROR: Task was destroyed but it is pending! Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: task: <Task pending coro=<Event.wait() done, defined at /usr/lib64/python3.6/asyncio/locks.py:269> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5e591d2258>()]> cb=[_wait.._on_completion() at /usr/lib64/python3.6/asyncio/tasks.py:380]> Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: asyncio:ERROR: Task was destroyed but it is pending! Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: task: <Task pending coro=<Event.wait() done, defined at /usr/lib64/python3.6/asyncio/locks.py:269> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5e591d2318>()]> cb=[_wait.._on_completion() at /usr/lib64/python3.6/asyncio/tasks.py:380]> Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: asyncio:ERROR: Task was destroyed but it is pending! Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: task: <Task pending coro=<Event.wait() done, defined at /usr/lib64/python3.6/asyncio/locks.py:269> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5e591d23d8>()]> cb=[_wait.._on_completion() at /usr/lib64/python3.6/asyncio/tasks.py:380]> Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: asyncio:ERROR: Task was destroyed but it is pending! Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: task: <Task pending coro=<Event.wait() done, defined at /usr/lib64/python3.6/asyncio/locks.py:269> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5e591d2498>()]> cb=[_wait.._on_completion() at /usr/lib64/python3.6/asyncio/tasks.py:380]> Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: pulp: rq.worker:ERROR: Traceback (most recent call last): Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: rv = job.perform() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: self._result = self._execute() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in execute Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: return self.func(self.args, **self.kwargs) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 266, in synchronize Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: dv.create() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py", line 148, in create Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: loop.run_until_complete(pipeline) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: return future.result() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 225, in create_pipeline Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: await asyncio.gather(*futures) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 43, in call Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: await self.run() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 434, in run Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: await self.parse_repository_metadata() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 477, in parse_repository_metadata Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: repository_metadata_parser.parse() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 711, in parse Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: record_types_oprecord.type Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 741, in set_repomd_file Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: artifact=Artifact(*file_data), Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/app/models/content.py", line 221, in init Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: super().init(args, **kwargs) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py", line 21, in init Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: super().init(*args, **kwargs) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 501, in init Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: raise TypeError("%s() got an unexpected keyword argument '%s'" % (cls.name, kwarg)) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: TypeError: Artifact() got an unexpected keyword argument 'sha' Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: Traceback (most recent call last): Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: rv = job.perform() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: self._result = self._execute() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in execute Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: return self.func(*self.args, **self.kwargs) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 266, in synchronize Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: dv.create() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py", line 148, in create Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: loop.run_until_complete(pipeline) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: return future.result() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 225, in create_pipeline Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: await asyncio.gather(*futures) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 43, in call Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: await self.run() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 434, in run Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: await self.parse_repository_metadata() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 477, in parse_repository_metadata Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: repository_metadata_parser.parse() Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 711, in parse Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: record_types_oprecord.type Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 741, in set_repomd_file Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: artifact=Artifact(*file_data), Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/app/models/content.py", line 221, in init Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: super().init(*args, **kwargs) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py", line 21, in init Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: super().init(*args, **kwargs) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 501, in init Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: raise TypeError("%s() got an unexpected keyword argument '%s'" % (cls.name, kwarg)) Dec 29 08:20:40 oplrepo-cpd-dmz pulpcore-worker-3: TypeError: Artifact() got an unexpected keyword argument 'sha'

Associated revisions

Revision 7e936123 View on GitHub
Added by ggainey 16 days ago

Fixed the places that didn't know that "sha" is an alias for "sha1".

closes #8052

History

#1 Updated by fao89 about 2 months ago

  • Project changed from Pulp to RPM Support

#2 Updated by dalley about 2 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 88

#4 Updated by pieta about 2 months ago

I tried to fix it like this:

[root@oplrepo-cpd-dmz opl-repos]# diff -u /usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py-pieta /usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py
--- /usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py-pieta  2020-12-31 07:10:08.333833492 +0100
+++ /usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py        2020-12-31 08:29:18.331727377 +0100
@@ -586,6 +586,8 @@
             for pkg in packages.values():
                 package = Package(**Package.createrepo_to_dict(pkg))
                 artifact = Artifact(size=package.size_package)
+                if package.checksum_type == "sha":
+                    package.checksum_type = "sha1"
                 checksum_type = getattr(
                     CHECKSUM_TYPES, package.checksum_type.upper()
                 )
@@ -707,6 +709,8 @@
         record_types_op.update(dict.fromkeys(SKIP_REPODATA, lambda _: None))

         for record in self.data.repomd.records:
+            if record.checksum_type == "sha":
+                 record.checksum_type = "sha1"
             self.checksum_types[record.type] = record.checksum_type.upper()
             record_types_op[record.type](record)

Then the repositories sync normally. Unfortunately, the database receives information that the checksum is of the sha type and not sha1 and this causes further problems with the constraint "rpm_package_pkgId_key".

is there a chance that the patch will appear for pulp version 2.21?

#5 Updated by dalley about 1 month ago

@pieta, just to be clear, the information you posted shows that you're using Pulp 3 rather than Pulp 2. I wouldn't expect 2.21 to be affected by this issue.

#6 Updated by pieta about 1 month ago

I use this version:

[root@oplrepo-cpd-dmz SRPMS]# rpm -q -a | grep ^pulp pulp-selinux-2.21.4-2.el7.noarch pulp-ostree-admin-extensions-1.4.0-1.el7.noarch pulp-admin-client-2.21.4-2.el7.noarch pulp-deb-plugins-1.10.2-1.el7.noarch pulp-docker-admin-extensions-3.2.8-1.el7.noarch pulp-server-2.21.4-2.el7.noarch pulp-puppet-tools-2.21.4-1.el7.noarch pulp-deb-admin-extensions-1.10.2-1.el7.noarch pulp-nodes-admin-extensions-2.21.4-2.el7.noarch pulp-client-1.0-1.noarch pulp-nodes-common-2.21.4-2.el7.noarch pulp-python-admin-extensions-2.0.4-1.el7.noarch pulp-puppet-admin-extensions-2.21.4-1.el7.noarch pulp-puppet-plugins-2.21.4-1.el7.noarch pulp-docker-plugins-3.2.8-1.el7.noarch pulp-rpm-plugins-2.21.4-2.el7.noarch pulp-rpm-admin-extensions-2.21.4-2.el7.noarch pulp-katello-1.0.3-1.el7.noarch

#7 Updated by ipanova@redhat.com about 1 month ago

The traceback points to pulp3 version, can you please provide what version of pulp3 you have installed? 'rpm -q -a grep pulp'

Also, can you please provide steps to reproduce? How did you create repo, sync, etc?

#8 Updated by rchan about 1 month ago

  • Sprint changed from Sprint 88 to Sprint 89

#9 Updated by pieta about 1 month ago

[root@oplrepo-cpd-dmz ~]# rpm -q -a| grep pulp pulp-selinux-2.21.4-2.el7.noarch python3-pulp-certguard-1.0.3-1.el7.noarch tfm-rubygem-pulp_deb_client-2.7.0-1.el7.noarch pulp-ostree-admin-extensions-1.4.0-1.el7.noarch python3-pulp-2to3-migration-0.6.0-2.el7.noarch pulp-admin-client-2.21.4-2.el7.noarch tfm-rubygem-pulp_container_client-2.1.0-1.el7.noarch pulp-deb-plugins-1.10.2-1.el7.noarch pulp-docker-admin-extensions-3.2.8-1.el7.noarch pulp-server-2.21.4-2.el7.noarch pulp-puppet-tools-2.21.4-1.el7.noarch python-pulp-bindings-2.21.4-2.el7.noarch pulp-deb-admin-extensions-1.10.2-1.el7.noarch python-pulp-python-common-2.0.4-1.el7.noarch pulp-nodes-admin-extensions-2.21.4-2.el7.noarch python-pulp-common-2.21.4-2.el7.noarch tfm-rubygem-pulp_rpm_client-3.7.0-1.el7.noarch pulp-client-1.0-1.noarch python-pulp-puppet-common-2.21.4-1.el7.noarch python-pulp-client-lib-2.21.4-2.el7.noarch python3-pulp-deb-2.7.0-1.el7.noarch pulp-nodes-common-2.21.4-2.el7.noarch pulp-python-admin-extensions-2.0.4-1.el7.noarch pulp-puppet-admin-extensions-2.21.4-1.el7.noarch python-pulp-oid_validation-2.21.4-2.el7.noarch pulp-puppet-plugins-2.21.4-1.el7.noarch python3-pulpcore-3.7.3-1.el7.noarch python3-pulp-container-2.1.0-1.el7.noarch tfm-rubygem-smart_proxy_pulp-2.1.0-3.fm2_2.el7.noarch tfm-rubygem-pulp_ansible_client-0.4.2-1.el7.noarch tfm-rubygem-pulp_file_client-1.3.0-1.el7.noarch tfm-rubygem-pulp_2to3_migration_client-0.5.0-1.el7.noarch pulp-docker-plugins-3.2.8-1.el7.noarch python-pulp-streamer-2.21.4-2.el7.noarch pulp-rpm-plugins-2.21.4-2.el7.noarch python3-pulp-rpm-3.7.0-1.el7.noarch tfm-rubygem-pulp_certguard_client-1.0.3-1.el7.noarch python-pulp-deb-common-1.10.2-1.el7.noarch pulp-rpm-admin-extensions-2.21.4-2.el7.noarch python-pulp-repoauth-2.21.4-2.el7.noarch pulp-katello-1.0.3-1.el7.noarch python-pulp-docker-common-3.2.8-1.el7.noarch python3-pulp-file-1.3.0-1.el7.noarch tfm-rubygem-pulpcore_client-3.7.1-1.el7.noarch python-pulp-ostree-common-1.4.0-1.el7.noarch python-pulp-rpm-common-2.21.4-2.el7.noarch

I use normal optimised sync.

Repository is created as below:

[root@oplrepo-cpd-dmz ~]# hammer repository show --id 28 ID: 28 Name: Red Hat Enterprise Linux 6 Server RPMs x86_64 6.1 Label: Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6_1 Description: Organization: OPL Red Hat Repository: yes Content Type: yum Mirror on Sync: yes URL: https://cdn.redhat.com/content/dist/rhel/server/6/6.1/x86_64/os Publish Via HTTP: no Published At: https://oplrepo-cpd-dmz.corpnet.pl/pulp/repos/OPL/Library/content/dist/rhel/server/6/6.1/x86_64/os/ Relative Path: OPL/Library/content/dist/rhel/server/6/6.1/x86_64/os Download Policy: immediate HTTP Proxy: HTTP Proxy Policy: global_default_http_proxy Product: ID: 37 Name: Red Hat Enterprise Linux Server GPG Key:

Sync: Status: Warning Last Sync Date: 4 days Created: 2021/01/05 14:09:11 Updated: 2021/01/13 06:28:02 Content Counts: Packages: 0 Source RPMS: 0 Package Groups: 0 Errata: 0 Module Streams: 0

#10 Updated by dalley about 1 month ago

I tried to reproduce using same version and the staging repos - nothing. Someone will need to attempt with the actual RHEL repos.

Here's a script for whoever moves forwards with that.

from pulpcore.client.pulpcore import (
    ApiClient as CoreApiClient,
    Configuration,
    TasksApi
)
from pulpcore.client.pulp_rpm import (
    ApiClient as RpmApiClient,
    ContentPackagesApi,
    RepositoriesRpmApi,
    RemotesRpmApi,
    RepositoriesRpmVersionsApi,
    RpmRepositorySyncURL,
    PublicationsRpmApi,
)
from pulp_smash.pulp3.bindings import monitor_task


import socket

configuration = Configuration()
configuration.username = 'admin'
configuration.password = 'password'
configuration.host = 'http://{}:24817'.format(socket.gethostname())
configuration.safe_chars_for_path_param = '/'

core_client = CoreApiClient(configuration)
rpm_client = RpmApiClient(configuration)

# Create api clients for all resource types
rpm_repo_api = RepositoriesRpmApi(rpm_client)
rpm_repo_versions_api = RepositoriesRpmVersionsApi(rpm_client)
rpm_content_api = ContentPackagesApi(rpm_client)
rpm_remote_api = RemotesRpmApi(rpm_client)
rpm_publication_api = PublicationsRpmApi(rpm_client)

tasks_api = TasksApi(core_client)

# Sync test
# =========

rhel61_remote = rpm_remote_api.create({'name': 'rhel61', 'policy': 'on_demand', 'url': 'https://cdn.redhat.com/content/dist/rhel/server/6/6.1/x86_64/os/'})

rhel61_clone_repo = rpm_repo_api.create({'name': 'rhel61'})

rhel61_clone_repo = rpm_repo_api.list(name='rhel61').results[0]
rhel61_remote = rpm_remote_api.list(name='rhel61').results[0]

repository_sync_data = RpmRepositorySyncURL(remote=rhel61_remote.pulp_href)

sync_response = rpm_repo_api.sync(rhel61_clone_repo.pulp_href, repository_sync_data)
task = monitor_task(sync_response.task)
time_diff = task.finished_at - task.started_at
print("Sync time: {} seconds".format(time_diff.seconds))

#11 Updated by rchan 29 days ago

  • Sprint changed from Sprint 89 to Sprint 90

#12 Updated by ggainey 17 days ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ggainey

#13 Updated by ggainey 17 days ago

Can be reproduced using the 6.6 test from test_fips_workflows as well, as found here:

https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/tests/functional/api/test_fips_workflow.py#L639-L643

To run that test, you need to comment out L639 and then:

$ export FIPS_WORKFLOW=true
$ export CDN_CLIENT_CERT=`cat /PATH/TO/YOUR/cdn.crt`
$ export CDN_CLIENT_KEY=`cat /PATH/TO/YOUR/cdn.key`                
$ export CDN_CA_CERT=`cat /PATH/TO/YOUR/redhat-uep.pem` 
$ pulpcore-manager test -t /home/vagrant/devel/pulpcore pulp_rpm.tests.functional.api.test_fips_workflow.FipsRemotesTestCase.test_077_cdn_redhat_com_content_dist_rhel_server_6_6_6_x86_64_os

#14 Updated by pulpbot 16 days ago

  • Status changed from ASSIGNED to POST

#15 Updated by ggainey 16 days ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF