run:
foreman-rake console
Then inside the console run:
if Katello::Resources::Candlepin::Owner.all
Katello::Content.all.each do |c|
run:
foreman-rake console
Then inside the console run:
if Katello::Resources::Candlepin::Owner.all
Katello::Content.all.each do |c|
--- | |
- name: Test Foreman Modules | |
hosts: localhost | |
gather_facts: false | |
collections: | |
- theforeman.foreman | |
vars: | |
validate_certs: "no" | |
username: "admin" | |
password: "changeme" |
yum install jq # should be in epel
for href in `curl "https://$(hostname)/pulp/api/v3/tasks/?state=running&state=waiting" --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key | jq '.results[].pulp_href' | awk -F '"' '{print $2}'`; do echo "https://$(hostname)$href" ; curl "https://$(hostname)$href" -X PATCH -d '{"state": "canceled"}' -H "Content-Type: application/json" --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key ; done
PULP_SETTINGS='/etc/pulp/settings.py' pulpcore-manager --report handle-artifact-checksums --checksums md5,sha1,sha224,sha256,sha384,sha512
foreman-installer --foreman-proxy-content-pulpcore-allowed-content-checksums md5 \
--foreman-proxy-content-pulpcore-allowed-content-checksums sha1 \
--foreman-proxy-content-pulpcore-allowed-content-checksums sha224 \
--foreman-proxy-content-pulpcore-allowed-content-checksums sha256 \
--foreman-proxy-content-pulpcore-allowed-content-checksums sha384 \
--foreman-proxy-content-pulpcore-allowed-content-checksums sha512
Prepare content for Pulp 3:
Checking for valid Katello configuraton.
Starting task.
2021-04-21 20:50:47 -0400: Pre-migrating Pulp 2 ERRATUM content (general info) 43078/57958Migration failed, You will want to investigate: https://dhcp-8-29-228.lab.eng.rdu2.redhat.com/foreman_tasks/tasks/6b1d5918-1ecd-4628-b77f-ae128352c85e
rake aborted!
ForemanTasks::TaskError: Task 6b1d5918-1ecd-4628-b77f-ae128352c85e: Katello::Errors::Pulp3Error: Cursor not found, cursor id: 179922846418, full error: {'ok': 0.0, 'errmsg': 'Cursor not found, cursor id: 179922846418', 'code': 43, 'codeName': 'CursorNotFound'}
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/lib/katello/tasks/pulp3_migration.rake:35:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => katello:pulp3_migration
SPEC_FACTS_OS=redhat-7-x86_64 rake spec | |
bundle exec rake lint |
org = Organization.find(1) | |
path = Dir.mktmpdir("pulp-certs") | |
Katello::Repository.yum_type.in_default_view.in_organization(org).each do |repo| | |
filename = File.join(path, "#{repo.product.label}-#{repo.label}") | |
importer = repo.pulp_repo_facts['importers'].find{|i| i['id'] == 'yum_importer'} | |
if importer && importer['config']['ssl_client_cert'] | |
combined = importer['config']['ssl_client_cert'] + importer['config']['ssl_client_key'] | |
File.open(filename, 'w'){|file| file.write(combined) } | |
puts "Wrote #{filename}" |
#testing applicability speed | |
def time | |
a = Time.now | |
yield | |
Time.now - a | |
end | |
count = 300 | |
offset = rand(Katello::Host::ContentFacet.count) - count |
diff --git a/pulp_2to3_migration/app/pre_migration.py b/pulp_2to3_migration/app/pre_migration.py | |
index 899a08c..4adcd68 100644 | |
--- a/pulp_2to3_migration/app/pre_migration.py | |
+++ b/pulp_2to3_migration/app/pre_migration.py | |
@@ -151,7 +151,7 @@ def pre_migrate_content_type(content_model, mutable_type, lazy_type, premigrate_ | |
pulp2detail_pb.total -= 1 | |
continue | |
- downloaded = record.downloaded if hasattr(record, 'downloaded') else False | |
+ downloaded = False |
require 'qpid_proton' | |
MESSAGE = '{"data": {"consumer_id": "e6c21274-e8a2-4484-a4cb-8d4edba0710b", "task_id": "abcd"}, "pam": null, "replyto": "pulp.task", "request": {"args": [[{"type_id": "rpm", "unit_key": {"name": "screen"}}], {"importkeys": true}], "classname": "Content", "cntr": [[], {}], "kws": {}, "method": "uninstall"}, "routing": [null, "pulp.agent.e6c21274-e8a2-4484-a4cb-8d4edba0710b"], "secret": "abcdefg", "sn": "23fc34ce-2992-45df-91cc-4169f62d0e5f", "version": "2.0"}' | |
class SimpleSend < Qpid::Proton::MessagingHandler | |
def initialize(url, address, expected) | |
super() | |
@url = url | |
@address = address |