Skip to content

Instantly share code, notes, and snippets.

View purl.sh
#!/bin/bash
curl --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key https://`hostname`/$*
View fill_from_audit.rb
def interested_hostgroups
Hostgroup.where(id: Katello::Hostgroup::ContentFacet.where(content_source_id: nil, kickstart_repository_id: nil, content_view_id: nil, lifecycle_environment_id: nil).select(:hostgroup_id))
end
def pick_facet_values(hg)
facet_values = {}
hg.audits.reverse.each do |audit|
hg_changes = audit.audited_changes.slice("lifecycle_environment_id", "kickstart_repository_id", "content_view_id", "content_source_id")
facet_values = hg_changes.merge(facet_values)
end
View hammer-ktest.sh
HAMMER_KATELLO_PATH="${HAMMER_KATELLO_PATH:-/home/vagrant/git/hammer-cli-katello}"
pushd .
rm /var/log/hammer/*
FILES=$(find $HAMMER_KATELLO_PATH/test -type f -path "**/*$1*test.rb"|tr '\n' ' ')
cd $HAMMER_KATELLO_PATH
RAKE_PATH=`bundle show rake`
set -x
for fl in $FILES; do
bundle exec ruby -I"lib:lib" -I"$RAKE_PATH/lib" "$RAKE_PATH/lib/rake/rake_test_loader.rb" "test/functional/repository/delete_test.rb" $fl
done
View import.sh
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
IMPORT_ORG="import-$RANDOM"
PRODUCT="prod"
REPO1="katello"
REPO2="misc"
REPO3="candlepin"
View export.sh
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
EXPORT_ORG="export-$RANDOM"
PRODUCT="prod"
REPO1="katello"
REPO1_URL="https://fedorapeople.org/groups/katello/releases/yum/3.8/katello/el7/x86_64/"
REPO2="misc"
REPO2_URL="https://fixtures.pulpproject.org/rpm-with-modules/"
View do_library_import.py
#!/bin/env python
import json
import requests
import sys
from requests.auth import HTTPBasicAuth
from pprint import pprint
def fetch_metadata(fl):
with open(fl, "r") as content:
data = json.load(content)
View do_export.py
#!/bin/env python
import json
import requests
import sys
from requests.auth import HTTPBasicAuth
from pprint import pprint
def fetch_metadata(fl):
with open(fl, "r") as content:
data = json.load(content)
View do_import.py
#!/bin/env python
import json
import requests
import sys
from requests.auth import HTTPBasicAuth
from pprint import pprint
def fetch_metadata(fl):
with open(fl, "r") as content:
data = json.load(content)
@parthaa
parthaa / export.sh
Created Oct 19, 2020
export script
View export.sh
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
EXPORT_ORG="export-$RANDOM"
PRODUCT="prod"
REPO1="katello"
REPO1_URL="https://fedorapeople.org/groups/katello/releases/yum/3.8/katello/el7/x86_64/"
REPO2="misc"
REPO2_URL="https://partha.fedorapeople.org/test-repos/pteradactly-with-dino-errata/"
@parthaa
parthaa / import.sh
Created Oct 19, 2020
import script
View import.sh
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
IMPORT_ORG="import-$RANDOM"
PRODUCT="prod"
REPO1="katello"
REPO2="misc"
CONTENT_VIEW="view"