This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -v | |
read -p "Download OpenAPI schema for pulpcore provided REST API." | |
curl -o pulpcore-api.json http://localhost/pulp/api/v3/docs/api.json?bindings&plugin=pulpcore | |
read -p "Check available config options for Python generator." | |
podman run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli config-help -g python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pulpcore.client.pulpcore import ( | |
ApiClient as CoreApiClient, ArtifactsApi, Configuration, | |
TasksApi, Upload, UploadCommit, UploadsApi | |
) | |
from pulpcore.client.pulp_file import ( | |
ApiClient as FileApiClient, ContentFilesApi, | |
DistributionsFileApi, FileFileDistribution, | |
PublicationsFileApi, RemotesFileApi, FileFileRemote, | |
RepositorySyncURL, FileFilePublication, | |
FileFileRepository, RepositoriesFileApi, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pulp.app.models import Task | |
from pulp.plugin import ProgressBar | |
def test(files): | |
mytask = Task(result='blah') | |
mytask.save() | |
progress_bar = ProgressBar(message='Publishing files', total=len(files), task_id=mytask.id) | |
progress_bar.save() | |
with progress_bar: | |
for file in progress_bar.iter(files): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# vim: set fileencoding=utf-8: | |
""" Process URL for intersphinx targets and emit html or text """ | |
def validuri(string): | |
return string | |
from sphinx.ext.intersphinx import read_inventory_v2 | |
from posixpath import join | |
import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the following to the end of /usr/lib/python2.7/site-packages/pulp/server/tasks/__init__.py | |
After you edit the file you will need make sure you have pulp_workers running. If you had the | |
workers running already, please restart them after editing the file. | |
--------------------------------------------------------------- | |
import os, shutil | |
import celery | |
from pulp.server.async.tasks import TaskResult, Task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install sshnotify.py plugin | |
#Generate an RSA key pair without a passphrase | |
#Add public key to the /home/user/.ssh/authorized_keys on the client (where notifications will appear) | |
#/home/user/.ssh/weechat is the private key used to connect back to the client | |
#Run following command in weechat | |
/set plugins.var.python.sshnotify.addresses "localhost -p 19999 -i /home/user/.ssh/weechat" | |
#port 19999 can be any available port on the server running weechat |