Compare commits
254 Commits
master
...
f29-branch
Author | SHA1 | Date | |
---|---|---|---|
|
ee567c1778 | ||
|
2779565820 | ||
|
ac6d408115 | ||
|
2a4d2f3a9b | ||
|
d7fe470183 | ||
|
89c590dc13 | ||
|
46e5c3717f | ||
|
48ba83b67b | ||
|
4b87dc09d0 | ||
|
36ba09345b | ||
|
0945c9b81f | ||
|
f39e965fb2 | ||
|
725a0437c7 | ||
|
acad424005 | ||
|
6368b0e83b | ||
|
2c03c49149 | ||
|
25bac2fe65 | ||
|
a91dfee3a5 | ||
|
e001c6aaa4 | ||
|
5230b8d30e | ||
|
b94fdddc7c | ||
|
cc2c3bbbd2 | ||
|
6e3eeed1da | ||
|
33451f0a60 | ||
|
56699c4818 | ||
|
fa1aeec58e | ||
|
0314b6125f | ||
|
712ae7a721 | ||
|
9a4a45f05a | ||
|
0220077242 | ||
|
c1628bd171 | ||
|
69caef3c2d | ||
|
4e144e15b7 | ||
|
b52877b63c | ||
|
c74e50d99d | ||
|
ce879af719 | ||
|
4fa08eb8e1 | ||
|
e84bf3a64c | ||
|
c9f076c86d | ||
|
7a86aa1d17 | ||
|
156e0ba7c9 | ||
|
4c313acc64 | ||
|
3339048a66 | ||
|
c5108bce9f | ||
|
5042867d19 | ||
|
b25995d9d4 | ||
|
7a6ebb0ad3 | ||
|
8696f197d4 | ||
|
0169422746 | ||
|
21b03c2108 | ||
|
d9b55b78cb | ||
|
7a1e443aff | ||
|
530279c44a | ||
|
d0ac25d022 | ||
|
2dd3dd54c5 | ||
|
d0458750df | ||
|
21975b44da | ||
|
35faa61f7e | ||
|
78ccea2231 | ||
|
6aa0a3fdf6 | ||
|
afa68df873 | ||
|
935f66662b | ||
|
53c4daa529 | ||
|
850c35a613 | ||
|
0dd9ffab92 | ||
|
208941afd8 | ||
|
1fd73cde52 | ||
|
85708340eb | ||
|
4f07db73a5 | ||
|
54fe00d16e | ||
|
883bc07fc8 | ||
|
19375b9d4e | ||
|
ab74164d83 | ||
|
f02eab78a3 | ||
|
3d2c085cf0 | ||
|
30098a52e3 | ||
|
b537d653c4 | ||
|
36b0985265 | ||
|
ce361d6f48 | ||
|
b7b8731c03 | ||
|
a08dd1585c | ||
|
1a76c4816f | ||
|
8814231a09 | ||
|
5ed5690fb6 | ||
|
ea63fbcc5b | ||
|
f7e71768fa | ||
|
2ad44f3a46 | ||
|
45710e435a | ||
|
c6bff67549 | ||
|
0d38224f12 | ||
|
f6bf2cf460 | ||
|
6debc2252c | ||
|
43a79746fc | ||
|
d23ec308d4 | ||
|
fe091060b8 | ||
|
12cd27375a | ||
|
a839824f7a | ||
|
34c24117fe | ||
|
8885d7eaca | ||
|
2fd6c6b549 | ||
|
a038f7d904 | ||
|
963c7d8f89 | ||
|
3daede741c | ||
|
4f3b81e4e7 | ||
|
7b306e2e84 | ||
|
9584cbd96f | ||
|
c4f3ceb0ec | ||
|
41aa84ba04 | ||
|
a8ff02113b | ||
|
80c18a6e63 | ||
|
efa9974609 | ||
|
a907a3757d | ||
|
eda242623b | ||
|
8c409c8263 | ||
|
9c17c0cc6c | ||
|
178eb927d6 | ||
|
2184cff59c | ||
|
63e35921fa | ||
|
9b31c3cad9 | ||
|
a0a76a800a | ||
|
3fd9699e6d | ||
|
51a9c28bc6 | ||
|
faad43ced8 | ||
|
e7310c7260 | ||
|
0aa206f661 | ||
|
5fa5b8e142 | ||
|
ef45d169b0 | ||
|
c63b2e3881 | ||
|
c6b9a72778 | ||
|
c34a0fb535 | ||
|
c5e839838f | ||
|
4c71adadd5 | ||
|
a2797e8f1b | ||
|
cbebbce0d5 | ||
|
71ccb55985 | ||
|
4c41780856 | ||
|
c0d51e9e99 | ||
|
019aa20d9f | ||
|
7c38d74c00 | ||
|
a8d8a4a2ef | ||
|
ccb11427d0 | ||
|
e2366fd0c0 | ||
|
df5f67e690 | ||
|
d04d176cb4 | ||
|
376eda543c | ||
|
ab1effb98d | ||
|
7248355756 | ||
|
1c5b0d1237 | ||
|
03a2c09301 | ||
|
47a909209f | ||
|
80e35d8d0e | ||
|
97fa245e0c | ||
|
36aeffc337 | ||
|
e57ec6a566 | ||
|
635c4adefd | ||
|
76071db226 | ||
|
486dd3f629 | ||
|
06db78c9c4 | ||
|
efcfdbff4f | ||
|
eb9a591fbc | ||
|
cfff807df8 | ||
|
9af706dbe3 | ||
|
6be0ca9bb0 | ||
|
bef4d9f4a8 | ||
|
251306e1ab | ||
|
1607e33227 | ||
|
42addfc2b5 | ||
|
850ad9845a | ||
|
df6d7654bd | ||
|
5bf223c21a | ||
|
8721ce765d | ||
|
40cfaa515c | ||
|
3f034a981d | ||
|
574360f7d0 | ||
|
1d21957036 | ||
|
0c042afd34 | ||
|
99d867db65 | ||
|
4a4a415f88 | ||
|
080705e8e6 | ||
|
43ff505804 | ||
|
a357c42f2d | ||
|
5cf54c6f29 | ||
|
1006af4232 | ||
|
8a53d5e310 | ||
|
d9b282150e | ||
|
bdbd8258f0 | ||
|
88a0b475e9 | ||
|
af28b25e50 | ||
|
4192dfc709 | ||
|
49db5403b8 | ||
|
eafc2796a1 | ||
|
f3cbeb8808 | ||
|
6fb5910acd | ||
|
708cadee82 | ||
|
3499426b2d | ||
|
5efce31772 | ||
|
ce6fa9c05f | ||
|
a76aad36f6 | ||
|
e116a5f4be | ||
|
f86aaa5d37 | ||
|
d03e6e8c7e | ||
|
e63da65ad1 | ||
|
16dccde87f | ||
|
f24f84282d | ||
|
8f1bc6e882 | ||
|
29fe174b6b | ||
|
d65a502861 | ||
|
ec47fe12a9 | ||
|
c7b4dce2b6 | ||
|
b35fe9d32a | ||
|
75523f7a49 | ||
|
1f514a3e55 | ||
|
8bc6282083 | ||
|
6e86328865 | ||
|
5184ccef9f | ||
|
1c0705f4e0 | ||
|
891729528f | ||
|
8963c33e16 | ||
|
3ad5a5cccf | ||
|
bd8fdb8c0e | ||
|
ecd4327a01 | ||
|
d6274ec413 | ||
|
af3cab0dfe | ||
|
0e629f3d2a | ||
|
3cd4a3cb49 | ||
|
e559418ec4 | ||
|
79422eb78b | ||
|
e2e73973dc | ||
|
d540ba3a23 | ||
|
490f7f6cf1 | ||
|
0ec66e3ef2 | ||
|
f32ef25fd1 | ||
|
c37b9f57e5 | ||
|
a148f8edde | ||
|
d329ebd519 | ||
|
41a91d031f | ||
|
9ee2d46a32 | ||
|
bb73d93663 | ||
|
9de0948511 | ||
|
576888bd31 | ||
|
5204e3c6f4 | ||
|
38e03dad63 | ||
|
bc4c230128 | ||
|
3e4bed4df3 | ||
|
77ba534832 | ||
|
75400f6a7f | ||
|
fa1ba96a73 | ||
|
cbf3599636 | ||
|
ed9fc1885a | ||
|
f41ca1e0fb | ||
|
9a83a5cb3f | ||
|
b0872c8f17 | ||
|
c7ba2e6231 | ||
|
7ac3e20234 |
21
.github/pull_request_template.md
vendored
Normal file
21
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
--- Description of proposed changes ---
|
||||
|
||||
|
||||
|
||||
|
||||
--- Merge policy ---
|
||||
|
||||
- [ ] Travis CI PASS
|
||||
- [ ] `*-aws-runtest` PASS
|
||||
- [ ] `*-azure-runtest` PASS
|
||||
- [ ] `*-images-runtest` PASS
|
||||
- [ ] `*-openstack-runtest` PASS
|
||||
- [ ] `*-vmware-runtest` PASS
|
||||
- [ ] For `rhel8-*` and `rhel7-*` branches commit log references an approved
|
||||
bug in Bugzilla. Do not merge if the bug doesn't have the 3 ACKs set to `+`!
|
||||
|
||||
--- Jenkins commands ---
|
||||
|
||||
- `ok to test` to accept this pull request for testing
|
||||
- `test this please` for a one time test run
|
||||
- `retest this please` to start a new build
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,3 +5,5 @@ tests/pylint/.pylint.d/
|
||||
__pycache__/
|
||||
.coverage
|
||||
pylint-log
|
||||
.pytest_cache/
|
||||
.test-results/
|
||||
|
@ -9,9 +9,7 @@ script:
|
||||
after_success:
|
||||
- |
|
||||
|
||||
sudo docker create --name results-cont welder/lorax /bin/echo
|
||||
sudo docker cp results-cont:/lorax/.coverage .coverage.docker
|
||||
sudo docker rm results-cont
|
||||
cp .test-results/.coverage ./.coverage.docker
|
||||
|
||||
pip install coverage coveralls
|
||||
coverage combine
|
||||
|
@ -1,14 +1,41 @@
|
||||
FROM fedora:rawhide
|
||||
|
||||
RUN dnf -y install make libgit2-glib tito python3-pylint \
|
||||
python3-nose python3-mako python3-flask \
|
||||
python3-coverage libselinux-python3 sudo \
|
||||
pykickstart python3-pytoml python3-sphinx \
|
||||
python3-semantic_version \
|
||||
anaconda-tui
|
||||
|
||||
RUN mkdir /lorax
|
||||
COPY . /lorax
|
||||
|
||||
WORKDIR /lorax
|
||||
RUN make test
|
||||
FROM registry.fedoraproject.org/fedora:29
|
||||
RUN dnf -y install \
|
||||
anaconda-tui \
|
||||
libgit2-glib \
|
||||
libselinux-python3 \
|
||||
make \
|
||||
pykickstart \
|
||||
python3-coverage \
|
||||
python3-coveralls \
|
||||
python3-flask \
|
||||
python3-gevent \
|
||||
python3-magic \
|
||||
python3-mako \
|
||||
python3-mock \
|
||||
python3-nose \
|
||||
python3-pocketlint \
|
||||
python3-pylint \
|
||||
python3-pyparted \
|
||||
python3-pytoml \
|
||||
python3-semantic_version \
|
||||
python3-sphinx \
|
||||
python3-sphinx-argparse \
|
||||
python3-sphinx_rtd_theme \
|
||||
python3-rpmfluff \
|
||||
python3-librepo \
|
||||
python3-pyvmomi \
|
||||
beakerlib \
|
||||
sudo \
|
||||
tito \
|
||||
rsync \
|
||||
e2fsprogs \
|
||||
xz-lzma-compat \
|
||||
pbzip2 \
|
||||
squashfs-tools \
|
||||
qemu-img \
|
||||
which && \
|
||||
touch /.in-container
|
||||
RUN useradd weldr
|
||||
VOLUME /lorax-ro
|
||||
VOLUME /test-results
|
||||
WORKDIR /lorax-ro
|
||||
|
31
HACKING.md
Normal file
31
HACKING.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Hacking on Lorax
|
||||
|
||||
Here's where to get the code:
|
||||
|
||||
$ git clone https://github.com/weldr/lorax
|
||||
$ cd lorax/
|
||||
|
||||
How to build it:
|
||||
|
||||
$ make
|
||||
|
||||
## How to run the tests
|
||||
|
||||
To run the tests you need the following dependencies installed:
|
||||
|
||||
$ yum install python3-nose python3-pytest-mock python3-pocketlint \
|
||||
python3-mock
|
||||
|
||||
Run the basic linting tests like this:
|
||||
|
||||
$ make check
|
||||
|
||||
|
||||
To run the broader unit and integration tests we use:
|
||||
|
||||
$ make test
|
||||
|
||||
Some of the tests will be skipped unless a lorax-composer process is running
|
||||
and listening on an accessible socket. Either run lorax-composer from the
|
||||
checkout, or the installed version.
|
||||
|
67
Makefile
67
Makefile
@ -1,11 +1,16 @@
|
||||
PYTHON ?= /usr/bin/python3
|
||||
DESTDIR ?= /
|
||||
PREFIX ?= /usr
|
||||
mandir ?= $(PREFIX)/share/man
|
||||
DOCKER ?= docker
|
||||
DOCS_VERSION ?= next
|
||||
|
||||
PKGNAME = lorax
|
||||
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
|
||||
RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
|
||||
TAG = lorax-$(VERSION)-$(RELEASE)
|
||||
|
||||
IMAGE_RELEASE = $(shell awk -F: '/FROM/ { print $$2}' Dockerfile.test)
|
||||
|
||||
default: all
|
||||
|
||||
@ -19,10 +24,12 @@ all: src/pylorax/version.py src/composer/version.py
|
||||
$(PYTHON) setup.py build
|
||||
|
||||
install: all
|
||||
$(PYTHON) setup.py install --root=$(DESTDIR)
|
||||
$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
|
||||
mkdir -p $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/man/lorax-composer.1 $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/man/composer-cli.1 $(DESTDIR)/$(mandir)/man1
|
||||
mkdir -p $(DESTDIR)/etc/bash_completion.d
|
||||
install -m 644 etc/bash_completion.d/composer-cli $(DESTDIR)/etc/bash_completion.d
|
||||
|
||||
@ -38,7 +45,39 @@ test:
|
||||
|
||||
coverage3 report -m
|
||||
[ -f "/usr/bin/coveralls" ] && [ -n "$(COVERALLS_REPO_TOKEN)" ] && coveralls || echo
|
||||
|
||||
./tests/test_cli.sh
|
||||
|
||||
# need `losetup`, which needs Docker to be in privileged mode (--privileged)
|
||||
# but even so fails in Travis CI
|
||||
test_images:
|
||||
sudo -E ./tests/test_cli.sh tests/cli/test_compose_ext4-filesystem.sh \
|
||||
tests/cli/test_compose_partitioned-disk.sh \
|
||||
tests/cli/test_compose_tar.sh \
|
||||
tests/cli/test_compose_qcow2.sh \
|
||||
tests/cli/test_compose_live-iso.sh
|
||||
|
||||
test_aws:
|
||||
sudo -E ./tests/test_cli.sh tests/cli/test_build_and_deploy_aws.sh
|
||||
|
||||
test_azure:
|
||||
sudo -E ./tests/test_cli.sh tests/cli/test_build_and_deploy_azure.sh
|
||||
|
||||
test_openstack:
|
||||
sudo -E ./tests/test_cli.sh tests/cli/test_build_and_deploy_openstack.sh
|
||||
|
||||
test_vmware:
|
||||
sudo -E ./tests/test_cli.sh tests/cli/test_build_and_deploy_vmware.sh
|
||||
|
||||
clean_cloud_envs:
|
||||
# clean beakerlib logs from previous executions
|
||||
sudo rm -rf /var/tmp/beakerlib-*/
|
||||
sudo -E ./tests/cleanup/remove_old_objects_aws.sh
|
||||
sudo -E ./tests/cleanup/remove_old_objects_openstack.sh
|
||||
sudo -E ./tests/cleanup/remove_old_objects_azure.sh
|
||||
sudo -E ./tests/cleanup/remove_old_objects_vmware.sh
|
||||
# make sure all cleanup scripts finished successfully
|
||||
sudo sh -c 'grep RESULT_STRING /var/tmp/beakerlib-*/TestResults | grep -v PASS && exit 1 || exit 0'
|
||||
|
||||
clean:
|
||||
-rm -rf build src/pylorax/version.py
|
||||
@ -48,7 +87,11 @@ tag:
|
||||
git tag -f $(TAG)
|
||||
|
||||
docs:
|
||||
$(MAKE) -C docs apidoc html
|
||||
$(MAKE) -C docs apidoc html man
|
||||
|
||||
# This is needed to reset the ownership of the new docs files after they are created in a container
|
||||
set-docs-owner:
|
||||
chown -R $(LOCAL_UID):$(LOCAL_GID) docs/
|
||||
|
||||
archive:
|
||||
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
|
||||
@ -67,9 +110,27 @@ local:
|
||||
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
|
||||
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
|
||||
|
||||
test-in-copy:
|
||||
rsync -aP --exclude=.git /lorax-ro/ /lorax/
|
||||
make -C /lorax/ ci
|
||||
cp /lorax/.coverage /test-results/
|
||||
|
||||
test-in-docker:
|
||||
sudo docker build -t welder/lorax:latest -f Dockerfile.test .
|
||||
sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test .
|
||||
@mkdir -p `pwd`/.test-results
|
||||
sudo $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results -v `pwd`:/lorax-ro:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy
|
||||
|
||||
docs-in-docker:
|
||||
sudo $(DOCKER) run -it --rm -v `pwd`:/lorax-ro:ro \
|
||||
-v `pwd`/docs/:/lorax-ro/docs/ \
|
||||
--env LORAX_VERSION=$(DOCS_VERSION) \
|
||||
--env LOCAL_UID=`id -u` --env LOCAL_GID=`id -g` \
|
||||
--security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make docs set-docs-owner
|
||||
|
||||
ci: check test
|
||||
|
||||
.PHONY: ci_after_success
|
||||
ci_after_success:
|
||||
# nothing to do here, but Jenkins expects this to be present, otherwise fails
|
||||
|
||||
.PHONY: docs
|
||||
|
@ -39,9 +39,10 @@ Build a ``qcow2`` disk image from this blueprint by running ``composer-cli
|
||||
compose start http-server qcow2``. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.
|
||||
|
||||
<<<<<<< HEAD
|
||||
The available types of images is displayed by ``composer-cli compose types``.
|
||||
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
|
||||
tar
|
||||
Currently this consists of: alibaba, ami, ext4-filesystem, google, hyper-v,
|
||||
live-iso, openstack, partitioned-disk, qcow2, tar, vhd, vmdk
|
||||
|
||||
Monitor the build status
|
||||
------------------------
|
||||
|
36
docs/conf.py
36
docs/conf.py
@ -56,19 +56,32 @@ copyright = u'2018, Red Hat, Inc.' # pylint: disable=redefined-builtin
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
# Pass in LORAX_VERSION to set a specific version
|
||||
# Set LORAX_VERSION=next to bump it to the next release
|
||||
def read_version():
|
||||
"""Read version from $LORAX_VERSION or ../lorax.spec"""
|
||||
"""Read version from $LORAX_VERSION or ../lorax.spec, or bump the version from lorax.spec"""
|
||||
# This allows the .spec version to be overridded. eg. when documenting an upcoming release
|
||||
if "LORAX_VERSION" in os.environ:
|
||||
if "LORAX_VERSION" in os.environ and "next" not in os.environ["LORAX_VERSION"]:
|
||||
return os.environ["LORAX_VERSION"]
|
||||
|
||||
doc_version = None
|
||||
import re
|
||||
version_re = re.compile(r"Version:\s+(.*)")
|
||||
with open("../lorax.spec", "rt") as f:
|
||||
for line in f:
|
||||
m = version_re.match(line)
|
||||
if m:
|
||||
return m.group(1)
|
||||
doc_version = m.group(1)
|
||||
if not doc_version:
|
||||
raise RuntimeError("Failed to find current version")
|
||||
|
||||
# Make it easier to generate docs for the next release
|
||||
if "next" in os.environ["LORAX_VERSION"]:
|
||||
fields = doc_version.split(".")
|
||||
fields[-1] = str(int(fields[-1]) + 1)
|
||||
doc_version = ".".join(fields)
|
||||
|
||||
return doc_version
|
||||
|
||||
#
|
||||
# The short X.Y version.
|
||||
@ -159,6 +172,9 @@ html_static_path = ['_static']
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# Turn off smartquotes, it mangles dashes in the docstrings
|
||||
smartquotes = False
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
@ -218,7 +234,7 @@ latex_elements = {
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'Lorax.tex', u'Lorax Documentation',
|
||||
u'Anaconda Team', 'manual'),
|
||||
u'Weldr Team', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
@ -247,8 +263,10 @@ latex_documents = [
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('lorax', 'lorax', u'Lorax Documentation', [u'Anaconda Team'], 1),
|
||||
('livemedia-creator', 'livemedia-creator', u'Live Media Creator Documentation', [u'Anaconda Team'], 1)
|
||||
('lorax', 'lorax', u'Lorax Documentation', [u'Weldr Team'], 1),
|
||||
('livemedia-creator', 'livemedia-creator', u'Live Media Creator Documentation', [u'Weldr Team'], 1),
|
||||
('lorax-composer', 'lorax-composer', u'Lorax Composer Documentation', [u'Weldr Team'], 1),
|
||||
('composer-cli', 'composer-cli', u'Composer Cmdline Utility Documentation', [u'Weldr Team'], 1),
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
@ -262,7 +280,7 @@ man_pages = [
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'Lorax', u'Lorax Documentation',
|
||||
u'Anaconda Team', 'Lorax', 'One line description of project.',
|
||||
u'Weldr Team', 'Lorax', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
@ -283,8 +301,8 @@ texinfo_documents = [
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'Lorax'
|
||||
epub_author = u'Anaconda Team'
|
||||
epub_publisher = u'Anaconda Team'
|
||||
epub_author = u'Weldr Team'
|
||||
epub_publisher = u'Weldr Team'
|
||||
epub_copyright = u'2018, Red Hat, Inc.'
|
||||
|
||||
# The basename for the epub file. It defaults to the project name.
|
||||
|
@ -7,8 +7,6 @@ url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Ever
|
||||
rootpw --plaintext replace-this-pw
|
||||
# Network information
|
||||
network --bootproto=dhcp --activate
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
|
@ -14,8 +14,6 @@ url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Ever
|
||||
# Network information
|
||||
network --bootproto=dhcp --device=link --activate
|
||||
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
|
||||
@ -31,7 +29,7 @@ clearpart --all --initlabel
|
||||
rootpw rootme
|
||||
# Disk partitioning information
|
||||
reqpart
|
||||
part / --size=6656
|
||||
part / --size=7000
|
||||
|
||||
%post
|
||||
# FIXME: it'd be better to get this installed from a package
|
||||
@ -374,9 +372,7 @@ aajohan-comfortaa-fonts
|
||||
anaconda
|
||||
dracut-config-generic
|
||||
dracut-live
|
||||
fedora-productimg-workstation
|
||||
glibc-all-langpacks
|
||||
grub2-efi
|
||||
kernel
|
||||
# Make sure that DNF doesn't pull in debug kernel to satisfy kmod() requires
|
||||
kernel-modules
|
||||
@ -389,4 +385,13 @@ syslinux
|
||||
-gfs2-utils
|
||||
-reiserfs-utils
|
||||
|
||||
# This package is needed to boot the iso on UEFI
|
||||
shim
|
||||
shim-ia32
|
||||
grub2
|
||||
grub2-efi
|
||||
grub2-efi-*-cdboot
|
||||
grub2-efi-ia32
|
||||
efibootmgr
|
||||
|
||||
%end
|
||||
|
@ -10,8 +10,6 @@ network --bootproto=dhcp --device=link --activate
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
|
@ -10,8 +10,6 @@ network --bootproto=dhcp --device=link --activate
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
|
@ -9,8 +9,6 @@ url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Ever
|
||||
rootpw --plaintext replace-this-pw
|
||||
# Network information
|
||||
network --bootproto=dhcp --activate
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
|
@ -15,8 +15,6 @@ rootpw --lock
|
||||
user --name=vagrant
|
||||
sshkey --username=vagrant "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
|
||||
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: df84227b4f6d45f96e4ae4c3727d149b
|
||||
config: 1bf42a3192ec6a62d96115c18e727069
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
docs/html/README
Normal file
5
docs/html/README
Normal file
@ -0,0 +1,5 @@
|
||||
To build the docs for this branch run:
|
||||
make test-in-docker
|
||||
make docs-in-docker
|
||||
|
||||
If you already have a welder/lorax-composer:latest docker image you can skip running 'test-in-docker'.
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -221,7 +220,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -240,27 +239,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.blueprints — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.blueprints — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -229,7 +228,7 @@
|
||||
<span class="sd"> blueprints list</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
@ -275,8 +274,14 @@
|
||||
|
||||
<span class="sd"> blueprints changes <blueprint,...> Display the changes for each blueprint.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">changes_total_fn</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the maximum number of possible changes"""</span>
|
||||
|
||||
<span class="c1"># Each blueprint can have a different total, return the largest one</span>
|
||||
<span class="k">return</span> <span class="nb">max</span><span class="p">([</span><span class="n">c</span><span class="p">[</span><span class="s2">"total"</span><span class="p">]</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]])</span>
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/changes/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">total_fn</span><span class="o">=</span><span class="n">changes_total_fn</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
@ -672,7 +677,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -691,27 +696,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.cmdline — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.cmdline — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -192,7 +191,7 @@
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Output the raw JSON response instead of the normal output."</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"-s"</span><span class="p">,</span> <span class="s2">"--socket"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"/run/weldr/api.socket"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"SOCKET"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to the socket file to listen on"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--log"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"logfile"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"./composer-cli.log"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"LOG"</span><span class="p">,</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--log"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"logfile"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"LOG"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to logfile (./composer-cli.log)"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"-a"</span><span class="p">,</span> <span class="s2">"--api"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"api_version"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"0"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"APIVER"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"API Version to use"</span><span class="p">)</span>
|
||||
@ -217,7 +216,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -236,27 +235,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.compose — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.compose — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -681,7 +680,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -700,27 +699,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.modules — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.modules — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -194,7 +193,7 @@
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/modules/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">socket</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">socket</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
@ -215,7 +214,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -234,27 +233,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.projects — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.projects — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -216,7 +215,7 @@
|
||||
<span class="sd"> projects list</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
@ -277,7 +276,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -296,27 +295,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.sources — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.sources — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -319,7 +318,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -338,27 +337,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.status — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.status — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -223,7 +222,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -242,27 +241,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.utilities — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli.utilities — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -262,7 +261,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -281,27 +280,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.http_client — Lorax 29.11 documentation</title>
|
||||
<title>composer.http_client — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -175,6 +174,7 @@
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">sys</span>
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
<span class="kn">from</span> <span class="nn">urllib.parse</span> <span class="k">import</span> <span class="n">urlparse</span><span class="p">,</span> <span class="n">urlunparse</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer.unix_socket</span> <span class="k">import</span> <span class="n">UnixHTTPConnectionPool</span>
|
||||
|
||||
@ -190,6 +190,29 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">normpath</span><span class="p">(</span><span class="s2">"/api/v</span><span class="si">%s</span><span class="s2">/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="n">url</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="append_query"><a class="viewcode-back" href="../../composer.html#composer.http_client.append_query">[docs]</a><span class="k">def</span> <span class="nf">append_query</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">query</span><span class="p">):</span>
|
||||
<span class="sd">"""Add a query argument to a URL</span>
|
||||
|
||||
<span class="sd"> The query should be of the form "param1=what&param2=ever", i.e., no</span>
|
||||
<span class="sd"> leading '?'. The new query data will be appended to any existing</span>
|
||||
<span class="sd"> query string.</span>
|
||||
|
||||
<span class="sd"> :param url: The original URL</span>
|
||||
<span class="sd"> :type url: str</span>
|
||||
<span class="sd"> :param query: The query to append</span>
|
||||
<span class="sd"> :type query: str</span>
|
||||
<span class="sd"> :returns: The new URL with the query argument included</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">url_parts</span> <span class="o">=</span> <span class="n">urlparse</span><span class="p">(</span><span class="n">url</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">url_parts</span><span class="o">.</span><span class="n">query</span><span class="p">:</span>
|
||||
<span class="n">new_query</span> <span class="o">=</span> <span class="n">url_parts</span><span class="o">.</span><span class="n">query</span> <span class="o">+</span> <span class="s2">"&"</span> <span class="o">+</span> <span class="n">query</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">new_query</span> <span class="o">=</span> <span class="n">query</span>
|
||||
<span class="k">return</span> <span class="n">urlunparse</span><span class="p">([</span><span class="n">url_parts</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">url_parts</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">url_parts</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span>
|
||||
<span class="n">url_parts</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">new_query</span><span class="p">,</span> <span class="n">url_parts</span><span class="p">[</span><span class="mi">5</span><span class="p">]])</span></div>
|
||||
|
||||
<div class="viewcode-block" id="get_url_raw"><a class="viewcode-back" href="../../composer.html#composer.http_client.get_url_raw">[docs]</a><span class="k">def</span> <span class="nf">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">url</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the raw results of a GET request</span>
|
||||
|
||||
@ -224,6 +247,39 @@
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">http</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s2">"GET"</span><span class="p">,</span> <span class="n">url</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="get_url_json_unlimited"><a class="viewcode-back" href="../../composer.html#composer.http_client.get_url_json_unlimited">[docs]</a><span class="k">def</span> <span class="nf">get_url_json_unlimited</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="n">total_fn</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the JSON results of a GET request</span>
|
||||
|
||||
<span class="sd"> For URLs that use offset/limit arguments, this command will</span>
|
||||
<span class="sd"> fetch all results for the given request.</span>
|
||||
|
||||
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||||
<span class="sd"> :type socket_path: str</span>
|
||||
<span class="sd"> :param url: URL to request</span>
|
||||
<span class="sd"> :type url: str</span>
|
||||
<span class="sd"> :returns: The json response from the server</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">default_total_fn</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the total number of available results"""</span>
|
||||
<span class="k">return</span> <span class="n">data</span><span class="p">[</span><span class="s2">"total"</span><span class="p">]</span>
|
||||
|
||||
<span class="n">http</span> <span class="o">=</span> <span class="n">UnixHTTPConnectionPool</span><span class="p">(</span><span class="n">socket_path</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Start with limit=0 to just get the number of objects</span>
|
||||
<span class="n">total_url</span> <span class="o">=</span> <span class="n">append_query</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="s2">"limit=0"</span><span class="p">)</span>
|
||||
<span class="n">r_total</span> <span class="o">=</span> <span class="n">http</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s2">"GET"</span><span class="p">,</span> <span class="n">total_url</span><span class="p">)</span>
|
||||
<span class="n">json_total</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">r_total</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Where to get the total from</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">total_fn</span><span class="p">:</span>
|
||||
<span class="n">total_fn</span> <span class="o">=</span> <span class="n">default_total_fn</span>
|
||||
|
||||
<span class="c1"># Add the "total" returned by limit=0 as the new limit</span>
|
||||
<span class="n">unlimited_url</span> <span class="o">=</span> <span class="n">append_query</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="s2">"limit=</span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span> <span class="n">total_fn</span><span class="p">(</span><span class="n">json_total</span><span class="p">))</span>
|
||||
<span class="n">r_unlimited</span> <span class="o">=</span> <span class="n">http</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s2">"GET"</span><span class="p">,</span> <span class="n">unlimited_url</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">r_unlimited</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="delete_url_json"><a class="viewcode-back" href="../../composer.html#composer.http_client.delete_url_json">[docs]</a><span class="k">def</span> <span class="nf">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">url</span><span class="p">):</span>
|
||||
<span class="sd">"""Send a DELETE request to the url and return JSON response</span>
|
||||
|
||||
@ -368,7 +424,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -387,27 +443,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.unix_socket — Lorax 29.11 documentation</title>
|
||||
<title>composer.unix_socket — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -226,7 +225,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -245,27 +244,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Overview: module code — Lorax 29.11 documentation</title>
|
||||
<title>Overview: module code — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -163,12 +162,14 @@
|
||||
</ul><li><a href="composer/http_client.html">composer.http_client</a></li>
|
||||
<li><a href="composer/unix_socket.html">composer.unix_socket</a></li>
|
||||
<li><a href="pylorax.html">pylorax</a></li>
|
||||
<ul><li><a href="pylorax/api/checkparams.html">pylorax.api.checkparams</a></li>
|
||||
<ul><li><a href="pylorax/api/bisect.html">pylorax.api.bisect</a></li>
|
||||
<li><a href="pylorax/api/checkparams.html">pylorax.api.checkparams</a></li>
|
||||
<li><a href="pylorax/api/cmdline.html">pylorax.api.cmdline</a></li>
|
||||
<li><a href="pylorax/api/compose.html">pylorax.api.compose</a></li>
|
||||
<li><a href="pylorax/api/config.html">pylorax.api.config</a></li>
|
||||
<li><a href="pylorax/api/crossdomain.html">pylorax.api.crossdomain</a></li>
|
||||
<li><a href="pylorax/api/dnfbase.html">pylorax.api.dnfbase</a></li>
|
||||
<li><a href="pylorax/api/gitrpm.html">pylorax.api.gitrpm</a></li>
|
||||
<li><a href="pylorax/api/projects.html">pylorax.api.projects</a></li>
|
||||
<li><a href="pylorax/api/queue.html">pylorax.api.queue</a></li>
|
||||
<li><a href="pylorax/api/recipes.html">pylorax.api.recipes</a></li>
|
||||
@ -182,6 +183,7 @@
|
||||
<li><a href="pylorax/creator.html">pylorax.creator</a></li>
|
||||
<li><a href="pylorax/decorators.html">pylorax.decorators</a></li>
|
||||
<li><a href="pylorax/discinfo.html">pylorax.discinfo</a></li>
|
||||
<li><a href="pylorax/dnfbase.html">pylorax.dnfbase</a></li>
|
||||
<li><a href="pylorax/dnfhelper.html">pylorax.dnfhelper</a></li>
|
||||
<li><a href="pylorax/executils.html">pylorax.executils</a></li>
|
||||
<li><a href="pylorax/imgutils.html">pylorax.imgutils</a></li>
|
||||
@ -204,7 +206,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -223,27 +225,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax — Lorax 29.11 documentation</title>
|
||||
<title>pylorax — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -219,6 +218,9 @@
|
||||
<span class="n">REMOVE_PPC64_DRIVERS</span> <span class="o">=</span> <span class="s2">"floppy scsi_debug nouveau radeon cirrus mgag200"</span>
|
||||
<span class="n">REMOVE_PPC64_MODULES</span> <span class="o">=</span> <span class="s2">"drm plymouth"</span>
|
||||
|
||||
<span class="c1"># Used for DNF conf.module_platform_id</span>
|
||||
<span class="n">DEFAULT_PLATFORM_ID</span> <span class="o">=</span> <span class="s2">"platform:f29"</span>
|
||||
|
||||
<div class="viewcode-block" id="ArchData"><a class="viewcode-back" href="../pylorax.html#pylorax.ArchData">[docs]</a><span class="k">class</span> <span class="nc">ArchData</span><span class="p">(</span><span class="n">DataHolder</span><span class="p">):</span>
|
||||
<span class="n">lib64_arches</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"x86_64"</span><span class="p">,</span> <span class="s2">"ppc64"</span><span class="p">,</span> <span class="s2">"ppc64le"</span><span class="p">,</span> <span class="s2">"s390x"</span><span class="p">,</span> <span class="s2">"ia64"</span><span class="p">,</span> <span class="s2">"aarch64"</span><span class="p">)</span>
|
||||
<span class="n">bcj_arch</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">i386</span><span class="o">=</span><span class="s2">"x86"</span><span class="p">,</span> <span class="n">x86_64</span><span class="o">=</span><span class="s2">"x86"</span><span class="p">,</span>
|
||||
@ -338,7 +340,8 @@
|
||||
<span class="n">add_arch_templates</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">add_arch_template_vars</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">verify</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">user_dracut_args</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">user_dracut_args</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">squashfs_only</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
|
||||
<span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">_configured</span>
|
||||
|
||||
@ -366,6 +369,8 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">init_file_logging</span><span class="p">(</span><span class="n">logdir</span><span class="p">)</span>
|
||||
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"version is </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">vernum</span><span class="p">)</span>
|
||||
<span class="n">log_selinux_state</span><span class="p">()</span>
|
||||
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"using work directory </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"using log directory </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">logdir</span><span class="p">)</span>
|
||||
|
||||
@ -381,22 +386,6 @@
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s2">"no root privileges"</span><span class="p">)</span>
|
||||
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># is selinux disabled?</span>
|
||||
<span class="c1"># With selinux in enforcing mode the rpcbind package required for</span>
|
||||
<span class="c1"># dracut nfs module, which is in turn required by anaconda module,</span>
|
||||
<span class="c1"># will not get installed, because it's preinstall scriptlet fails,</span>
|
||||
<span class="c1"># resulting in an incomplete initial ramdisk image.</span>
|
||||
<span class="c1"># The reason is that the scriptlet runs tools from the shadow-utils</span>
|
||||
<span class="c1"># package in chroot, particularly groupadd and useradd to add the</span>
|
||||
<span class="c1"># required rpc group and rpc user. This operation fails, because</span>
|
||||
<span class="c1"># the selinux context on files in the chroot, that the shadow-utils</span>
|
||||
<span class="c1"># tools need to access (/etc/group, /etc/passwd, /etc/shadow etc.),</span>
|
||||
<span class="c1"># is wrong and selinux therefore disallows access to these files.</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"checking the selinux mode"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">is_selinux_enabled</span><span class="p">()</span> <span class="ow">and</span> <span class="n">selinux</span><span class="o">.</span><span class="n">security_getenforce</span><span class="p">():</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s2">"selinux must be disabled or in Permissive mode"</span><span class="p">)</span>
|
||||
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># do we have a proper dnf base object?</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"checking dnf base object"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">dnf</span><span class="o">.</span><span class="n">Base</span><span class="p">):</span>
|
||||
@ -484,9 +473,16 @@
|
||||
<span class="n">compressargs</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-Xbcj"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">arch</span><span class="o">.</span><span class="n">bcj</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"no BCJ filter for arch </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</span><span class="p">)</span>
|
||||
<span class="n">rb</span><span class="o">.</span><span class="n">create_runtime</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">installroot</span><span class="p">,</span><span class="n">runtime</span><span class="p">),</span>
|
||||
<span class="n">compression</span><span class="o">=</span><span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="n">compressargs</span><span class="p">,</span>
|
||||
<span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">squashfs_only</span><span class="p">:</span>
|
||||
<span class="c1"># Create an ext4 rootfs.img and compress it with squashfs</span>
|
||||
<span class="n">rb</span><span class="o">.</span><span class="n">create_squashfs_runtime</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">installroot</span><span class="p">,</span><span class="n">runtime</span><span class="p">),</span>
|
||||
<span class="n">compression</span><span class="o">=</span><span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="n">compressargs</span><span class="p">,</span>
|
||||
<span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># Create an ext4 rootfs.img and compress it with squashfs</span>
|
||||
<span class="n">rb</span><span class="o">.</span><span class="n">create_ext4_runtime</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">installroot</span><span class="p">,</span><span class="n">runtime</span><span class="p">),</span>
|
||||
<span class="n">compression</span><span class="o">=</span><span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="n">compressargs</span><span class="p">,</span>
|
||||
<span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">)</span>
|
||||
<span class="n">rb</span><span class="o">.</span><span class="n">finished</span><span class="p">()</span>
|
||||
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"preparing to build output tree and boot images"</span><span class="p">)</span>
|
||||
@ -587,6 +583,8 @@
|
||||
<span class="n">f</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">logfile</span><span class="p">))</span><span class="o">+</span><span class="s2">"/program.log"</span>
|
||||
<span class="n">fh</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">FileHandler</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="n">f</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">"w"</span><span class="p">)</span>
|
||||
<span class="n">fh</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">)</span>
|
||||
<span class="n">fmt</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">Formatter</span><span class="p">(</span><span class="s2">"</span><span class="si">%(asctime)s</span><span class="s2"> </span><span class="si">%(levelname)s</span><span class="s2">: </span><span class="si">%(message)s</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="n">fh</span><span class="o">.</span><span class="n">setFormatter</span><span class="p">(</span><span class="n">fmt</span><span class="p">)</span>
|
||||
<span class="n">program_log</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">fh</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
@ -608,6 +606,16 @@
|
||||
<span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
|
||||
<span class="k">pass</span>
|
||||
<span class="k">return</span> <span class="n">templatedir</span></div>
|
||||
|
||||
<div class="viewcode-block" id="log_selinux_state"><a class="viewcode-back" href="../pylorax.html#pylorax.log_selinux_state">[docs]</a><span class="k">def</span> <span class="nf">log_selinux_state</span><span class="p">():</span>
|
||||
<span class="sd">"""Log the current state of selinux"""</span>
|
||||
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">is_selinux_enabled</span><span class="p">():</span>
|
||||
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">security_getenforce</span><span class="p">():</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"selinux is enabled and in Enforcing mode"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"selinux is enabled and in Permissive mode"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"selinux is Disabled"</span><span class="p">)</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -620,7 +628,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -639,27 +647,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
266
docs/html/_modules/pylorax/api/bisect.html
Normal file
266
docs/html/_modules/pylorax/api/bisect.html
Normal file
@ -0,0 +1,266 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.bisect — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
|
||||
|
||||
<script src="../../../_static/js/modernizr.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search">
|
||||
|
||||
|
||||
|
||||
<a href="../../../index.html" class="icon icon-home"> Lorax
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../intro.html">Introduction to Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../intro.html#before-lorax">Before Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../lorax.html">Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../livemedia-creator.html">livemedia-creator</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../lorax-composer.html">lorax-composer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../composer-cli.html">composer-cli</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../product-images.html">Product and Updates Images</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../modules.html">src</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../../../index.html">Lorax</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../../../index.html">Docs</a> »</li>
|
||||
|
||||
<li><a href="../../index.html">Module code</a> »</li>
|
||||
|
||||
<li><a href="../../pylorax.html">pylorax</a> »</li>
|
||||
|
||||
<li>pylorax.api.bisect</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.api.bisect</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c1">#</span>
|
||||
<div class="viewcode-block" id="insort_left"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.bisect.insort_left">[docs]</a><span class="k">def</span> <span class="nf">insort_left</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">lo</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">hi</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""Insert item x in list a, and keep it sorted assuming a is sorted.</span>
|
||||
|
||||
<span class="sd"> :param a: sorted list</span>
|
||||
<span class="sd"> :type a: list</span>
|
||||
<span class="sd"> :param x: item to insert into the list</span>
|
||||
<span class="sd"> :type x: object</span>
|
||||
<span class="sd"> :param key: Function to use to compare items in the list</span>
|
||||
<span class="sd"> :type key: function</span>
|
||||
<span class="sd"> :returns: index where the item was inserted</span>
|
||||
<span class="sd"> :rtype: int</span>
|
||||
|
||||
<span class="sd"> If x is already in a, insert it to the left of the leftmost x.</span>
|
||||
<span class="sd"> Optional args lo (default 0) and hi (default len(a)) bound the</span>
|
||||
<span class="sd"> slice of a to be searched.</span>
|
||||
|
||||
<span class="sd"> This is a modified version of bisect.insort_left that can use a</span>
|
||||
<span class="sd"> function for the compare, and returns the index position where it</span>
|
||||
<span class="sd"> was inserted.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">key</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">lo</span> <span class="o"><</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">'lo must be non-negative'</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">hi</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">hi</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
|
||||
<span class="k">while</span> <span class="n">lo</span> <span class="o"><</span> <span class="n">hi</span><span class="p">:</span>
|
||||
<span class="n">mid</span> <span class="o">=</span> <span class="p">(</span><span class="n">lo</span><span class="o">+</span><span class="n">hi</span><span class="p">)</span><span class="o">//</span><span class="mi">2</span>
|
||||
<span class="k">if</span> <span class="n">key</span><span class="p">(</span><span class="n">a</span><span class="p">[</span><span class="n">mid</span><span class="p">])</span> <span class="o"><</span> <span class="n">key</span><span class="p">(</span><span class="n">x</span><span class="p">):</span> <span class="n">lo</span> <span class="o">=</span> <span class="n">mid</span><span class="o">+</span><span class="mi">1</span>
|
||||
<span class="k">else</span><span class="p">:</span> <span class="n">hi</span> <span class="o">=</span> <span class="n">mid</span>
|
||||
<span class="n">a</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="n">lo</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">lo</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.checkparams — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.checkparams — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -211,7 +210,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -230,27 +229,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.cmdline — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.cmdline — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -179,6 +178,9 @@
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">vernum</span>
|
||||
|
||||
<span class="n">DEFAULT_USER</span> <span class="o">=</span> <span class="s2">"root"</span>
|
||||
<span class="n">DEFAULT_GROUP</span> <span class="o">=</span> <span class="s2">"weldr"</span>
|
||||
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{0}</span><span class="s2">-</span><span class="si">{1}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="n">vernum</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="lorax_composer_parser"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.cmdline.lorax_composer_parser">[docs]</a><span class="k">def</span> <span class="nf">lorax_composer_parser</span><span class="p">():</span>
|
||||
@ -189,9 +191,9 @@
|
||||
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--socket"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"/run/weldr/api.socket"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"SOCKET"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to the socket file to listen on"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--user"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"weldr"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"USER"</span><span class="p">,</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--user"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="n">DEFAULT_USER</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"USER"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"User to use for reduced permissions"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--group"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"weldr"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"GROUP"</span><span class="p">,</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--group"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="n">DEFAULT_GROUP</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"GROUP"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Group to set ownership of the socket to"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--log"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"logfile"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"/var/log/lorax-composer/composer.log"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"LOG"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to logfile (/var/log/lorax-composer/composer.log)"</span><span class="p">)</span>
|
||||
@ -209,6 +211,8 @@
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Top level temporary directory"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--proxy"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"PROXY"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Set proxy for DNF, overrides configuration file setting."</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--no-system-repos"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Do not copy over system repos from /etc/yum.repos.d/ at startup"</span><span class="p">)</span>
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"BLUEPRINTS"</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">"BLUEPRINTS"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to the blueprints"</span><span class="p">)</span>
|
||||
|
||||
@ -225,7 +229,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -244,27 +248,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.compose — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.compose — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -155,7 +154,7 @@
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.api.compose</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span></span><span class="c1"># Copyright (C) 2018-2019 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
@ -192,23 +191,26 @@
|
||||
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
|
||||
<span class="kn">from</span> <span class="nn">io</span> <span class="k">import</span> <span class="n">StringIO</span>
|
||||
<span class="kn">from</span> <span class="nn">math</span> <span class="k">import</span> <span class="n">ceil</span>
|
||||
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="k">as</span> <span class="nn">toml</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
<span class="kn">from</span> <span class="nn">uuid</span> <span class="k">import</span> <span class="n">uuid4</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyanaconda.simpleconfig</span> <span class="k">import</span> <span class="n">SimpleConfigFile</span>
|
||||
|
||||
<span class="c1"># Use pykickstart to calculate disk image size</span>
|
||||
<span class="kn">from</span> <span class="nn">pykickstart.parser</span> <span class="k">import</span> <span class="n">KickstartParser</span>
|
||||
<span class="kn">from</span> <span class="nn">pykickstart.version</span> <span class="k">import</span> <span class="n">makeVersion</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">ArchData</span><span class="p">,</span> <span class="n">find_templates</span><span class="p">,</span> <span class="n">get_buildarch</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.gitrpm</span> <span class="k">import</span> <span class="n">create_gitrpm_repo</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">projects_depsolve</span><span class="p">,</span> <span class="n">projects_depsolve_with_size</span><span class="p">,</span> <span class="n">dep_nevra</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">ProjectsError</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">read_recipe_and_id</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="k">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">write_timestamp</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.base</span> <span class="k">import</span> <span class="n">DataHolder</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">default_image_name</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.ltmpl</span> <span class="k">import</span> <span class="n">LiveTemplateRunner</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span><span class="p">,</span> <span class="n">flatconfig</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="test_templates"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.test_templates">[docs]</a><span class="k">def</span> <span class="nf">test_templates</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">share_dir</span><span class="p">):</span>
|
||||
@ -234,7 +236,7 @@
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="p">[(</span><span class="n">name</span><span class="p">,</span> <span class="s2">"*"</span><span class="p">)</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">packageList</span><span class="p">]</span>
|
||||
<span class="n">grps</span> <span class="o">=</span> <span class="p">[</span><span class="n">grp</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">grp</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">groupList</span><span class="p">]</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">_</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span> <span class="n">grps</span><span class="p">)</span>
|
||||
<span class="n">projects_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span> <span class="n">grps</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">template_errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Error depsolving </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">compose_type</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
|
||||
@ -269,9 +271,399 @@
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">r</span><span class="o">.</span><span class="n">sslverify</span><span class="p">:</span>
|
||||
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">'--noverifyssl'</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">sslcacert</span><span class="p">:</span>
|
||||
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">' --sslcacert="</span><span class="si">%s</span><span class="s1">"'</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">sslcacert</span>
|
||||
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientcert</span><span class="p">:</span>
|
||||
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">' --sslclientcert="</span><span class="si">%s</span><span class="s1">"'</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientcert</span>
|
||||
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientkey</span><span class="p">:</span>
|
||||
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">' --sslclientkey="</span><span class="si">%s</span><span class="s1">"'</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientkey</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">cmd</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="bootloader_append"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.bootloader_append">[docs]</a><span class="k">def</span> <span class="nf">bootloader_append</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">kernel_append</span><span class="p">):</span>
|
||||
<span class="sd">""" Insert the kernel_append string into the --append argument</span>
|
||||
|
||||
<span class="sd"> :param line: The bootloader ... line</span>
|
||||
<span class="sd"> :type line: str</span>
|
||||
<span class="sd"> :param kernel_append: The arguments to append to the --append section</span>
|
||||
<span class="sd"> :type kernel_append: str</span>
|
||||
|
||||
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
|
||||
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">bootloader</span><span class="o">.</span><span class="n">appendLine</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">bootloader</span><span class="o">.</span><span class="n">appendLine</span> <span class="o">+=</span> <span class="s2">" </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">kernel_append</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">bootloader</span><span class="o">.</span><span class="n">appendLine</span> <span class="o">=</span> <span class="n">kernel_append</span>
|
||||
|
||||
<span class="c1"># Converting back to a string includes a comment, return just the bootloader line</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">bootloader</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_kernel_append"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_kernel_append">[docs]</a><span class="k">def</span> <span class="nf">get_kernel_append</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the customizations.kernel append value</span>
|
||||
|
||||
<span class="sd"> :param recipe:</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: append value or empty string</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
|
||||
<span class="s2">"kernel"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span> <span class="ow">or</span> \
|
||||
<span class="s2">"append"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"kernel"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="s2">""</span>
|
||||
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"kernel"</span><span class="p">][</span><span class="s2">"append"</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="timezone_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.timezone_cmd">[docs]</a><span class="k">def</span> <span class="nf">timezone_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
|
||||
<span class="sd">""" Update the timezone line with the settings</span>
|
||||
|
||||
<span class="sd"> :param line: The timezone ... line</span>
|
||||
<span class="sd"> :type line: str</span>
|
||||
<span class="sd"> :param settings: A dict with timezone and/or ntpservers list</span>
|
||||
<span class="sd"> :type settings: dict</span>
|
||||
|
||||
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
|
||||
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"timezone"</span> <span class="ow">in</span> <span class="n">settings</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">timezone</span><span class="o">.</span><span class="n">timezone</span> <span class="o">=</span> <span class="n">settings</span><span class="p">[</span><span class="s2">"timezone"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="s2">"ntpservers"</span> <span class="ow">in</span> <span class="n">settings</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">timezone</span><span class="o">.</span><span class="n">ntpservers</span> <span class="o">=</span> <span class="n">settings</span><span class="p">[</span><span class="s2">"ntpservers"</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># Converting back to a string includes a comment, return just the timezone line</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">timezone</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_timezone_settings"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_timezone_settings">[docs]</a><span class="k">def</span> <span class="nf">get_timezone_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the customizations.timezone dict</span>
|
||||
|
||||
<span class="sd"> :param recipe:</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: append value or empty string</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
|
||||
<span class="s2">"timezone"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="p">{}</span>
|
||||
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"timezone"</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="lang_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.lang_cmd">[docs]</a><span class="k">def</span> <span class="nf">lang_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">languages</span><span class="p">):</span>
|
||||
<span class="sd">""" Update the lang line with the languages</span>
|
||||
|
||||
<span class="sd"> :param line: The lang ... line</span>
|
||||
<span class="sd"> :type line: str</span>
|
||||
<span class="sd"> :param settings: The list of languages</span>
|
||||
<span class="sd"> :type settings: list</span>
|
||||
|
||||
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
|
||||
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">languages</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">lang</span> <span class="o">=</span> <span class="n">languages</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">languages</span><span class="p">)</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">addsupport</span> <span class="o">=</span> <span class="n">languages</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||
|
||||
<span class="c1"># Converting back to a string includes a comment, return just the lang line</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">lang</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_languages"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_languages">[docs]</a><span class="k">def</span> <span class="nf">get_languages</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the customizations.locale.languages list</span>
|
||||
|
||||
<span class="sd"> :param recipe: The recipe</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: list of language strings</span>
|
||||
<span class="sd"> :rtype: list</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
|
||||
<span class="s2">"locale"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span> <span class="ow">or</span> \
|
||||
<span class="s2">"languages"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"locale"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="p">[]</span>
|
||||
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"locale"</span><span class="p">][</span><span class="s2">"languages"</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="keyboard_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.keyboard_cmd">[docs]</a><span class="k">def</span> <span class="nf">keyboard_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">layout</span><span class="p">):</span>
|
||||
<span class="sd">""" Update the keyboard line with the layout</span>
|
||||
|
||||
<span class="sd"> :param line: The keyboard ... line</span>
|
||||
<span class="sd"> :type line: str</span>
|
||||
<span class="sd"> :param settings: The keyboard layout</span>
|
||||
<span class="sd"> :type settings: str</span>
|
||||
|
||||
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
|
||||
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">layout</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">keyboard</span><span class="o">.</span><span class="n">keyboard</span> <span class="o">=</span> <span class="n">layout</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">keyboard</span><span class="o">.</span><span class="n">vc_keymap</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">keyboard</span><span class="o">.</span><span class="n">x_layouts</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
|
||||
<span class="c1"># Converting back to a string includes a comment, return just the keyboard line</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">keyboard</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_keyboard_layout"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_keyboard_layout">[docs]</a><span class="k">def</span> <span class="nf">get_keyboard_layout</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the customizations.locale.keyboard list</span>
|
||||
|
||||
<span class="sd"> :param recipe: The recipe</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: The keyboard layout string</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
|
||||
<span class="s2">"locale"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span> <span class="ow">or</span> \
|
||||
<span class="s2">"keyboard"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"locale"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="p">[]</span>
|
||||
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"locale"</span><span class="p">][</span><span class="s2">"keyboard"</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="firewall_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.firewall_cmd">[docs]</a><span class="k">def</span> <span class="nf">firewall_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
|
||||
<span class="sd">""" Update the firewall line with the new ports and services</span>
|
||||
|
||||
<span class="sd"> :param line: The firewall ... line</span>
|
||||
<span class="sd"> :type line: str</span>
|
||||
<span class="sd"> :param settings: A dict with the list of services and ports to enable and disable</span>
|
||||
<span class="sd"> :type settings: dict</span>
|
||||
|
||||
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
|
||||
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Do not override firewall --disabled</span>
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">enabled</span> <span class="o">!=</span> <span class="kc">False</span> <span class="ow">and</span> <span class="n">settings</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">ports</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">settings</span><span class="p">[</span><span class="s2">"ports"</span><span class="p">]</span> <span class="o">+</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">ports</span><span class="p">))</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">services</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">settings</span><span class="p">[</span><span class="s2">"enabled"</span><span class="p">]</span> <span class="o">+</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">services</span><span class="p">))</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">remove_services</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">settings</span><span class="p">[</span><span class="s2">"disabled"</span><span class="p">]</span> <span class="o">+</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">remove_services</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Converting back to a string includes a comment, return just the keyboard line</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">firewall</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_firewall_settings"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_firewall_settings">[docs]</a><span class="k">def</span> <span class="nf">get_firewall_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the customizations.firewall settings</span>
|
||||
|
||||
<span class="sd"> :param recipe: The recipe</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: A dict of settings</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">settings</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"ports"</span><span class="p">:</span> <span class="p">[],</span> <span class="s2">"enabled"</span><span class="p">:</span> <span class="p">[],</span> <span class="s2">"disabled"</span><span class="p">:</span> <span class="p">[]}</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
|
||||
<span class="s2">"firewall"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">settings</span>
|
||||
|
||||
<span class="n">settings</span><span class="p">[</span><span class="s2">"ports"</span><span class="p">]</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"firewall"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ports"</span><span class="p">,</span> <span class="p">[])</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"services"</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"firewall"</span><span class="p">]:</span>
|
||||
<span class="n">settings</span><span class="p">[</span><span class="s2">"enabled"</span><span class="p">]</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"firewall"</span><span class="p">][</span><span class="s2">"services"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"enabled"</span><span class="p">,</span> <span class="p">[])</span>
|
||||
<span class="n">settings</span><span class="p">[</span><span class="s2">"disabled"</span><span class="p">]</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"firewall"</span><span class="p">][</span><span class="s2">"services"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"disabled"</span><span class="p">,</span> <span class="p">[])</span>
|
||||
<span class="k">return</span> <span class="n">settings</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="services_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.services_cmd">[docs]</a><span class="k">def</span> <span class="nf">services_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
|
||||
<span class="sd">""" Update the services line with additional services to enable/disable</span>
|
||||
|
||||
<span class="sd"> :param line: The services ... line</span>
|
||||
<span class="sd"> :type line: str</span>
|
||||
<span class="sd"> :param settings: A dict with the list of services to enable and disable</span>
|
||||
<span class="sd"> :type settings: dict</span>
|
||||
|
||||
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
|
||||
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Empty services and no additional settings, return an empty string</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">line</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">settings</span><span class="p">[</span><span class="s2">"enabled"</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">settings</span><span class="p">[</span><span class="s2">"disabled"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="s2">""</span>
|
||||
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Allow passing in a 'default' so that the enable/disable may be applied to it, without</span>
|
||||
<span class="c1"># parsing it and emitting a kickstart error message</span>
|
||||
<span class="k">if</span> <span class="n">line</span> <span class="o">!=</span> <span class="s2">"services"</span><span class="p">:</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Add to any existing services, removing any duplicates</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">enabled</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">settings</span><span class="p">[</span><span class="s2">"enabled"</span><span class="p">]</span> <span class="o">+</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">enabled</span><span class="p">))</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">disabled</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">settings</span><span class="p">[</span><span class="s2">"disabled"</span><span class="p">]</span> <span class="o">+</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">disabled</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Converting back to a string includes a comment, return just the keyboard line</span>
|
||||
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">services</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_services"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_services">[docs]</a><span class="k">def</span> <span class="nf">get_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the customizations.services settings</span>
|
||||
|
||||
<span class="sd"> :param recipe: The recipe</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: A dict of settings</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">settings</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"enabled"</span><span class="p">:</span> <span class="p">[],</span> <span class="s2">"disabled"</span><span class="p">:</span> <span class="p">[]}</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
|
||||
<span class="s2">"services"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">settings</span>
|
||||
|
||||
<span class="n">settings</span><span class="p">[</span><span class="s2">"enabled"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"services"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"enabled"</span><span class="p">,</span> <span class="p">[]))</span>
|
||||
<span class="n">settings</span><span class="p">[</span><span class="s2">"disabled"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">][</span><span class="s2">"services"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"disabled"</span><span class="p">,</span> <span class="p">[]))</span>
|
||||
<span class="k">return</span> <span class="n">settings</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_default_services"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_default_services">[docs]</a><span class="k">def</span> <span class="nf">get_default_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Get the default string for services, based on recipe</span>
|
||||
<span class="sd"> :param recipe: The recipe</span>
|
||||
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
<span class="sd"> :returns: string with "services" or ""</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
|
||||
<span class="sd"> When no services have been selected we don't need to add anything to the kickstart</span>
|
||||
<span class="sd"> so return an empty string. Otherwise return "services" which will be updated with</span>
|
||||
<span class="sd"> the settings.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">services</span> <span class="o">=</span> <span class="n">get_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">services</span><span class="p">[</span><span class="s2">"enabled"</span><span class="p">]</span> <span class="ow">or</span> <span class="n">services</span><span class="p">[</span><span class="s2">"disabled"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="s2">"services"</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="s2">""</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="customize_ks_template"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.customize_ks_template">[docs]</a><span class="k">def</span> <span class="nf">customize_ks_template</span><span class="p">(</span><span class="n">ks_template</span><span class="p">,</span> <span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">""" Customize the kickstart template and return it</span>
|
||||
|
||||
<span class="sd"> :param ks_template: The kickstart template</span>
|
||||
<span class="sd"> :type ks_template: str</span>
|
||||
<span class="sd"> :param recipe:</span>
|
||||
<span class="sd"> :type recipe: Recipe object</span>
|
||||
|
||||
<span class="sd"> Apply customizations to existing template commands, or add defaults for ones that are</span>
|
||||
<span class="sd"> missing and required.</span>
|
||||
|
||||
<span class="sd"> Apply customizations.kernel.append to the bootloader argument in the template.</span>
|
||||
<span class="sd"> Add bootloader line if it is missing.</span>
|
||||
|
||||
<span class="sd"> Add default timezone if needed. It does NOT replace an existing timezone entry</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Commands to be modified [NEW-COMMAND-FUNC, NEW-VALUE, DEFAULT, REPLACE]</span>
|
||||
<span class="c1"># The function is called with a kickstart command string and the value to replace</span>
|
||||
<span class="c1"># The value is specific to the command, and is understood by the function</span>
|
||||
<span class="c1"># The default is a complete kickstart command string, suitable for writing to the template</span>
|
||||
<span class="c1"># If REPLACE is False it will not change an existing entry only add a missing one</span>
|
||||
<span class="n">commands</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"bootloader"</span><span class="p">:</span> <span class="p">[</span><span class="n">bootloader_append</span><span class="p">,</span>
|
||||
<span class="n">get_kernel_append</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
|
||||
<span class="s1">'bootloader --location=none'</span><span class="p">,</span> <span class="kc">True</span><span class="p">],</span>
|
||||
<span class="s2">"timezone"</span><span class="p">:</span> <span class="p">[</span><span class="n">timezone_cmd</span><span class="p">,</span>
|
||||
<span class="n">get_timezone_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
|
||||
<span class="s1">'timezone UTC'</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span>
|
||||
<span class="s2">"lang"</span><span class="p">:</span> <span class="p">[</span><span class="n">lang_cmd</span><span class="p">,</span>
|
||||
<span class="n">get_languages</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
|
||||
<span class="s1">'lang en_US.UTF-8'</span><span class="p">,</span> <span class="kc">True</span><span class="p">],</span>
|
||||
<span class="s2">"keyboard"</span><span class="p">:</span> <span class="p">[</span><span class="n">keyboard_cmd</span><span class="p">,</span>
|
||||
<span class="n">get_keyboard_layout</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
|
||||
<span class="s1">'keyboard --xlayouts us --vckeymap us'</span><span class="p">,</span> <span class="kc">True</span><span class="p">],</span>
|
||||
<span class="s2">"firewall"</span><span class="p">:</span> <span class="p">[</span><span class="n">firewall_cmd</span><span class="p">,</span>
|
||||
<span class="n">get_firewall_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
|
||||
<span class="s1">'firewall --enabled'</span><span class="p">,</span> <span class="kc">True</span><span class="p">],</span>
|
||||
<span class="s2">"services"</span><span class="p">:</span> <span class="p">[</span><span class="n">services_cmd</span><span class="p">,</span>
|
||||
<span class="n">get_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
|
||||
<span class="n">get_default_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span> <span class="kc">True</span><span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
<span class="n">found</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
|
||||
<span class="n">output</span> <span class="o">=</span> <span class="n">StringIO</span><span class="p">()</span>
|
||||
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">ks_template</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
|
||||
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">commands</span><span class="p">:</span>
|
||||
<span class="p">(</span><span class="n">new_command</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">default</span><span class="p">,</span> <span class="n">replace</span><span class="p">)</span> <span class="o">=</span> <span class="n">commands</span><span class="p">[</span><span class="n">cmd</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">cmd</span><span class="p">):</span>
|
||||
<span class="n">found</span><span class="p">[</span><span class="n">cmd</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">if</span> <span class="n">value</span> <span class="ow">and</span> <span class="n">replace</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Replacing </span><span class="si">%s</span><span class="s2"> with </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">new_command</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">value</span><span class="p">),</span> <span class="n">file</span><span class="o">=</span><span class="n">output</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Skipping </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">output</span><span class="p">)</span>
|
||||
<span class="k">break</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># No matches, write the line as-is</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">output</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Write out defaults for the ones not found</span>
|
||||
<span class="c1"># These must go FIRST because the template still needs to have the packages added</span>
|
||||
<span class="n">defaults</span> <span class="o">=</span> <span class="n">StringIO</span><span class="p">()</span>
|
||||
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">commands</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">found</span><span class="p">:</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="p">(</span><span class="n">new_command</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">default</span><span class="p">,</span> <span class="n">_</span><span class="p">)</span> <span class="o">=</span> <span class="n">commands</span><span class="p">[</span><span class="n">cmd</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">value</span> <span class="ow">and</span> <span class="n">default</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Setting </span><span class="si">%s</span><span class="s2"> to use </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">new_command</span><span class="p">(</span><span class="n">default</span><span class="p">,</span> <span class="n">value</span><span class="p">),</span> <span class="n">file</span><span class="o">=</span><span class="n">defaults</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">default</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Setting </span><span class="si">%s</span><span class="s2"> to </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">default</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">defaults</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">defaults</span><span class="o">.</span><span class="n">getvalue</span><span class="p">()</span> <span class="o">+</span> <span class="n">output</span><span class="o">.</span><span class="n">getvalue</span><span class="p">()</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="write_ks_root"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_root">[docs]</a><span class="k">def</span> <span class="nf">write_ks_root</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">):</span>
|
||||
<span class="sd">""" Write kickstart root password and sshkey entry</span>
|
||||
|
||||
<span class="sd"> :param f: kickstart file object</span>
|
||||
<span class="sd"> :type f: open file object</span>
|
||||
<span class="sd"> :param user: A blueprint user dictionary</span>
|
||||
<span class="sd"> :type user: dict</span>
|
||||
<span class="sd"> :returns: True if it wrote a rootpw command to the kickstart</span>
|
||||
<span class="sd"> :rtype: bool</span>
|
||||
|
||||
<span class="sd"> If the entry contains a ssh key, use sshkey to write it</span>
|
||||
<span class="sd"> If it contains password, use rootpw to set it</span>
|
||||
|
||||
<span class="sd"> root cannot be used with the user command. So only key and password are supported</span>
|
||||
<span class="sd"> for root.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="c1"># ssh key uses the sshkey kickstart command</span>
|
||||
<span class="k">if</span> <span class="s2">"key"</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'sshkey --user </span><span class="si">%s</span><span class="s1"> "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s2">"key"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"password"</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"password"</span><span class="p">]</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">prefix</span><span class="p">)</span> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"$2b$"</span><span class="p">,</span> <span class="s2">"$6$"</span><span class="p">,</span> <span class="s2">"$5$"</span><span class="p">]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Detected pre-crypted password"</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --iscrypted "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">"password"</span><span class="p">])</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Detected plaintext password"</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --plaintext "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">"password"</span><span class="p">])</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">wrote_rootpw</span></div>
|
||||
|
||||
<div class="viewcode-block" id="write_ks_user"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_user">[docs]</a><span class="k">def</span> <span class="nf">write_ks_user</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">):</span>
|
||||
<span class="sd">""" Write kickstart user and sshkey entry</span>
|
||||
|
||||
@ -284,9 +676,6 @@
|
||||
<span class="sd"> All of the user fields are optional, except name, write out a kickstart user entry</span>
|
||||
<span class="sd"> with whatever options are relevant.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"name"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"user entry requires a name"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># ssh key uses the sshkey kickstart command</span>
|
||||
<span class="k">if</span> <span class="s2">"key"</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'sshkey --user </span><span class="si">%s</span><span class="s1"> "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s2">"key"</span><span class="p">]))</span>
|
||||
@ -355,9 +744,14 @@
|
||||
<span class="sd"> :raises: RuntimeError if there was a problem writing to the kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --lock</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># allow customizations to be incorrectly specified as [[customizations]] instead of [customizations]</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">customizations</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="n">customizations</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"hostname"</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"network --hostname=</span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">"hostname"</span><span class="p">])</span>
|
||||
|
||||
@ -372,9 +766,19 @@
|
||||
|
||||
<span class="c1"># Creating a user also creates a group. Make a list of the names for later</span>
|
||||
<span class="n">user_groups</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="c1"># kickstart requires a rootpw line</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">if</span> <span class="s2">"user"</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
|
||||
<span class="c1"># only name is required, everything else is optional</span>
|
||||
<span class="k">for</span> <span class="n">user</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">"user"</span><span class="p">]:</span>
|
||||
<span class="k">if</span> <span class="s2">"name"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"user entry requires a name"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># root is special, cannot use normal user command for it</span>
|
||||
<span class="k">if</span> <span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"root"</span><span class="p">:</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="n">write_ks_root</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="n">write_ks_user</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">)</span>
|
||||
<span class="n">user_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span>
|
||||
|
||||
@ -383,7 +787,45 @@
|
||||
<span class="k">if</span> <span class="n">group</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user_groups</span><span class="p">:</span>
|
||||
<span class="n">write_ks_group</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">group</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Skipping group </span><span class="si">%s</span><span class="s2">, already created by user"</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span></div>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Skipping group </span><span class="si">%s</span><span class="s2">, already created by user"</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># Lock the root account if no root user password has been specified</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">wrote_rootpw</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --lock</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_extra_pkgs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_extra_pkgs">[docs]</a><span class="k">def</span> <span class="nf">get_extra_pkgs</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">share_dir</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">):</span>
|
||||
<span class="sd">"""Return extra packages needed for the output type</span>
|
||||
|
||||
<span class="sd"> :param dbo: dnf base object</span>
|
||||
<span class="sd"> :type dbo: dnf.Base</span>
|
||||
<span class="sd"> :param share_dir: Path to the top level share directory</span>
|
||||
<span class="sd"> :type share_dir: str</span>
|
||||
<span class="sd"> :param compose_type: The type of output to create from the recipe</span>
|
||||
<span class="sd"> :type compose_type: str</span>
|
||||
<span class="sd"> :returns: List of package names (name only, not NEVRA)</span>
|
||||
<span class="sd"> :rtype: list</span>
|
||||
|
||||
<span class="sd"> Currently this is only needed by live-iso, it reads ./live/live-install.tmpl and</span>
|
||||
<span class="sd"> processes only the installpkg lines. It lists the packages needed to complete creation of the</span>
|
||||
<span class="sd"> iso using the templates such as x86.tmpl</span>
|
||||
|
||||
<span class="sd"> Keep in mind that the live-install.tmpl is shared between livemedia-creator and lorax-composer,</span>
|
||||
<span class="sd"> even though the results are applied differently.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">compose_type</span> <span class="o">!=</span> <span class="s2">"live-iso"</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="p">[]</span>
|
||||
|
||||
<span class="c1"># get the arch information to pass to the runner</span>
|
||||
<span class="n">arch</span> <span class="o">=</span> <span class="n">ArchData</span><span class="p">(</span><span class="n">get_buildarch</span><span class="p">(</span><span class="n">dbo</span><span class="p">))</span>
|
||||
<span class="n">defaults</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">basearch</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</span><span class="p">)</span>
|
||||
<span class="n">templatedir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">find_templates</span><span class="p">(</span><span class="n">share_dir</span><span class="p">),</span> <span class="s2">"live"</span><span class="p">)</span>
|
||||
<span class="n">runner</span> <span class="o">=</span> <span class="n">LiveTemplateRunner</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="n">templatedir</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="n">defaults</span><span class="p">)</span>
|
||||
<span class="n">runner</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="s2">"live-install.tmpl"</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"extra pkgs = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">runner</span><span class="o">.</span><span class="n">pkgs</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">runner</span><span class="o">.</span><span class="n">pkgnames</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="start_build"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.start_build">[docs]</a><span class="k">def</span> <span class="nf">start_build</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">dnflock</span><span class="p">,</span> <span class="n">gitlock</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">,</span> <span class="n">test_mode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">""" Start the build</span>
|
||||
@ -406,17 +848,25 @@
|
||||
<span class="k">if</span> <span class="n">compose_type</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">compose_types</span><span class="p">(</span><span class="n">share_dir</span><span class="p">):</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Invalid compose type (</span><span class="si">%s</span><span class="s2">), must be one of </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">compose_type</span><span class="p">,</span> <span class="n">compose_types</span><span class="p">(</span><span class="n">share_dir</span><span class="p">)))</span>
|
||||
|
||||
<span class="c1"># Some image types (live-iso) need extra packages for composer to execute the output template</span>
|
||||
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">extra_pkgs</span> <span class="o">=</span> <span class="n">get_extra_pkgs</span><span class="p">(</span><span class="n">dnflock</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">share_dir</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Extra packages needed for </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">,</span> <span class="n">extra_pkgs</span><span class="p">)</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">gitlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="p">(</span><span class="n">commit_id</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span> <span class="o">=</span> <span class="n">read_recipe_and_id</span><span class="p">(</span><span class="n">gitlock</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Combine modules and packages and depsolve the list</span>
|
||||
<span class="c1"># TODO include the version/glob in the depsolving</span>
|
||||
<span class="n">module_nver</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">module_nver</span>
|
||||
<span class="n">package_nver</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">package_nver</span>
|
||||
<span class="n">package_nver</span><span class="o">.</span><span class="n">extend</span><span class="p">([(</span><span class="n">name</span><span class="p">,</span> <span class="s1">'*'</span><span class="p">)</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">extra_pkgs</span><span class="p">])</span>
|
||||
|
||||
<span class="n">projects</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">module_nver</span><span class="o">+</span><span class="n">package_nver</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="n">deps</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"depsolving </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="c1"># This can possibly update repodata and reset the YumBase object.</span>
|
||||
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock_check</span><span class="p">:</span>
|
||||
<span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">dnflock</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">recipe</span><span class="o">.</span><span class="n">group_names</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"start_build depsolve: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -441,9 +891,7 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"installed_size = </span><span class="si">%d</span><span class="s2">, template_size=</span><span class="si">%d</span><span class="s2">"</span><span class="p">,</span> <span class="n">installed_size</span><span class="p">,</span> <span class="n">template_size</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Minimum LMC disk size is 1GiB, and anaconda bumps the estimated size up by 10% (which doesn't always work).</span>
|
||||
<span class="c1"># XXX BUT Anaconda has a bug, it won't execute a kickstart on a disk smaller than 3000 MB</span>
|
||||
<span class="c1"># XXX There is an upstream patch pending, but until then, use that as the minimum</span>
|
||||
<span class="n">installed_size</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mf">3e9</span><span class="p">,</span> <span class="nb">int</span><span class="p">((</span><span class="n">installed_size</span><span class="o">+</span><span class="n">template_size</span><span class="p">)))</span> <span class="o">*</span> <span class="mf">1.2</span>
|
||||
<span class="n">installed_size</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="n">installed_size</span><span class="o">+</span><span class="n">template_size</span><span class="p">))</span> <span class="o">*</span> <span class="mf">1.2</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"/ partition size = </span><span class="si">%d</span><span class="s2">"</span><span class="p">,</span> <span class="n">installed_size</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Create the results directory</span>
|
||||
@ -480,6 +928,9 @@
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repos</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"No enabled repos, canceling build."</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Create the git rpms, if any, and return the path to the repo under results_dir</span>
|
||||
<span class="n">gitrpm_repo</span> <span class="o">=</span> <span class="n">create_gitrpm_repo</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Create the final kickstart with repos and package list</span>
|
||||
<span class="n">ks_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"final-kickstart.ks"</span><span class="p">)</span>
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">ks_path</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
||||
@ -491,19 +942,31 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"repo composer-</span><span class="si">%s</span><span class="s2"> = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">idx</span><span class="p">,</span> <span class="n">ks_repo</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'repo --name="composer-</span><span class="si">%s</span><span class="s1">" </span><span class="si">%s</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">idx</span><span class="p">,</span> <span class="n">ks_repo</span><span class="p">))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">gitrpm_repo</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"repo gitrpms = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">gitrpm_repo</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'repo --name="gitrpms" --baseurl="file://</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">gitrpm_repo</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Setup the disk for booting</span>
|
||||
<span class="c1"># TODO Add GPT and UEFI boot support</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'clearpart --all --initlabel</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Write the root partition and it's size in MB (rounded up)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'part / --fstype="ext4" --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">ceil</span><span class="p">(</span><span class="n">installed_size</span> <span class="o">/</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'part / --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">ceil</span><span class="p">(</span><span class="n">installed_size</span> <span class="o">/</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
|
||||
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">ks_template</span><span class="p">)</span>
|
||||
<span class="c1"># Some customizations modify the template before writing it</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">customize_ks_template</span><span class="p">(</span><span class="n">ks_template</span><span class="p">,</span> <span class="n">recipe</span><span class="p">))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">deps</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">dep_nevra</span><span class="p">(</span><span class="n">d</span><span class="p">)</span><span class="o">+</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Include the rpms from the gitrpm repo directory</span>
|
||||
<span class="k">if</span> <span class="n">gitrpm_repo</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">rpm</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">gitrpm_repo</span><span class="p">,</span> <span class="s2">"*.rpm"</span><span class="p">)):</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">rpm</span><span class="p">)[:</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">+</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">%e</span><span class="s2">nd</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Other customizations can be appended to the kickstart</span>
|
||||
<span class="n">add_customizations</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Setup the config to pass to novirt_install</span>
|
||||
@ -513,19 +976,23 @@
|
||||
<span class="c1"># Get the title, project, and release version from the host</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"/etc/os-release is missing, cannot determine product or release version"</span><span class="p">)</span>
|
||||
<span class="n">os_release</span> <span class="o">=</span> <span class="n">SimpleConfigFile</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">)</span>
|
||||
<span class="n">os_release</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||||
<span class="n">os_release</span> <span class="o">=</span> <span class="n">flatconfig</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"os_release = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">os_release</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"os_release = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">dict</span><span class="p">(</span><span class="n">os_release</span><span class="o">.</span><span class="n">items</span><span class="p">()))</span>
|
||||
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"title"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"PRETTY_NAME"</span><span class="p">)</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"project"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"NAME"</span><span class="p">)</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"releasever"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"VERSION_ID"</span><span class="p">)</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"title"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"PRETTY_NAME"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"project"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"NAME"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"releasever"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"VERSION_ID"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"volid"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"extra_boot_args"</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_kernel_append</span><span class="p">(</span><span class="n">recipe</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"compression"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">cfg_args</span><span class="p">:</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"compression"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"xz"</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"compress_args"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">cfg_args</span><span class="p">:</span>
|
||||
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">"compress_args"</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
|
||||
<span class="n">cfg_args</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
|
||||
<span class="s2">"compression"</span><span class="p">:</span> <span class="s2">"xz"</span><span class="p">,</span>
|
||||
<span class="s2">"compress_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"ks"</span><span class="p">:</span> <span class="p">[</span><span class="n">ks_path</span><span class="p">],</span>
|
||||
<span class="s2">"logfile"</span><span class="p">:</span> <span class="n">log_dir</span><span class="p">,</span>
|
||||
<span class="s2">"timeout"</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span> <span class="c1"># 60 minute timeout</span>
|
||||
@ -570,6 +1037,7 @@
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
@ -577,9 +1045,11 @@
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="n">default_image_name</span><span class="p">(</span><span class="s2">"xz"</span><span class="p">,</span> <span class="s2">"root.tar"</span><span class="p">),</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
@ -591,6 +1061,7 @@
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
@ -598,9 +1069,11 @@
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"live.iso"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">"Anaconda"</span><span class="p">,</span> <span class="c1"># Live booting may expect this to be 'Anaconda'</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
@ -615,6 +1088,7 @@
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
@ -622,9 +1096,11 @@
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.img"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
@ -637,6 +1113,7 @@
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
@ -644,9 +1121,11 @@
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
@ -659,6 +1138,7 @@
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
@ -666,9 +1146,188 @@
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"filesystem.img"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"ami"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.ami"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"vhd"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"vpc"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"-o"</span><span class="p">,</span> <span class="s2">"subformat=fixed,force_size"</span><span class="p">],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.vhd"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"vmdk"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"vmdk"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.vmdk"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"openstack"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"google"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">1024</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.tar.gz"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="s2">"disk.raw"</span><span class="p">,</span>
|
||||
<span class="s2">"compression"</span><span class="p">:</span> <span class="s2">"gzip"</span><span class="p">,</span>
|
||||
<span class="s2">"compress_args"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"-9"</span><span class="p">],</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"hyper-v"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"vhdx"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.vhdx"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"alibaba"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_size_align"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"tar_disk_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
@ -712,7 +1371,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -731,27 +1390,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.config — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.config — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -174,10 +173,11 @@
|
||||
<span class="kn">import</span> <span class="nn">configparser</span>
|
||||
<span class="kn">import</span> <span class="nn">grp</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">pwd</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<div class="viewcode-block" id="ComposerConfig"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig">[docs]</a><span class="k">class</span> <span class="nc">ComposerConfig</span><span class="p">(</span><span class="n">configparser</span><span class="o">.</span><span class="n">SafeConfigParser</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="ComposerConfig"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig">[docs]</a><span class="k">class</span> <span class="nc">ComposerConfig</span><span class="p">(</span><span class="n">configparser</span><span class="o">.</span><span class="n">ConfigParser</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="ComposerConfig.get_default"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig.get_default">[docs]</a> <span class="k">def</span> <span class="nf">get_default</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">section</span><span class="p">,</span> <span class="n">option</span><span class="p">,</span> <span class="n">default</span><span class="p">):</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span> <span class="n">option</span><span class="p">)</span>
|
||||
@ -224,20 +224,57 @@
|
||||
|
||||
<span class="k">return</span> <span class="n">conf</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_dnf_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_dnf_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_dnf_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span>
|
||||
<span class="sd">"""Make any missing dnf directories</span>
|
||||
<div class="viewcode-block" id="make_owned_dir"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_owned_dir">[docs]</a><span class="k">def</span> <span class="nf">make_owned_dir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Make a directory and its parents, setting owner and group</span>
|
||||
|
||||
<span class="sd"> :param p_dir: path to directory to create</span>
|
||||
<span class="sd"> :type p_dir: string</span>
|
||||
<span class="sd"> :param uid: uid of owner</span>
|
||||
<span class="sd"> :type uid: int</span>
|
||||
<span class="sd"> :param gid: gid of owner</span>
|
||||
<span class="sd"> :type gid: int</span>
|
||||
<span class="sd"> :returns: list of errors</span>
|
||||
<span class="sd"> :rtype: list of str</span>
|
||||
|
||||
<span class="sd"> Check to make sure it does not have o+rw permissions and that it is owned by uid:gid</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
|
||||
<span class="c1"># Make sure no o+rw permissions are set</span>
|
||||
<span class="n">orig_umask</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="mo">0o006</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mo">0o771</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">chown</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="n">orig_umask</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">p_stat</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_mode</span> <span class="o">&</span> <span class="mo">0o006</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Incorrect permissions on </span><span class="si">%s</span><span class="s2">, no o+rw permissions are allowed."</span> <span class="o">%</span> <span class="n">p_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_gid</span> <span class="o">!=</span> <span class="n">gid</span> <span class="ow">or</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_uid</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">gr_name</span> <span class="o">=</span> <span class="n">grp</span><span class="o">.</span><span class="n">getgrgid</span><span class="p">(</span><span class="n">gid</span><span class="p">)</span><span class="o">.</span><span class="n">gr_name</span>
|
||||
<span class="n">u_name</span> <span class="o">=</span> <span class="n">pwd</span><span class="o">.</span><span class="n">getpwuid</span><span class="p">(</span><span class="n">uid</span><span class="p">)</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> should be owned by </span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">u_name</span><span class="p">,</span> <span class="n">gr_name</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">errors</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_dnf_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_dnf_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_dnf_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Make any missing dnf directories owned by user:group</span>
|
||||
|
||||
<span class="sd"> :param conf: The configuration to use</span>
|
||||
<span class="sd"> :type conf: ComposerConfig</span>
|
||||
<span class="sd"> :returns: None</span>
|
||||
<span class="sd"> :param uid: uid of owner</span>
|
||||
<span class="sd"> :type uid: int</span>
|
||||
<span class="sd"> :param gid: gid of owner</span>
|
||||
<span class="sd"> :type gid: int</span>
|
||||
<span class="sd"> :returns: list of errors</span>
|
||||
<span class="sd"> :rtype: list of str</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"dnf_conf"</span><span class="p">,</span> <span class="s2">"repo_dir"</span><span class="p">,</span> <span class="s2">"cache_dir"</span><span class="p">,</span> <span class="s2">"dnf_root"</span><span class="p">]:</span>
|
||||
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="n">p</span><span class="p">))</span>
|
||||
<span class="k">if</span> <span class="n">p</span> <span class="o">==</span> <span class="s2">"dnf_conf"</span><span class="p">:</span>
|
||||
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span></div>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">make_owned_dir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_queue_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_queue_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_queue_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Make any missing queue directories</span>
|
||||
@ -253,20 +290,7 @@
|
||||
<span class="n">lib_dir</span> <span class="o">=</span> <span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"lib_dir"</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"queue/run"</span><span class="p">,</span> <span class="s2">"queue/new"</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">]:</span>
|
||||
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">lib_dir</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
|
||||
<span class="n">orig_umask</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mo">0o771</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">chown</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">gid</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="n">orig_umask</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">p_stat</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_mode</span> <span class="o">&</span> <span class="mo">0o006</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Incorrect permissions on </span><span class="si">%s</span><span class="s2">, no o+rw permissions are allowed."</span> <span class="o">%</span> <span class="n">p_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_gid</span> <span class="o">!=</span> <span class="n">gid</span> <span class="ow">or</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_uid</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">gr_name</span> <span class="o">=</span> <span class="n">grp</span><span class="o">.</span><span class="n">getgrgid</span><span class="p">(</span><span class="n">gid</span><span class="p">)</span><span class="o">.</span><span class="n">gr_name</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> should be owned by root:</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">gr_name</span><span class="p">))</span>
|
||||
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">make_owned_dir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">gid</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="n">errors</span></div>
|
||||
</pre></div>
|
||||
|
||||
@ -280,7 +304,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -299,27 +323,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.crossdomain — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.crossdomain — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -231,7 +230,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -250,27 +249,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.dnfbase — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.dnfbase — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -181,7 +180,46 @@
|
||||
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
<span class="kn">from</span> <span class="nn">threading</span> <span class="k">import</span> <span class="n">Lock</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">flatconfig</span>
|
||||
|
||||
<div class="viewcode-block" id="DNFLock"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.dnfbase.DNFLock">[docs]</a><span class="k">class</span> <span class="nc">DNFLock</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""Hold the dnf.Base object and a Lock to control access to it.</span>
|
||||
|
||||
<span class="sd"> self.dbo is a property that returns the dnf.Base object, but it *may* change</span>
|
||||
<span class="sd"> from one call to the next if the upstream repositories have changed.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">conf</span><span class="p">,</span> <span class="n">expire_secs</span><span class="o">=</span><span class="mi">6</span><span class="o">*</span><span class="mi">60</span><span class="o">*</span><span class="mi">60</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_conf</span> <span class="o">=</span> <span class="n">conf</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_lock</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">dbo</span> <span class="o">=</span> <span class="n">get_base_object</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_conf</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span> <span class="o">=</span> <span class="n">expire_secs</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Check for repo updates (using expiration time) and return the lock</span>
|
||||
|
||||
<span class="sd"> If the repository has been updated, tear down the old dnf.Base and</span>
|
||||
<span class="sd"> create a new one. This is the only way to force dnf to use the new</span>
|
||||
<span class="sd"> metadata.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">></span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">lock_check</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">lock_check</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Force a check for repo updates and return the lock</span>
|
||||
|
||||
<span class="sd"> Use this method sparingly, it removes the repodata and downloads a new copy every time.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">dbo</span><span class="o">.</span><span class="n">update_cache</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span></div>
|
||||
|
||||
<div class="viewcode-block" id="get_base_object"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.dnfbase.get_base_object">[docs]</a><span class="k">def</span> <span class="nf">get_base_object</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span>
|
||||
<span class="sd">"""Get the DNF object with settings from the config file</span>
|
||||
@ -211,7 +249,10 @@
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">reposdir</span> <span class="o">=</span> <span class="p">[</span><span class="n">repodir</span><span class="p">]</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">install_weak_deps</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">prepend_installroot</span><span class="p">(</span><span class="s1">'persistdir'</span><span class="p">)</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">tsflags</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'nodocs'</span><span class="p">)</span>
|
||||
<span class="c1"># this is a weird 'AppendOption' thing that, when you set it,</span>
|
||||
<span class="c1"># actually appends. Doing this adds 'nodocs' to the existing list</span>
|
||||
<span class="c1"># of values, over in libdnf, it does not replace the existing values.</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">tsflags</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'nodocs'</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">conf</span><span class="o">.</span><span class="n">get_default</span><span class="p">(</span><span class="s2">"dnf"</span><span class="p">,</span> <span class="s2">"proxy"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"dnf"</span><span class="p">,</span> <span class="s2">"proxy"</span><span class="p">)</span>
|
||||
@ -226,6 +267,20 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"releasever = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">_releasever</span><span class="p">)</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">releasever</span> <span class="o">=</span> <span class="n">_releasever</span>
|
||||
|
||||
<span class="c1"># DNF 3.2 needs to have module_platform_id set, otherwise depsolve won't work correctly</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"/etc/os-release is missing, cannot determine platform id, falling back to </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">DEFAULT_PLATFORM_ID</span><span class="p">)</span>
|
||||
<span class="n">platform_id</span> <span class="o">=</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">os_release</span> <span class="o">=</span> <span class="n">flatconfig</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">)</span>
|
||||
<span class="n">platform_id</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"PLATFORM_ID"</span><span class="p">,</span> <span class="n">DEFAULT_PLATFORM_ID</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Using </span><span class="si">%s</span><span class="s2"> for module_platform_id"</span><span class="p">,</span> <span class="n">platform_id</span><span class="p">)</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">module_platform_id</span> <span class="o">=</span> <span class="n">platform_id</span>
|
||||
|
||||
<span class="c1"># Make sure metadata is always current</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">metadata_expire</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">metadata_expire_filter</span> <span class="o">=</span> <span class="s2">"never"</span>
|
||||
|
||||
<span class="c1"># write the dnf configuration file</span>
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">dnfconf</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">dbc</span><span class="o">.</span><span class="n">dump</span><span class="p">())</span>
|
||||
@ -237,11 +292,44 @@
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">repo_file</span><span class="p">,</span> <span class="n">repodir</span><span class="p">)</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">read_all_repos</span><span class="p">()</span>
|
||||
|
||||
<span class="c1"># Remove any duplicate repo entries. These can cause problems with Anaconda, which will fail</span>
|
||||
<span class="c1"># with space problems.</span>
|
||||
<span class="n">repos</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">id</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">dbo</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">iter_enabled</span><span class="p">()))</span>
|
||||
<span class="n">seen</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"baseurl"</span><span class="p">:</span> <span class="p">[],</span> <span class="s2">"mirrorlist"</span><span class="p">:</span> <span class="p">[],</span> <span class="s2">"metalink"</span><span class="p">:</span> <span class="p">[]}</span>
|
||||
<span class="k">for</span> <span class="n">source_name</span> <span class="ow">in</span> <span class="n">repos</span><span class="p">:</span>
|
||||
<span class="n">remove</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="n">repo</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">source_name</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">repo</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"repo </span><span class="si">%s</span><span class="s2"> vanished while removing duplicates"</span><span class="p">,</span> <span class="n">source_name</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="n">seen</span><span class="p">[</span><span class="s2">"baseurl"</span><span class="p">]:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing duplicate repo: </span><span class="si">%s</span><span class="s2"> baseurl=</span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">source_name</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">remove</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">seen</span><span class="p">[</span><span class="s2">"baseurl"</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="k">elif</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span> <span class="ow">in</span> <span class="n">seen</span><span class="p">[</span><span class="s2">"mirrorlist"</span><span class="p">]:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing duplicate repo: </span><span class="si">%s</span><span class="s2"> mirrorlist=</span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">source_name</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">)</span>
|
||||
<span class="n">remove</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">seen</span><span class="p">[</span><span class="s2">"mirrorlist"</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span> <span class="ow">in</span> <span class="n">seen</span><span class="p">[</span><span class="s2">"metalink"</span><span class="p">]:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing duplicate repo: </span><span class="si">%s</span><span class="s2"> metalink=</span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">source_name</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span><span class="p">)</span>
|
||||
<span class="n">remove</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">seen</span><span class="p">[</span><span class="s2">"metalink"</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">metalink</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">remove</span><span class="p">:</span>
|
||||
<span class="k">del</span> <span class="n">dbo</span><span class="o">.</span><span class="n">repos</span><span class="p">[</span><span class="n">source_name</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># Update the metadata from the enabled repos to speed up later operations</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Updating repository metadata"</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">fill_sack</span><span class="p">(</span><span class="n">load_system_repo</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">read_comps</span><span class="p">()</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">update_cache</span><span class="p">()</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">Error</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Failed to update metadata: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Fetching metadata failed: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -259,7 +347,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -278,27 +366,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
438
docs/html/_modules/pylorax/api/gitrpm.html
Normal file
438
docs/html/_modules/pylorax/api/gitrpm.html
Normal file
@ -0,0 +1,438 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.gitrpm — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
|
||||
|
||||
<script src="../../../_static/js/modernizr.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search">
|
||||
|
||||
|
||||
|
||||
<a href="../../../index.html" class="icon icon-home"> Lorax
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../intro.html">Introduction to Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../intro.html#before-lorax">Before Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../lorax.html">Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../livemedia-creator.html">livemedia-creator</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../lorax-composer.html">lorax-composer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../composer-cli.html">composer-cli</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../product-images.html">Product and Updates Images</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../../modules.html">src</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../../../index.html">Lorax</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../../../index.html">Docs</a> »</li>
|
||||
|
||||
<li><a href="../../index.html">Module code</a> »</li>
|
||||
|
||||
<li><a href="../../pylorax.html">pylorax</a> »</li>
|
||||
|
||||
<li>pylorax.api.gitrpm</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.api.gitrpm</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1"># Copyright (C) 2019 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="sd">""" Clone a git repository and package it as an rpm</span>
|
||||
|
||||
<span class="sd">This module contains functions for cloning a git repo, creating a tar archive of</span>
|
||||
<span class="sd">the selected commit, branch, or tag, and packaging the files into an rpm that will</span>
|
||||
<span class="sd">be installed by anaconda when creating the image.</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"lorax-composer"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">from</span> <span class="nn">rpmfluff</span> <span class="k">import</span> <span class="n">SimpleRpmBuild</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
<span class="kn">import</span> <span class="nn">subprocess</span>
|
||||
<span class="kn">import</span> <span class="nn">tempfile</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<div class="viewcode-block" id="get_repo_description"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.get_repo_description">[docs]</a><span class="k">def</span> <span class="nf">get_repo_description</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">):</span>
|
||||
<span class="sd">""" Return a description including the git repo and reference</span>
|
||||
|
||||
<span class="sd"> :param gitRepo: A dict with the repository details</span>
|
||||
<span class="sd"> :type gitRepo: dict</span>
|
||||
<span class="sd"> :returns: A string with the git repo url and reference</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="s2">"Created from </span><span class="si">%s</span><span class="s2">, reference '</span><span class="si">%s</span><span class="s2">', on </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">],</span> <span class="n">gitRepo</span><span class="p">[</span><span class="s2">"ref"</span><span class="p">],</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">())</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GitArchiveTarball"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitArchiveTarball">[docs]</a><span class="k">class</span> <span class="nc">GitArchiveTarball</span><span class="p">:</span>
|
||||
<span class="sd">"""Create a git archive of the selected git repo and reference"""</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gitRepo</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span> <span class="o">=</span> <span class="n">gitRepo</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">sourceName</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"rpmname"</span><span class="p">]</span><span class="o">+</span><span class="s2">".tar.xz"</span>
|
||||
|
||||
<div class="viewcode-block" id="GitArchiveTarball.write_file"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitArchiveTarball.write_file">[docs]</a> <span class="k">def</span> <span class="nf">write_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sourcesDir</span><span class="p">):</span>
|
||||
<span class="sd">""" Create the tar archive</span>
|
||||
|
||||
<span class="sd"> :param sourcesDir: Path to use for creating the archive</span>
|
||||
<span class="sd"> :type sourcesDir: str</span>
|
||||
|
||||
<span class="sd"> This clones the git repository and creates a git archive from the specified reference.</span>
|
||||
<span class="sd"> The result is in RPMNAME.tar.xz under the sourcesDir</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Clone the repository into a temporary location</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"git"</span><span class="p">,</span> <span class="s2">"clone"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">],</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">sourcesDir</span><span class="p">,</span> <span class="s2">"gitrepo"</span><span class="p">)]</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">subprocess</span><span class="o">.</span><span class="n">check_output</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Failed to clone </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">],</span> <span class="n">e</span><span class="o">.</span><span class="n">output</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Failed to clone </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">])</span>
|
||||
|
||||
<span class="n">oldcwd</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">()</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">chdir</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sourcesDir</span><span class="p">,</span> <span class="s2">"gitrepo"</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Configure archive to create a .tar.xz</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"git"</span><span class="p">,</span> <span class="s2">"config"</span><span class="p">,</span> <span class="s2">"tar.tar.xz.command"</span><span class="p">,</span> <span class="s2">"xz -c"</span><span class="p">]</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="n">subprocess</span><span class="o">.</span><span class="n">check_call</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"git"</span><span class="p">,</span> <span class="s2">"archive"</span><span class="p">,</span> <span class="s2">"--prefix"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"rpmname"</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"/"</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">sourcesDir</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">sourceName</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"ref"</span><span class="p">]]</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">subprocess</span><span class="o">.</span><span class="n">check_output</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Failed to archive </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">],</span> <span class="n">e</span><span class="o">.</span><span class="n">output</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Failed to clone </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">])</span>
|
||||
<span class="k">finally</span><span class="p">:</span>
|
||||
<span class="c1"># Cleanup even if there was an error</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">chdir</span><span class="p">(</span><span class="n">oldcwd</span><span class="p">)</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sourcesDir</span><span class="p">,</span> <span class="s2">"gitrepo"</span><span class="p">))</span></div></div>
|
||||
|
||||
<div class="viewcode-block" id="GitRpmBuild"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild">[docs]</a><span class="k">class</span> <span class="nc">GitRpmBuild</span><span class="p">(</span><span class="n">SimpleRpmBuild</span><span class="p">):</span>
|
||||
<span class="sd">"""Build an rpm containing files from a git repository"""</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_base_dir</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="GitRpmBuild.check"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.check">[docs]</a> <span class="k">def</span> <span class="nf">check</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">raise</span> <span class="ne">NotImplementedError</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GitRpmBuild.get_base_dir"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.get_base_dir">[docs]</a> <span class="k">def</span> <span class="nf">get_base_dir</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Place all the files under a temporary directory + rpmbuild/</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_base_dir</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_base_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">"lorax-git-rpm."</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">joinpaths</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_base_dir</span><span class="p">,</span> <span class="s2">"rpmbuild"</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GitRpmBuild.cleanup_tmpdir"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.cleanup_tmpdir">[docs]</a> <span class="k">def</span> <span class="nf">cleanup_tmpdir</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Remove the temporary directory and all of its contents</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_base_dir</span><span class="p">)</span> <span class="o"><</span> <span class="mi">5</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Invalid base_dir: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_base_dir</span><span class="p">())</span>
|
||||
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_base_dir</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GitRpmBuild.clean"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.clean">[docs]</a> <span class="k">def</span> <span class="nf">clean</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Remove the base directory from inside the tmpdir"""</span>
|
||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_base_dir</span><span class="p">())</span> <span class="o"><</span> <span class="mi">5</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Invalid base_dir: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_base_dir</span><span class="p">())</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_base_dir</span><span class="p">(),</span> <span class="n">ignore_errors</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="GitRpmBuild.add_git_tarball"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.add_git_tarball">[docs]</a> <span class="k">def</span> <span class="nf">add_git_tarball</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gitRepo</span><span class="p">):</span>
|
||||
<span class="sd">"""Add a tar archive of a git repository to the rpm</span>
|
||||
|
||||
<span class="sd"> :param gitRepo: A dict with the repository details</span>
|
||||
<span class="sd"> :type gitRepo: dict</span>
|
||||
|
||||
<span class="sd"> This populates the rpm with the URL of the git repository, the summary</span>
|
||||
<span class="sd"> describing the repo, the description of the repository and reference used,</span>
|
||||
<span class="sd"> and sets up the rpm to install the archive contents into the destination</span>
|
||||
<span class="sd"> path.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">addUrl</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">])</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_summary</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">[</span><span class="s2">"summary"</span><span class="p">])</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_description</span><span class="p">(</span><span class="n">get_repo_description</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">))</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">addLicense</span><span class="p">(</span><span class="s2">"Unknown"</span><span class="p">)</span>
|
||||
<span class="n">sourceIndex</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_source</span><span class="p">(</span><span class="n">GitArchiveTarball</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">))</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">section_build</span> <span class="o">+=</span> <span class="s2">"tar -xvf </span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">sources</span><span class="p">[</span><span class="n">sourceIndex</span><span class="p">]</span><span class="o">.</span><span class="n">sourceName</span>
|
||||
<span class="n">dest</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">normpath</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">[</span><span class="s2">"destination"</span><span class="p">])</span>
|
||||
<span class="c1"># Prevent double slash root</span>
|
||||
<span class="k">if</span> <span class="n">dest</span> <span class="o">==</span> <span class="s2">"/"</span><span class="p">:</span>
|
||||
<span class="n">dest</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">create_parent_dirs</span><span class="p">(</span><span class="n">dest</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">section_install</span> <span class="o">+=</span> <span class="s2">"cp -r </span><span class="si">%s</span><span class="s2">/. $RPM_BUILD_ROOT/</span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">gitRepo</span><span class="p">[</span><span class="s2">"rpmname"</span><span class="p">],</span> <span class="n">dest</span><span class="p">)</span>
|
||||
<span class="n">sub</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_subpackage</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">dest</span><span class="p">:</span>
|
||||
<span class="c1"># / is special, we don't want to include / itself, just what's under it</span>
|
||||
<span class="n">sub</span><span class="o">.</span><span class="n">section_files</span> <span class="o">+=</span> <span class="s2">"/*</span><span class="se">\n</span><span class="s2">"</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">sub</span><span class="o">.</span><span class="n">section_files</span> <span class="o">+=</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">/</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">dest</span></div></div>
|
||||
|
||||
<div class="viewcode-block" id="make_git_rpm"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.make_git_rpm">[docs]</a><span class="k">def</span> <span class="nf">make_git_rpm</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">,</span> <span class="n">dest</span><span class="p">):</span>
|
||||
<span class="sd">""" Create an rpm from the specified git repo</span>
|
||||
|
||||
<span class="sd"> :param gitRepo: A dict with the repository details</span>
|
||||
<span class="sd"> :type gitRepo: dict</span>
|
||||
|
||||
<span class="sd"> This will clone the git repository, create an archive of the selected reference,</span>
|
||||
<span class="sd"> and build an rpm that will install the files from the repository under the destination</span>
|
||||
<span class="sd"> directory. The gitRepo dict should have the following fields::</span>
|
||||
|
||||
<span class="sd"> rpmname: "server-config"</span>
|
||||
<span class="sd"> rpmversion: "1.0"</span>
|
||||
<span class="sd"> rpmrelease: "1"</span>
|
||||
<span class="sd"> summary: "Setup files for server deployment"</span>
|
||||
<span class="sd"> repo: "PATH OF GIT REPO TO CLONE"</span>
|
||||
<span class="sd"> ref: "v1.0"</span>
|
||||
<span class="sd"> destination: "/opt/server/"</span>
|
||||
|
||||
<span class="sd"> * rpmname: Name of the rpm to create, also used as the prefix name in the tar archive</span>
|
||||
<span class="sd"> * rpmversion: Version of the rpm, eg. "1.0.0"</span>
|
||||
<span class="sd"> * rpmrelease: Release of the rpm, eg. "1"</span>
|
||||
<span class="sd"> * summary: Summary string for the rpm</span>
|
||||
<span class="sd"> * repo: URL of the get repo to clone and create the archive from</span>
|
||||
<span class="sd"> * ref: Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</span>
|
||||
<span class="sd"> * destination: Path to install the / of the git repo at when installing the rpm</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">gitRpm</span> <span class="o">=</span> <span class="n">GitRpmBuild</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">[</span><span class="s2">"rpmname"</span><span class="p">],</span> <span class="n">gitRepo</span><span class="p">[</span><span class="s2">"rpmversion"</span><span class="p">],</span> <span class="n">gitRepo</span><span class="p">[</span><span class="s2">"rpmrelease"</span><span class="p">],</span> <span class="p">[</span><span class="s2">"noarch"</span><span class="p">])</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">gitRpm</span><span class="o">.</span><span class="n">add_git_tarball</span><span class="p">(</span><span class="n">gitRepo</span><span class="p">)</span>
|
||||
<span class="n">gitRpm</span><span class="o">.</span><span class="n">do_make</span><span class="p">()</span>
|
||||
<span class="n">rpmfile</span> <span class="o">=</span> <span class="n">gitRpm</span><span class="o">.</span><span class="n">get_built_rpm</span><span class="p">(</span><span class="s2">"noarch"</span><span class="p">)</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">rpmfile</span><span class="p">,</span> <span class="n">dest</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Creating git repo rpm: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Creating git repo rpm: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">finally</span><span class="p">:</span>
|
||||
<span class="n">gitRpm</span><span class="o">.</span><span class="n">cleanup_tmpdir</span><span class="p">()</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">rpmfile</span><span class="p">)</span></div>
|
||||
|
||||
<span class="c1"># Create the git rpms, if any, and return the path to the repo under results_dir</span>
|
||||
<div class="viewcode-block" id="create_gitrpm_repo"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.gitrpm.create_gitrpm_repo">[docs]</a><span class="k">def</span> <span class="nf">create_gitrpm_repo</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">recipe</span><span class="p">):</span>
|
||||
<span class="sd">"""Create a dnf repository with the rpms from the recipe</span>
|
||||
|
||||
<span class="sd"> :param results_dir: Path to create the repository under</span>
|
||||
<span class="sd"> :type results_dir: str</span>
|
||||
<span class="sd"> :param recipe: The recipe to get the repos.git entries from</span>
|
||||
<span class="sd"> :type recipe: Recipe</span>
|
||||
<span class="sd"> :returns: Path to the dnf repository or ""</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
|
||||
<span class="sd"> This function creates a dnf repository directory at results_dir+"repo/",</span>
|
||||
<span class="sd"> creates rpms for all of the repos.git entries in the recipe, runs createrepo_c</span>
|
||||
<span class="sd"> on the dnf repository so that Anaconda can use it, and returns the path to the</span>
|
||||
<span class="sd"> repository to the caller.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"repos"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> <span class="s2">"git"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"repos"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="s2">""</span>
|
||||
|
||||
<span class="n">gitrepo</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"repo/"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">gitrepo</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">gitrepo</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"repos"</span><span class="p">][</span><span class="s2">"git"</span><span class="p">]:</span>
|
||||
<span class="n">make_git_rpm</span><span class="p">(</span><span class="n">r</span><span class="p">,</span> <span class="n">gitrepo</span><span class="p">)</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"createrepo_c"</span><span class="p">,</span> <span class="n">gitrepo</span><span class="p">]</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">subprocess</span><span class="o">.</span><span class="n">check_output</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Failed to create repo at </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">gitrepo</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">output</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Failed to create repo at </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">gitrepo</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">gitrepo</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.projects — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.projects — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -174,12 +173,14 @@
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"lorax-composer"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">from</span> <span class="nn">configparser</span> <span class="k">import</span> <span class="n">ConfigParser</span>
|
||||
<span class="kn">import</span> <span class="nn">dnf</span>
|
||||
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.bisect</span> <span class="k">import</span> <span class="n">insort_left</span>
|
||||
|
||||
<span class="n">TIME_FORMAT</span> <span class="o">=</span> <span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">T%H:%M:%S"</span>
|
||||
|
||||
|
||||
@ -232,6 +233,32 @@
|
||||
<span class="s2">"upstream_vcs"</span><span class="p">:</span> <span class="s2">"UPSTREAM_VCS"</span><span class="p">}</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="pkg_to_build"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.pkg_to_build">[docs]</a><span class="k">def</span> <span class="nf">pkg_to_build</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
|
||||
<span class="sd">"""Extract the build details from a hawkey.Package object</span>
|
||||
|
||||
<span class="sd"> :param pkg: hawkey.Package object with package details</span>
|
||||
<span class="sd"> :type pkg: hawkey.Package</span>
|
||||
<span class="sd"> :returns: A dict with the build details, epoch, release, arch, build_time, changelog, ...</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
|
||||
<span class="sd"> metadata entries are hard-coded to {}</span>
|
||||
|
||||
<span class="sd"> Note that this only returns the build dict, it does not include the name, description, etc.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="p">{</span><span class="s2">"epoch"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">epoch</span><span class="p">,</span>
|
||||
<span class="s2">"release"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">release</span><span class="p">,</span>
|
||||
<span class="s2">"arch"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
|
||||
<span class="s2">"build_time"</span><span class="p">:</span> <span class="n">api_time</span><span class="p">(</span><span class="n">pkg</span><span class="o">.</span><span class="n">buildtime</span><span class="p">),</span>
|
||||
<span class="s2">"changelog"</span><span class="p">:</span> <span class="s2">"CHANGELOG_NEEDED"</span><span class="p">,</span> <span class="c1"># XXX Not in hawkey.Package</span>
|
||||
<span class="s2">"build_config_ref"</span><span class="p">:</span> <span class="s2">"BUILD_CONFIG_REF"</span><span class="p">,</span>
|
||||
<span class="s2">"build_env_ref"</span><span class="p">:</span> <span class="s2">"BUILD_ENV_REF"</span><span class="p">,</span>
|
||||
<span class="s2">"metadata"</span><span class="p">:</span> <span class="p">{},</span>
|
||||
<span class="s2">"source"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"license"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">license</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">version</span><span class="p">,</span>
|
||||
<span class="s2">"source_ref"</span><span class="p">:</span> <span class="s2">"SOURCE_REF"</span><span class="p">,</span>
|
||||
<span class="s2">"metadata"</span><span class="p">:</span> <span class="p">{}}}</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="pkg_to_project_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.pkg_to_project_info">[docs]</a><span class="k">def</span> <span class="nf">pkg_to_project_info</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
|
||||
<span class="sd">"""Extract the details from a hawkey.Package object</span>
|
||||
|
||||
@ -242,25 +269,12 @@
|
||||
|
||||
<span class="sd"> metadata entries are hard-coded to {}</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">build</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"epoch"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">epoch</span><span class="p">,</span>
|
||||
<span class="s2">"release"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">release</span><span class="p">,</span>
|
||||
<span class="s2">"arch"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
|
||||
<span class="s2">"build_time"</span><span class="p">:</span> <span class="n">api_time</span><span class="p">(</span><span class="n">pkg</span><span class="o">.</span><span class="n">buildtime</span><span class="p">),</span>
|
||||
<span class="s2">"changelog"</span><span class="p">:</span> <span class="s2">"CHANGELOG_NEEDED"</span><span class="p">,</span> <span class="c1"># XXX Not in hawkey.Package</span>
|
||||
<span class="s2">"build_config_ref"</span><span class="p">:</span> <span class="s2">"BUILD_CONFIG_REF"</span><span class="p">,</span>
|
||||
<span class="s2">"build_env_ref"</span><span class="p">:</span> <span class="s2">"BUILD_ENV_REF"</span><span class="p">,</span>
|
||||
<span class="s2">"metadata"</span><span class="p">:</span> <span class="p">{},</span>
|
||||
<span class="s2">"source"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"license"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">license</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">version</span><span class="p">,</span>
|
||||
<span class="s2">"source_ref"</span><span class="p">:</span> <span class="s2">"SOURCE_REF"</span><span class="p">,</span>
|
||||
<span class="s2">"metadata"</span><span class="p">:</span> <span class="p">{}}}</span>
|
||||
|
||||
<span class="k">return</span> <span class="p">{</span><span class="s2">"name"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
|
||||
<span class="s2">"summary"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">summary</span><span class="p">,</span>
|
||||
<span class="s2">"description"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">description</span><span class="p">,</span>
|
||||
<span class="s2">"homepage"</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">url</span><span class="p">,</span>
|
||||
<span class="s2">"upstream_vcs"</span><span class="p">:</span> <span class="s2">"UPSTREAM_VCS"</span><span class="p">,</span>
|
||||
<span class="s2">"builds"</span><span class="p">:</span> <span class="p">[</span><span class="n">build</span><span class="p">]}</span></div>
|
||||
<span class="s2">"builds"</span><span class="p">:</span> <span class="p">[</span><span class="n">pkg_to_build</span><span class="p">(</span><span class="n">pkg</span><span class="p">)]}</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="pkg_to_dep"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.pkg_to_dep">[docs]</a><span class="k">def</span> <span class="nf">pkg_to_dep</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
|
||||
@ -337,7 +351,24 @@
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="o">.</span><span class="n">query</span><span class="p">()</span><span class="o">.</span><span class="n">available</span><span class="p">()</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">name__glob</span><span class="o">=</span><span class="n">project_names</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="o">.</span><span class="n">query</span><span class="p">()</span><span class="o">.</span><span class="n">available</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">pkg_to_project_info</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span></div>
|
||||
|
||||
<span class="c1"># iterate over pkgs</span>
|
||||
<span class="c1"># - if pkg.name isn't in the results yet, add pkg_to_project_info in sorted position</span>
|
||||
<span class="c1"># - if pkg.name is already in results, get its builds. If the build for pkg is different</span>
|
||||
<span class="c1"># in any way (version, arch, etc.) add it to the entry's builds list. If it is the same,</span>
|
||||
<span class="c1"># skip it.</span>
|
||||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">results_names</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">results_names</span><span class="p">:</span>
|
||||
<span class="n">idx</span> <span class="o">=</span> <span class="n">insort_left</span><span class="p">(</span><span class="n">results</span><span class="p">,</span> <span class="n">pkg_to_project_info</span><span class="p">(</span><span class="n">p</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="n">results_names</span><span class="p">[</span><span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()]</span> <span class="o">=</span> <span class="n">idx</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">build</span> <span class="o">=</span> <span class="n">pkg_to_build</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">build</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">results</span><span class="p">[</span><span class="n">results_names</span><span class="p">[</span><span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()]][</span><span class="s2">"builds"</span><span class="p">]:</span>
|
||||
<span class="n">results</span><span class="p">[</span><span class="n">results_names</span><span class="p">[</span><span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()]][</span><span class="s2">"builds"</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">build</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">results</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span>
|
||||
<span class="sd">"""Add projects to a new transaction</span>
|
||||
@ -352,7 +383,9 @@
|
||||
<span class="sd"> :rtype: None</span>
|
||||
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># This resets the transaction</span>
|
||||
<span class="c1"># This resets the transaction and updates the cache.</span>
|
||||
<span class="c1"># It is important that the cache always be synchronized because Anaconda will grab its own copy</span>
|
||||
<span class="c1"># and if that is different the NEVRAs will not match and the build will fail.</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">reset</span><span class="p">(</span><span class="n">goal</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
|
||||
@ -362,23 +395,25 @@
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"Group </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="s2">"*"</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="p">[</span><span class="n">pkg</span> <span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">dnf</span><span class="o">.</span><span class="n">subject</span><span class="o">.</span><span class="n">Subject</span><span class="p">(</span><span class="n">name</span><span class="p">)</span><span class="o">.</span><span class="n">get_best_query</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">version__glob</span><span class="o">=</span><span class="n">version</span><span class="p">,</span> <span class="n">latest</span><span class="o">=</span><span class="kc">True</span><span class="p">)]</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span> <span class="s2">"No match"</span><span class="p">))</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="c1"># Find the best package matching the name + version glob</span>
|
||||
<span class="c1"># dnf can return multiple packages if it is in more than 1 repository</span>
|
||||
<span class="n">query</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="o">.</span><span class="n">query</span><span class="p">()</span><span class="o">.</span><span class="n">filterm</span><span class="p">(</span><span class="n">provides__glob</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">query</span><span class="o">.</span><span class="n">filterm</span><span class="p">(</span><span class="n">version__glob</span><span class="o">=</span><span class="n">version</span><span class="p">)</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">package_install</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">MarkingError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">query</span><span class="o">.</span><span class="n">filterm</span><span class="p">(</span><span class="n">latest</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">query</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span> <span class="s2">"No match"</span><span class="p">))</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">sltr</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">selector</span><span class="o">.</span><span class="n">Selector</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="p">)</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">pkg</span><span class="o">=</span><span class="n">query</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># NOTE: dnf says in near future there will be a "goal" attribute of Base class</span>
|
||||
<span class="c1"># so yes, we're using a 'private' attribute here on purpose and with permission.</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">_goal</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">select</span><span class="o">=</span><span class="n">sltr</span><span class="p">,</span> <span class="n">optional</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s2">"The following package(s) had problems: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> (</span><span class="si">%s</span><span class="s2">)"</span> <span class="o">%</span> <span class="p">(</span><span class="n">pattern</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span> <span class="k">for</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">install_errors</span><span class="p">]))</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="projects_depsolve"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the dependencies for a list of projects</span>
|
||||
|
||||
@ -474,9 +509,7 @@
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># TODO - Figure out what to do with this for Fedora 'modules'</span>
|
||||
<span class="n">projs</span> <span class="o">=</span> <span class="n">projects_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">proj_to_module</span><span class="p">,</span> <span class="n">projs</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span></div>
|
||||
|
||||
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">proj_to_module</span><span class="p">,</span> <span class="n">projects_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">)))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="modules_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.modules_info">[docs]</a><span class="k">def</span> <span class="nf">modules_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return details about a module, including dependencies</span>
|
||||
@ -508,7 +541,7 @@
|
||||
<span class="sd"> it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this manually with</span>
|
||||
<span class="sd"> only the attributes we care about.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">repo_str</span> <span class="o">=</span> <span class="s2">"[</span><span class="si">%s</span><span class="s2">]</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">repo</span><span class="o">.</span><span class="n">id</span>
|
||||
<span class="n">repo_str</span> <span class="o">=</span> <span class="s2">"[</span><span class="si">%s</span><span class="s2">]</span><span class="se">\n</span><span class="s2">name = </span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span><span class="p">:</span>
|
||||
<span class="n">repo_str</span> <span class="o">+=</span> <span class="s2">"metalink = </span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span>
|
||||
<span class="k">elif</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">:</span>
|
||||
@ -583,7 +616,7 @@
|
||||
<span class="n">source</span><span class="p">[</span><span class="s2">"check_gpg"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span><span class="p">:</span>
|
||||
<span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">]</span> <span class="o">=</span> <span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span>
|
||||
<span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">source</span></div>
|
||||
|
||||
@ -637,7 +670,7 @@
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">gpgcheck</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"gpgkey_urls"</span> <span class="ow">in</span> <span class="n">source</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span> <span class="o">=</span> <span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">])</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">])</span>
|
||||
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
|
||||
@ -716,7 +749,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -735,27 +768,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.queue — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.queue — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -193,6 +192,47 @@
|
||||
<span class="kn">from</span> <span class="nn">pylorax.creator</span> <span class="k">import</span> <span class="n">run_creator</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<div class="viewcode-block" id="check_queues"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.check_queues">[docs]</a><span class="k">def</span> <span class="nf">check_queues</span><span class="p">(</span><span class="n">cfg</span><span class="p">):</span>
|
||||
<span class="sd">"""Check to make sure the new and run queue symlinks are correct</span>
|
||||
|
||||
<span class="sd"> :param cfg: Configuration settings</span>
|
||||
<span class="sd"> :type cfg: DataHolder</span>
|
||||
|
||||
<span class="sd"> Also check all of the existing results and make sure any with WAITING</span>
|
||||
<span class="sd"> set in STATUS have a symlink in queue/new/</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Remove broken symlinks from the new and run queues</span>
|
||||
<span class="n">queue_symlinks</span> <span class="o">=</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/new/*"</span><span class="p">))</span> <span class="o">+</span> \
|
||||
<span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/run/*"</span><span class="p">))</span>
|
||||
<span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">queue_symlinks</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">link</span><span class="p">)):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing broken symlink </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">link</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">link</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Write FAILED to the STATUS of any run queue symlinks and remove them</span>
|
||||
<span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/run/*"</span><span class="p">)):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Setting build </span><span class="si">%s</span><span class="s2"> to FAILED, and removing symlink from queue/run/"</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">link</span><span class="p">))</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"FAILED</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">link</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Check results STATUS messages</span>
|
||||
<span class="c1"># - If STATUS is missing, set it to FAILED</span>
|
||||
<span class="c1"># - RUNNING should be changed to FAILED</span>
|
||||
<span class="c1"># - WAITING should have a symlink in the new queue</span>
|
||||
<span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"results/*"</span><span class="p">)):</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">)):</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"FAILED</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">))</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="o">==</span> <span class="s2">"RUNNING"</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Setting build </span><span class="si">%s</span><span class="s2"> to FAILED"</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">link</span><span class="p">))</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"FAILED</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">status</span> <span class="o">==</span> <span class="s2">"WAITING"</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">islink</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/new/"</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">link</span><span class="p">))):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Creating missing symlink to new build </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">link</span><span class="p">))</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">symlink</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/new/"</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">link</span><span class="p">)))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="start_queue_monitor"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.start_queue_monitor">[docs]</a><span class="k">def</span> <span class="nf">start_queue_monitor</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Start the queue monitor as a mp process</span>
|
||||
|
||||
@ -226,7 +266,7 @@
|
||||
<span class="sd"> compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file</span>
|
||||
<span class="sd"> will be created in the results directory.</span>
|
||||
|
||||
<span class="sd"> STATUS can contain one of: RUNNING, FINISHED, FAILED</span>
|
||||
<span class="sd"> STATUS can contain one of: WAITING, RUNNING, FINISHED, FAILED</span>
|
||||
|
||||
<span class="sd"> If the system is restarted while a compose is running it will move any old symlinks</span>
|
||||
<span class="sd"> from ./queue/run/ to ./queue/new/ and rerun them.</span>
|
||||
@ -235,13 +275,7 @@
|
||||
<span class="sd">"""Sort the queue entries by their mtime, not their names"""</span>
|
||||
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/new"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">))</span><span class="o">.</span><span class="n">st_mtime</span>
|
||||
|
||||
<span class="c1"># Move any symlinks in the run queue back to the new queue</span>
|
||||
<span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/run"</span><span class="p">)):</span>
|
||||
<span class="n">src</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/run"</span><span class="p">,</span> <span class="n">link</span><span class="p">)</span>
|
||||
<span class="n">dst</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/new"</span><span class="p">,</span> <span class="n">link</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Moved unfinished compose </span><span class="si">%s</span><span class="s2"> back to new state"</span><span class="p">,</span> <span class="n">src</span><span class="p">)</span>
|
||||
|
||||
<span class="n">check_queues</span><span class="p">(</span><span class="n">cfg</span><span class="p">)</span>
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="n">uuids</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">"queue/new"</span><span class="p">)),</span> <span class="n">key</span><span class="o">=</span><span class="n">queue_sort</span><span class="p">)</span>
|
||||
|
||||
@ -367,7 +401,7 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">install_cfg</span><span class="o">.</span><span class="n">image_name</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"TEST IMAGE"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">run_creator</span><span class="p">(</span><span class="n">install_cfg</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="n">cancel_build</span><span class="p">)</span>
|
||||
<span class="n">run_creator</span><span class="p">(</span><span class="n">install_cfg</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="n">cancel_build</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Extract the results of the compose into results_dir and cleanup the compose directory</span>
|
||||
<span class="n">move_compose_results</span><span class="p">(</span><span class="n">install_cfg</span><span class="p">,</span> <span class="n">results_dir</span><span class="p">)</span>
|
||||
@ -550,11 +584,16 @@
|
||||
|
||||
<span class="sd"> Only call this if the build status is WAITING or RUNNING</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">cancel_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"lib_dir"</span><span class="p">),</span> <span class="s2">"results"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="s2">"CANCEL"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">cancel_path</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Cancel has already been requested for </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">False</span>
|
||||
|
||||
<span class="c1"># This status can change (and probably will) while it is in the middle of doing this:</span>
|
||||
<span class="c1"># It can move from WAITING -> RUNNING or it can move from RUNNING -> FINISHED|FAILED</span>
|
||||
|
||||
<span class="c1"># If it is in WAITING remove the symlink and then check to make sure it didn't show up</span>
|
||||
<span class="c1"># in RUNNING</span>
|
||||
<span class="c1"># in the run queue</span>
|
||||
<span class="n">queue_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"lib_dir"</span><span class="p">),</span> <span class="s2">"queue"</span><span class="p">)</span>
|
||||
<span class="n">uuid_new</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">queue_dir</span><span class="p">,</span> <span class="s2">"new"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_new</span><span class="p">):</span>
|
||||
@ -565,19 +604,24 @@
|
||||
<span class="k">pass</span>
|
||||
<span class="n">uuid_run</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">queue_dir</span><span class="p">,</span> <span class="s2">"run"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_run</span><span class="p">):</span>
|
||||
<span class="c1"># Successfully removed it before the build started</span>
|
||||
<span class="k">return</span> <span class="n">uuid_delete</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="c1"># Make sure the build is still in the waiting state</span>
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"WAITING"</span><span class="p">:</span>
|
||||
<span class="c1"># Successfully removed it before the build started</span>
|
||||
<span class="k">return</span> <span class="n">uuid_delete</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Tell the build to stop running</span>
|
||||
<span class="n">cancel_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"lib_dir"</span><span class="p">),</span> <span class="s2">"results"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="s2">"CANCEL"</span><span class="p">)</span>
|
||||
<span class="c1"># At this point the build has probably started. Write to the CANCEL file.</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">cancel_path</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Wait for status to move to FAILED</span>
|
||||
<span class="c1"># Wait for status to move to FAILED or FINISHED</span>
|
||||
<span class="n">started</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"FAILED"</span><span class="p">:</span>
|
||||
<span class="k">break</span>
|
||||
<span class="k">elif</span> <span class="n">status</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"FINISHED"</span><span class="p">:</span>
|
||||
<span class="c1"># The build finished successfully, no point in deleting it now</span>
|
||||
<span class="k">return</span> <span class="kc">False</span>
|
||||
|
||||
<span class="c1"># Is this taking too long? Exit anyway and try to cleanup.</span>
|
||||
<span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">></span> <span class="n">started</span> <span class="o">+</span> <span class="p">(</span><span class="mi">10</span> <span class="o">*</span> <span class="mi">60</span><span class="p">):</span>
|
||||
@ -797,7 +841,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -816,27 +860,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.recipes — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.recipes — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -156,7 +155,7 @@
|
||||
|
||||
<h1>Source code for pylorax.api.recipes</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2017 Red Hat, Inc.</span>
|
||||
<span class="c1"># Copyright (C) 2017-2019 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
@ -204,7 +203,7 @@
|
||||
<span class="sd"> and adds a .filename property to return the recipe's filename,</span>
|
||||
<span class="sd"> and a .toml() function to return the recipe as a TOML string.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">customizations</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">customizations</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">gitrepos</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="c1"># Check that version is empty or semver compatible</span>
|
||||
<span class="k">if</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">semver</span><span class="o">.</span><span class="n">Version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
|
||||
@ -216,18 +215,29 @@
|
||||
<span class="n">packages</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">packages</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="k">if</span> <span class="n">groups</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">groups</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">groups</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">g</span><span class="p">:</span> <span class="n">g</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
|
||||
<span class="c1"># Only support [[repos.git]] for now</span>
|
||||
<span class="k">if</span> <span class="n">gitrepos</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">repos</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"git"</span><span class="p">:</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">gitrepos</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">g</span><span class="p">:</span> <span class="n">g</span><span class="p">[</span><span class="s2">"repo"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())}</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">repos</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="nb">dict</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
|
||||
<span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
|
||||
<span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">,</span>
|
||||
<span class="n">modules</span><span class="o">=</span><span class="n">modules</span><span class="p">,</span>
|
||||
<span class="n">packages</span><span class="o">=</span><span class="n">packages</span><span class="p">,</span>
|
||||
<span class="n">groups</span><span class="o">=</span><span class="n">groups</span><span class="p">,</span>
|
||||
<span class="n">customizations</span><span class="o">=</span><span class="n">customizations</span><span class="p">)</span>
|
||||
<span class="n">customizations</span><span class="o">=</span><span class="n">customizations</span><span class="p">,</span>
|
||||
<span class="n">repos</span><span class="o">=</span><span class="n">repos</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># We don't want customizations=None to show up in the TOML so remove it</span>
|
||||
<span class="k">if</span> <span class="n">customizations</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">del</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># Don't include empty repos or repos.git</span>
|
||||
<span class="k">if</span> <span class="n">repos</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">repos</span><span class="p">[</span><span class="s2">"git"</span><span class="p">]:</span>
|
||||
<span class="k">del</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"repos"</span><span class="p">]</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">package_names</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the names of the packages"""</span>
|
||||
@ -325,9 +335,13 @@
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="k">if</span> <span class="s2">"repos"</span> <span class="ow">in</span> <span class="bp">self</span> <span class="ow">and</span> <span class="s2">"git"</span> <span class="ow">in</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"repos"</span><span class="p">]:</span>
|
||||
<span class="n">gitrepos</span> <span class="o">=</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"repos"</span><span class="p">][</span><span class="s2">"git"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">gitrepos</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">Recipe</span><span class="p">(</span><span class="bp">self</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"description"</span><span class="p">],</span> <span class="bp">self</span><span class="p">[</span><span class="s2">"version"</span><span class="p">],</span>
|
||||
<span class="n">new_modules</span><span class="p">,</span> <span class="n">new_packages</span><span class="p">,</span> <span class="n">new_groups</span><span class="p">,</span> <span class="n">customizations</span><span class="p">)</span></div></div>
|
||||
<span class="n">new_modules</span><span class="p">,</span> <span class="n">new_packages</span><span class="p">,</span> <span class="n">new_groups</span><span class="p">,</span> <span class="n">customizations</span><span class="p">,</span> <span class="n">gitrepos</span><span class="p">)</span></div></div>
|
||||
|
||||
<div class="viewcode-block" id="RecipeModule"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.RecipeModule">[docs]</a><span class="k">class</span> <span class="nc">RecipeModule</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">):</span>
|
||||
@ -340,6 +354,54 @@
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
|
||||
<span class="nb">dict</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="NewRecipeGit"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.NewRecipeGit">[docs]</a><span class="k">def</span> <span class="nf">NewRecipeGit</span><span class="p">(</span><span class="n">toml_dict</span><span class="p">):</span>
|
||||
<span class="sd">"""Create a RecipeGit object from fields in a TOML dict</span>
|
||||
|
||||
<span class="sd"> :param rpmname: Name of the rpm to create, also used as the prefix name in the tar archive</span>
|
||||
<span class="sd"> :type rpmname: str</span>
|
||||
<span class="sd"> :param rpmversion: Version of the rpm, eg. "1.0.0"</span>
|
||||
<span class="sd"> :type rpmversion: str</span>
|
||||
<span class="sd"> :param rpmrelease: Release of the rpm, eg. "1"</span>
|
||||
<span class="sd"> :type rpmrelease: str</span>
|
||||
<span class="sd"> :param summary: Summary string for the rpm</span>
|
||||
<span class="sd"> :type summary: str</span>
|
||||
<span class="sd"> :param repo: URL of the get repo to clone and create the archive from</span>
|
||||
<span class="sd"> :type repo: str</span>
|
||||
<span class="sd"> :param ref: Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</span>
|
||||
<span class="sd"> :type ref: str</span>
|
||||
<span class="sd"> :param destination: Path to install the / of the git repo at when installing the rpm</span>
|
||||
<span class="sd"> :type destination: str</span>
|
||||
<span class="sd"> :returns: A populated RecipeGit object</span>
|
||||
<span class="sd"> :rtype: RecipeGit</span>
|
||||
|
||||
<span class="sd"> The TOML should look like this::</span>
|
||||
|
||||
<span class="sd"> [[repos.git]]</span>
|
||||
<span class="sd"> rpmname="server-config"</span>
|
||||
<span class="sd"> rpmversion="1.0"</span>
|
||||
<span class="sd"> rpmrelease="1"</span>
|
||||
<span class="sd"> summary="Setup files for server deployment"</span>
|
||||
<span class="sd"> repo="PATH OF GIT REPO TO CLONE"</span>
|
||||
<span class="sd"> ref="v1.0"</span>
|
||||
<span class="sd"> destination="/opt/server/"</span>
|
||||
|
||||
<span class="sd"> Note that the repo path supports anything that git supports, file://, https://, http://</span>
|
||||
|
||||
<span class="sd"> Currently there is no support for authentication</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="n">RecipeGit</span><span class="p">(</span><span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rpmname"</span><span class="p">),</span>
|
||||
<span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rpmversion"</span><span class="p">),</span>
|
||||
<span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rpmrelease"</span><span class="p">),</span>
|
||||
<span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"summary"</span><span class="p">,</span> <span class="s2">""</span><span class="p">),</span>
|
||||
<span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"repo"</span><span class="p">),</span>
|
||||
<span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ref"</span><span class="p">),</span>
|
||||
<span class="n">toml_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"destination"</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="RecipeGit"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.RecipeGit">[docs]</a><span class="k">class</span> <span class="nc">RecipeGit</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">rpmname</span><span class="p">,</span> <span class="n">rpmversion</span><span class="p">,</span> <span class="n">rpmrelease</span><span class="p">,</span> <span class="n">summary</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="n">ref</span><span class="p">,</span> <span class="n">destination</span><span class="p">):</span>
|
||||
<span class="nb">dict</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">rpmname</span><span class="o">=</span><span class="n">rpmname</span><span class="p">,</span> <span class="n">rpmversion</span><span class="o">=</span><span class="n">rpmversion</span><span class="p">,</span> <span class="n">rpmrelease</span><span class="o">=</span><span class="n">rpmrelease</span><span class="p">,</span>
|
||||
<span class="n">summary</span><span class="o">=</span><span class="n">summary</span><span class="p">,</span> <span class="n">repo</span><span class="o">=</span><span class="n">repo</span><span class="p">,</span> <span class="n">ref</span><span class="o">=</span><span class="n">ref</span><span class="p">,</span> <span class="n">destination</span><span class="o">=</span><span class="n">destination</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="recipe_from_file"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.recipe_from_file">[docs]</a><span class="k">def</span> <span class="nf">recipe_from_file</span><span class="p">(</span><span class="n">recipe_path</span><span class="p">):</span>
|
||||
<span class="sd">"""Return a recipe file as a Recipe object</span>
|
||||
|
||||
@ -387,14 +449,24 @@
|
||||
<span class="n">groups</span> <span class="o">=</span> <span class="p">[</span><span class="n">RecipeGroup</span><span class="p">(</span><span class="n">g</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"name"</span><span class="p">))</span> <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s2">"groups"</span><span class="p">]]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">groups</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"repos"</span><span class="p">)</span> <span class="ow">and</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"repos"</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"git"</span><span class="p">):</span>
|
||||
<span class="n">gitrepos</span> <span class="o">=</span> <span class="p">[</span><span class="n">NewRecipeGit</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s2">"repos"</span><span class="p">][</span><span class="s2">"git"</span><span class="p">]]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">gitrepos</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">name</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span>
|
||||
<span class="n">description</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span>
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"version"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"customizations"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># [customizations] was incorrectly documented at first, so we have to support using it</span>
|
||||
<span class="c1"># as [[customizations]] by grabbing the first element.</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">customizations</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="n">customizations</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
|
||||
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">RecipeError</span><span class="p">(</span><span class="s2">"There was a problem parsing the recipe: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">Recipe</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">customizations</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">Recipe</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">customizations</span><span class="p">,</span> <span class="n">gitrepos</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="gfile"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.gfile">[docs]</a><span class="k">def</span> <span class="nf">gfile</span><span class="p">(</span><span class="n">path</span><span class="p">):</span>
|
||||
<span class="sd">"""Convert a string path to GFile for use with Git"""</span>
|
||||
@ -565,6 +637,9 @@
|
||||
<span class="sd"> If no commit is passed the master:filename is returned, otherwise it will be</span>
|
||||
<span class="sd"> commit:filename</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repo_file_exists</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">)):</span>
|
||||
<span class="k">raise</span> <span class="n">RecipeFileError</span><span class="p">(</span><span class="s2">"Unknown blueprint"</span><span class="p">)</span>
|
||||
|
||||
<span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">recipe_toml</span><span class="p">)</span> <span class="o">=</span> <span class="n">read_commit</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">),</span> <span class="n">commit</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">recipe_from_toml</span><span class="p">(</span><span class="n">recipe_toml</span><span class="p">)</span></div>
|
||||
|
||||
@ -788,6 +863,9 @@
|
||||
|
||||
<span class="sd"> Uses tag_file_commit()</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repo_file_exists</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">)):</span>
|
||||
<span class="k">raise</span> <span class="n">RecipeFileError</span><span class="p">(</span><span class="s2">"Unknown blueprint"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">tag_file_commit</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="tag_file_commit"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.tag_file_commit">[docs]</a><span class="k">def</span> <span class="nf">tag_file_commit</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span>
|
||||
@ -1077,6 +1155,24 @@
|
||||
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s2">"Group"</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s2">"groups"</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s2">"groups"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">diffs</span></div>
|
||||
|
||||
<div class="viewcode-block" id="repo_file_exists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.repo_file_exists">[docs]</a><span class="k">def</span> <span class="nf">repo_file_exists</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span>
|
||||
<span class="sd">"""Return True if the filename exists on the branch</span>
|
||||
|
||||
<span class="sd"> :param repo: Open repository</span>
|
||||
<span class="sd"> :type repo: Git.Repository</span>
|
||||
<span class="sd"> :param branch: Branch name</span>
|
||||
<span class="sd"> :type branch: str</span>
|
||||
<span class="sd"> :param filename: Filename to check</span>
|
||||
<span class="sd"> :type filename: str</span>
|
||||
<span class="sd"> :returns: True if the filename exists on the HEAD of the branch, False otherwise.</span>
|
||||
<span class="sd"> :rtype: bool</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">commit</span> <span class="o">=</span> <span class="n">head_commit</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)</span><span class="o">.</span><span class="n">get_id</span><span class="p">()</span><span class="o">.</span><span class="n">to_string</span><span class="p">()</span>
|
||||
<span class="n">commit_id</span> <span class="o">=</span> <span class="n">Git</span><span class="o">.</span><span class="n">OId</span><span class="o">.</span><span class="n">new_from_string</span><span class="p">(</span><span class="n">commit</span><span class="p">)</span>
|
||||
<span class="n">commit_obj</span> <span class="o">=</span> <span class="n">repo</span><span class="o">.</span><span class="n">lookup</span><span class="p">(</span><span class="n">commit_id</span><span class="p">,</span> <span class="n">Git</span><span class="o">.</span><span class="n">Commit</span><span class="p">)</span>
|
||||
<span class="n">tree</span> <span class="o">=</span> <span class="n">commit_obj</span><span class="o">.</span><span class="n">get_tree</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="n">tree</span><span class="o">.</span><span class="n">get_by_name</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -1089,7 +1185,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -1108,27 +1204,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.server — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.server — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -185,7 +184,6 @@
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<span class="n">GitLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s2">"GitLock"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"repo"</span><span class="p">,</span> <span class="s2">"lock"</span><span class="p">,</span> <span class="s2">"dir"</span><span class="p">])</span>
|
||||
<span class="n">DNFLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s2">"DNFLock"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"dbo"</span><span class="p">,</span> <span class="s2">"lock"</span><span class="p">])</span>
|
||||
|
||||
<span class="n">server</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
|
||||
@ -250,7 +248,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -269,27 +267,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.timestamp — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.timestamp — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -218,7 +217,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -237,27 +236,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.v0 — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.v0 — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -220,15 +219,23 @@
|
||||
<span class="sd"> "kubernetes" ],</span>
|
||||
<span class="sd"> "total": 6 }</span>
|
||||
|
||||
<span class="sd">`/api/v0/blueprints/info/<blueprint_names>`</span>
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
<span class="sd">`/api/v0/blueprints/info/<blueprint_names>[?format=<json|toml>]`</span>
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
|
||||
<span class="sd"> Return the JSON representation of the blueprint. This includes 3 top level</span>
|
||||
<span class="sd"> objects. `changes` which lists whether or not the workspace is different from</span>
|
||||
<span class="sd"> the most recent commit. `blueprints` which lists the JSON representation of the</span>
|
||||
<span class="sd"> blueprint, and `errors` which will list any errors, like non-existant blueprints.</span>
|
||||
|
||||
<span class="sd"> Example::</span>
|
||||
<span class="sd"> By default the response is JSON, but if `?format=toml` is included in the URL's</span>
|
||||
<span class="sd"> arguments it will return the response as the blueprint's raw TOML content.</span>
|
||||
<span class="sd"> *Unless* there is an error which will only return a 400 and a standard error</span>
|
||||
<span class="sd"> `Status Response`_.</span>
|
||||
|
||||
<span class="sd"> If there is an error when JSON is requested the successful blueprints and the</span>
|
||||
<span class="sd"> errors will both be returned.</span>
|
||||
|
||||
<span class="sd"> Example of json response::</span>
|
||||
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "changes": [</span>
|
||||
@ -350,7 +357,8 @@
|
||||
|
||||
<span class="sd"> Delete a blueprint. The blueprint is deleted from the branch, and will no longer</span>
|
||||
<span class="sd"> be listed by the `list` route. A blueprint can be undeleted using the `undo` route</span>
|
||||
<span class="sd"> to revert to a previous commit.</span>
|
||||
<span class="sd"> to revert to a previous commit. This will also delete the workspace copy of the</span>
|
||||
<span class="sd"> blueprint.</span>
|
||||
|
||||
<span class="sd"> The response will be a status response with `status` set to true, or an</span>
|
||||
<span class="sd"> error response with it set to false and an error message included.</span>
|
||||
@ -839,7 +847,9 @@
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
|
||||
<span class="sd"> Start a compose. The content type should be 'application/json' and the body of the POST</span>
|
||||
<span class="sd"> should look like this::</span>
|
||||
<span class="sd"> should look like this</span>
|
||||
<span class="sd"> </span>
|
||||
<span class="sd"> Example::</span>
|
||||
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "blueprint_name": "http-server",</span>
|
||||
@ -849,8 +859,10 @@
|
||||
|
||||
<span class="sd"> Pass it the name of the blueprint, the type of output (from '/api/v0/compose/types'), and the</span>
|
||||
<span class="sd"> blueprint branch to use. 'branch' is optional and will default to master. It will create a new</span>
|
||||
<span class="sd"> build and add it to the queue. It returns the build uuid and a status if it succeeds::</span>
|
||||
<span class="sd"> build and add it to the queue. It returns the build uuid and a status if it succeeds</span>
|
||||
|
||||
<span class="sd"> Example::</span>
|
||||
<span class="sd"> </span>
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "build_id": "e6fa6db4-9c81-4b70-870f-a697ca405cdf",</span>
|
||||
<span class="sd"> "status": true</span>
|
||||
@ -861,6 +873,8 @@
|
||||
|
||||
<span class="sd"> Returns the list of supported output types that are valid for use with 'POST /api/v0/compose'</span>
|
||||
|
||||
<span class="sd"> Example::</span>
|
||||
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "types": [</span>
|
||||
<span class="sd"> {</span>
|
||||
@ -958,10 +972,11 @@
|
||||
<span class="sd"> ]</span>
|
||||
<span class="sd"> }</span>
|
||||
|
||||
<span class="sd">`/api/v0/compose/status/<uuids>`</span>
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
<span class="sd">`/api/v0/compose/status/<uuids>[?blueprint=<blueprint_name>&status=<compose_status>&type=<compose_type>]`</span>
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
|
||||
<span class="sd"> Return the details for each of the comma-separated list of uuids.</span>
|
||||
<span class="sd"> Return the details for each of the comma-separated list of uuids. A uuid of '*' will return</span>
|
||||
<span class="sd"> details for all composes.</span>
|
||||
|
||||
<span class="sd"> Example::</span>
|
||||
|
||||
@ -1148,7 +1163,7 @@
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.queue</span> <span class="k">import</span> <span class="n">uuid_tar</span><span class="p">,</span> <span class="n">uuid_image</span><span class="p">,</span> <span class="n">uuid_cancel</span><span class="p">,</span> <span class="n">uuid_log</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">RecipeError</span><span class="p">,</span> <span class="n">list_branch_files</span><span class="p">,</span> <span class="n">read_recipe_commit</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">,</span> <span class="n">list_commits</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">recipe_from_dict</span><span class="p">,</span> <span class="n">recipe_from_toml</span><span class="p">,</span> <span class="n">commit_recipe</span><span class="p">,</span> <span class="n">delete_recipe</span><span class="p">,</span> <span class="n">revert_recipe</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">tag_recipe_commit</span><span class="p">,</span> <span class="n">recipe_diff</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">tag_recipe_commit</span><span class="p">,</span> <span class="n">recipe_diff</span><span class="p">,</span> <span class="n">RecipeFileError</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.regexes</span> <span class="k">import</span> <span class="n">VALID_API_STRING</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.workspace</span> <span class="k">import</span> <span class="n">workspace_read</span><span class="p">,</span> <span class="n">workspace_write</span><span class="p">,</span> <span class="n">workspace_delete</span>
|
||||
|
||||
@ -1169,12 +1184,21 @@
|
||||
<span class="k">return</span> <span class="n">iterable</span><span class="p">[</span><span class="n">offset</span><span class="p">:][:</span><span class="n">limit</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprint_exists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.blueprint_exists">[docs]</a><span class="k">def</span> <span class="nf">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="sd">"""Return True if the blueprint exists</span>
|
||||
|
||||
<span class="sd"> :param api: flask object</span>
|
||||
<span class="sd"> :type api: Flask</span>
|
||||
<span class="sd"> :param branch: Branch name</span>
|
||||
<span class="sd"> :type branch: str</span>
|
||||
<span class="sd"> :param recipe_name: Recipe name to read</span>
|
||||
<span class="sd"> :type recipe_name: str</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">except</span> <span class="n">RecipeError</span><span class="p">:</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">RecipeError</span><span class="p">,</span> <span class="n">RecipeFileError</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="kc">False</span></div>
|
||||
|
||||
<div class="viewcode-block" id="v0_api"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.v0_api">[docs]</a><span class="k">def</span> <span class="nf">v0_api</span><span class="p">(</span><span class="n">api</span><span class="p">):</span>
|
||||
@ -1194,8 +1218,9 @@
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BAD_LIMIT_OR_OFFSET</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">([</span><span class="n">f</span><span class="p">[:</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">list_branch_files</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)],</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">blueprints</span><span class="o">=</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">limit</span><span class="o">=</span><span class="n">limit</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> <span class="n">total</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">blueprints</span><span class="p">))</span>
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="p">[</span><span class="n">f</span><span class="p">[:</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">list_branch_files</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)]</span>
|
||||
<span class="n">limited_blueprints</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">blueprints</span><span class="o">=</span><span class="n">limited_blueprints</span><span class="p">,</span> <span class="n">limit</span><span class="o">=</span><span class="n">limit</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> <span class="n">total</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">blueprints</span><span class="p">))</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/info"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/info/<blueprint_names>"</span><span class="p">)</span>
|
||||
@ -1232,6 +1257,10 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">git_blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="c1"># Adding an exception would be redundant, skip it</span>
|
||||
<span class="n">git_blueprint</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_info) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">git_blueprint</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">exceptions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -1258,8 +1287,12 @@
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">out_fmt</span> <span class="o">==</span> <span class="s2">"toml"</span><span class="p">:</span>
|
||||
<span class="c1"># With TOML output we just want to dump the raw blueprint, skipping the rest.</span>
|
||||
<span class="k">return</span> <span class="s2">"</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">blueprints</span><span class="p">])</span>
|
||||
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
|
||||
<span class="c1"># If there are errors they need to be reported, use JSON and 400 for this</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># With TOML output we just want to dump the raw blueprint, skipping the rest.</span>
|
||||
<span class="k">return</span> <span class="s2">"</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">blueprints</span><span class="p">])</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">changes</span><span class="o">=</span><span class="n">changes</span><span class="p">,</span> <span class="n">blueprints</span><span class="o">=</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">)</span>
|
||||
|
||||
@ -1286,19 +1319,19 @@
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">blueprint_name</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">blueprint_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)]:</span>
|
||||
<span class="n">filename</span> <span class="o">=</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Unknown blueprint name: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">commits</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">list_commits</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">filename</span><span class="p">),</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="n">commits</span> <span class="o">=</span> <span class="n">list_commits</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_changes) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">blueprints</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"name"</span><span class="p">:</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s2">"changes"</span><span class="p">:</span><span class="n">commits</span><span class="p">,</span> <span class="s2">"total"</span><span class="p">:</span><span class="nb">len</span><span class="p">(</span><span class="n">commits</span><span class="p">)})</span>
|
||||
<span class="k">if</span> <span class="n">commits</span><span class="p">:</span>
|
||||
<span class="n">limited_commits</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">commits</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="n">blueprints</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"name"</span><span class="p">:</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s2">"changes"</span><span class="p">:</span><span class="n">limited_commits</span><span class="p">,</span> <span class="s2">"total"</span><span class="p">:</span><span class="nb">len</span><span class="p">(</span><span class="n">commits</span><span class="p">)})</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># no commits means there is no blueprint in the branch</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
|
||||
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
|
||||
@ -1348,6 +1381,7 @@
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">workspace_delete</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="n">delete_recipe</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_delete) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -1446,6 +1480,9 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">tag_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_tag) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_tag) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
@ -1470,6 +1507,9 @@
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Unknown blueprint name: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">}])</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">from_commit</span> <span class="o">==</span> <span class="s2">"NEWEST"</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
@ -1536,6 +1576,9 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="c1"># adding an error here would be redundant, skip it</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_freeze) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_freeze) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -1596,6 +1639,9 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="c1"># adding an error here would be redundant, skip it</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_depsolve) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_depsolve) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -1928,6 +1974,9 @@
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">})</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Unknown blueprint name: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">),</span> <span class="mi">400</span>
|
||||
|
||||
@ -1979,14 +2028,38 @@
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuids</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"blueprint"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="n">compose_type</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"type"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
|
||||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">uuid</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">uuids</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)]:</span>
|
||||
<span class="n">details</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">details</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">details</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">})</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">uuids</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'*'</span><span class="p">:</span>
|
||||
<span class="n">queue_status_dict</span> <span class="o">=</span> <span class="n">queue_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">])</span>
|
||||
<span class="n">queue_new</span> <span class="o">=</span> <span class="n">queue_status_dict</span><span class="p">[</span><span class="s2">"new"</span><span class="p">]</span>
|
||||
<span class="n">queue_running</span> <span class="o">=</span> <span class="n">queue_status_dict</span><span class="p">[</span><span class="s2">"run"</span><span class="p">]</span>
|
||||
<span class="n">candidates</span> <span class="o">=</span> <span class="n">queue_new</span> <span class="o">+</span> <span class="n">queue_running</span> <span class="o">+</span> <span class="n">build_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">])</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">candidates</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">uuid</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">uuids</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)]:</span>
|
||||
<span class="n">details</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">details</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">})</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">candidates</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">details</span><span class="p">)</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">details</span> <span class="ow">in</span> <span class="n">candidates</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">blueprint</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">details</span><span class="p">[</span><span class="s1">'blueprint'</span><span class="p">]</span> <span class="o">!=</span> <span class="n">blueprint</span><span class="p">:</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">details</span><span class="p">[</span><span class="s1">'queue_status'</span><span class="p">]</span> <span class="o">!=</span> <span class="n">status</span><span class="p">:</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">compose_type</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">details</span><span class="p">[</span><span class="s1">'compose_type'</span><span class="p">]</span> <span class="o">!=</span> <span class="n">compose_type</span><span class="p">:</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">details</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">uuids</span><span class="o">=</span><span class="n">results</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">)</span>
|
||||
|
||||
@ -2179,7 +2252,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -2198,27 +2271,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.workspace — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.api.workspace — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -266,7 +265,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -285,27 +284,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.base — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.base — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -234,7 +233,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -253,27 +252,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.buildstamp — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.buildstamp — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -180,6 +179,7 @@
|
||||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax.buildstamp"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">datetime</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="BuildStamp"><a class="viewcode-back" href="../../pylorax.html#pylorax.buildstamp.BuildStamp">[docs]</a><span class="k">class</span> <span class="nc">BuildStamp</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
@ -191,7 +191,11 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">isfinal</span> <span class="o">=</span> <span class="n">isfinal</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">variant</span> <span class="o">=</span> <span class="n">variant</span>
|
||||
|
||||
<span class="n">now</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="s1">'SOURCE_DATE_EPOCH'</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span>
|
||||
<span class="n">now</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">utcfromtimestamp</span><span class="p">(</span>
|
||||
<span class="nb">int</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'SOURCE_DATE_EPOCH'</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">now</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
|
||||
<span class="n">now</span> <span class="o">=</span> <span class="n">now</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y%m</span><span class="si">%d</span><span class="s2">%H%M"</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">uuid</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{0}</span><span class="s2">.</span><span class="si">{1}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">now</span><span class="p">,</span> <span class="n">buildarch</span><span class="p">)</span>
|
||||
|
||||
@ -228,7 +232,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -247,27 +251,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.cmdline — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.cmdline — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -232,12 +231,12 @@
|
||||
<span class="n">action</span><span class="o">=</span><span class="s2">"store_false"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"doupgrade"</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--logfile"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"./lorax.log"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to logfile"</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--tmp"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"/var/tmp"</span><span class="p">,</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--tmp"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"/var/tmp/lorax"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Top level temporary directory"</span> <span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--cachedir"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"DNF cache directory. Default is a temporary dir."</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--workdir"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Work directory, overrides --tmp. Default is a temporary dir under /var/tmp"</span><span class="p">)</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Work directory, overrides --tmp. Default is a temporary dir under /var/tmp/lorax"</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--force"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Run even when the destination directory exists"</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--add-template"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"add_templates"</span><span class="p">,</span>
|
||||
@ -266,6 +265,8 @@
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Do not verify SSL certificates"</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--dnfplugin"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"append"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"dnfplugins"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Enable a DNF plugin by name/glob, or * to enable all of them."</span><span class="p">)</span>
|
||||
<span class="n">optional</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--squashfs-only"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Use a plain squashfs filesystem for the runtime."</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># dracut arguments</span>
|
||||
<span class="n">dracut_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s2">"dracut arguments"</span><span class="p">)</span>
|
||||
@ -303,6 +304,8 @@
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Build an ami image"</span><span class="p">)</span>
|
||||
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--make-tar"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Build a tar of the root filesystem"</span><span class="p">)</span>
|
||||
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--make-tar-disk"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Build a tar of a partitioned disk image"</span><span class="p">)</span>
|
||||
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--make-pxe-live"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Build a live pxe boot squashfs image"</span><span class="p">)</span>
|
||||
<span class="n">action</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--make-ostree-live"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">,</span>
|
||||
@ -358,6 +361,9 @@
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--nomacboot"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_false"</span><span class="p">,</span>
|
||||
<span class="n">dest</span><span class="o">=</span><span class="s2">"domacboot"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--extra-boot-args"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"extra_boot_args"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Extra arguments to add to the bootloader kernel cmdline in the templates"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">image_group</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">add_argument_group</span><span class="p">(</span><span class="s2">"disk/fs image arguments"</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--disk-image"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to existing disk image to use for creating final image."</span><span class="p">)</span>
|
||||
@ -367,8 +373,12 @@
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Path to existing filesystem image to use for creating final image."</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--image-name"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Name of output file to create. Used for tar, fs and disk image. Default is a random name."</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--tar-disk-name"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Name of the archive member for make-tar-disk."</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--fs-label"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"Anaconda"</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Label to set on fsimage, default is 'Anaconda'"</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--image-size-align"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Create a disk image with a size that is a multiple of this value in MiB."</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--image-type"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">help</span><span class="o">=</span><span class="s2">"Create an image with qemu-img. See qemu-img --help for supported formats."</span><span class="p">)</span>
|
||||
<span class="n">image_group</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">"--qemu-arg"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"append"</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">"qemu_args"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="p">[],</span>
|
||||
@ -471,7 +481,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -490,27 +500,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.creator — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.creator — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -312,7 +311,7 @@
|
||||
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Calculating SHA256 checksum of </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
|
||||
<span class="n">sha256</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">sha256</span><span class="p">()</span>
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="s2">"rb"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">data</span><span class="p">:</span>
|
||||
@ -360,7 +359,7 @@
|
||||
<span class="n">rb</span> <span class="o">=</span> <span class="n">RuntimeBuilder</span><span class="p">(</span><span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">fake_dbo</span><span class="p">)</span>
|
||||
<span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span> <span class="o">=</span> <span class="n">squashfs_args</span><span class="p">(</span><span class="n">opts</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Creating runtime"</span><span class="p">)</span>
|
||||
<span class="n">rb</span><span class="o">.</span><span class="n">create_runtime</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="n">RUNTIME</span><span class="p">),</span> <span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">,</span>
|
||||
<span class="n">rb</span><span class="o">.</span><span class="n">create_ext4_runtime</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="n">RUNTIME</span><span class="p">),</span> <span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">,</span>
|
||||
<span class="n">compression</span><span class="o">=</span><span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="n">compressargs</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
@ -512,7 +511,8 @@
|
||||
<span class="n">tb</span> <span class="o">=</span> <span class="n">TreeBuilder</span><span class="p">(</span><span class="n">product</span><span class="o">=</span><span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="n">arch</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">domacboot</span><span class="p">,</span>
|
||||
<span class="n">inroot</span><span class="o">=</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">outroot</span><span class="o">=</span><span class="n">work_dir</span><span class="p">,</span>
|
||||
<span class="n">runtime</span><span class="o">=</span><span class="n">RUNTIME</span><span class="p">,</span> <span class="n">isolabel</span><span class="o">=</span><span class="n">isolabel</span><span class="p">,</span>
|
||||
<span class="n">templatedir</span><span class="o">=</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">lorax_templates</span><span class="p">,</span><span class="s2">"live/"</span><span class="p">))</span>
|
||||
<span class="n">templatedir</span><span class="o">=</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">lorax_templates</span><span class="p">,</span><span class="s2">"live/"</span><span class="p">),</span>
|
||||
<span class="n">extra_boot_args</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">extra_boot_args</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Rebuilding initrds"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">dracut_args</span><span class="p">:</span>
|
||||
<span class="n">dracut_args</span> <span class="o">=</span> <span class="n">DRACUT_DEFAULT</span>
|
||||
@ -602,6 +602,8 @@
|
||||
<span class="sd"> :param str ks: Path to the kickstart to use for the installation</span>
|
||||
<span class="sd"> :returns: Disk size in MiB</span>
|
||||
<span class="sd"> :rtype: int</span>
|
||||
|
||||
<span class="sd"> Also takes into account the use of reqpart or reqpart --add-boot</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Disk size for a filesystem image should only be the size of /</span>
|
||||
<span class="c1"># to prevent surprises when using the same kickstart for different installations.</span>
|
||||
@ -610,43 +612,80 @@
|
||||
<span class="n">disk_size</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">+</span> <span class="nb">sum</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">size</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">unique_partitions</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">mountpoint</span> <span class="o">==</span> <span class="s2">"/"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">disk_size</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">+</span> <span class="nb">sum</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">size</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">unique_partitions</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
|
||||
|
||||
<span class="c1"># reqpart can add 1M, 2M, 200M based on platform. Add 500M to be sure</span>
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">reqpart</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Adding 500M for reqpart"</span><span class="p">)</span>
|
||||
<span class="n">disk_size</span> <span class="o">+=</span> <span class="mi">500</span>
|
||||
|
||||
<span class="c1"># It can also request adding /boot which is 1G</span>
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">reqpart</span><span class="o">.</span><span class="n">addBoot</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Adding 1024M for reqpart --addboot"</span><span class="p">)</span>
|
||||
<span class="n">disk_size</span> <span class="o">+=</span> <span class="mi">1024</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_size_align</span><span class="p">:</span>
|
||||
<span class="n">disk_size</span> <span class="o">+=</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_size_align</span> <span class="o">-</span> <span class="p">(</span><span class="n">disk_size</span> <span class="o">%</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_size_align</span><span class="p">)</span>
|
||||
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Using disk size of </span><span class="si">%s</span><span class="s2">MiB"</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">disk_size</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_image"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_image">[docs]</a><span class="k">def</span> <span class="nf">make_image</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="make_image"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_image">[docs]</a><span class="k">def</span> <span class="nf">make_image</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Install to a disk image</span>
|
||||
|
||||
<span class="sd"> :param opts: options passed to livemedia-creator</span>
|
||||
<span class="sd"> :type opts: argparse options</span>
|
||||
<span class="sd"> :param str ks: Path to the kickstart to use for the installation</span>
|
||||
<span class="sd"> :param cancel_func: Function that returns True to cancel build</span>
|
||||
<span class="sd"> :type cancel_func: function</span>
|
||||
<span class="sd"> :returns: Path of the image created</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
|
||||
<span class="sd"> Use qemu+boot.iso or anaconda to install to a disk image.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_name</span><span class="p">:</span>
|
||||
|
||||
<span class="c1"># For make_tar_disk, opts.image_name is the name of the final tarball.</span>
|
||||
<span class="c1"># Use opts.tar_disk_name as the name of the disk image</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar_disk</span><span class="p">:</span>
|
||||
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">tar_disk_name</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_name</span><span class="p">:</span>
|
||||
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_name</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">"lmc-disk-"</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">".img"</span><span class="p">,</span> <span class="nb">dir</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"disk_img = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
|
||||
<span class="n">disk_size</span> <span class="o">=</span> <span class="n">calculate_disk_size</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># For make_tar_disk, pass a second path parameter for the final tarball</span>
|
||||
<span class="c1"># not the final output file.</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar_disk</span><span class="p">:</span>
|
||||
<span class="n">tar_img</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_name</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">tar_img</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">:</span>
|
||||
<span class="n">novirt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
|
||||
<span class="n">novirt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="n">cancel_func</span><span class="p">,</span> <span class="n">tar_img</span><span class="o">=</span><span class="n">tar_img</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">install_log</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">logfile</span><span class="p">))</span><span class="o">+</span><span class="s2">"/virt-install.log"</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"install_log = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">install_log</span><span class="p">)</span>
|
||||
|
||||
<span class="n">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
|
||||
<span class="n">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="n">cancel_func</span><span class="p">,</span> <span class="n">tar_img</span><span class="o">=</span><span class="n">tar_img</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">InstallError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Install failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">keep_image</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">disk_img</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing bad disk image"</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">keep_image</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">disk_img</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing bad disk image"</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">tar_img</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">tar_img</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing bad tar file"</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">tar_img</span><span class="p">)</span>
|
||||
<span class="k">raise</span>
|
||||
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Disk Image install successful"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar_disk</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">tar_img</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">disk_img</span></div>
|
||||
|
||||
|
||||
@ -733,11 +772,54 @@
|
||||
|
||||
<span class="k">return</span> <span class="n">work_dir</span></div>
|
||||
|
||||
<div class="viewcode-block" id="run_creator"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.run_creator">[docs]</a><span class="k">def</span> <span class="nf">run_creator</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="check_kickstart"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.check_kickstart">[docs]</a><span class="k">def</span> <span class="nf">check_kickstart</span><span class="p">(</span><span class="n">ks</span><span class="p">,</span> <span class="n">opts</span><span class="p">):</span>
|
||||
<span class="sd">"""Check the parsed kickstart object for errors</span>
|
||||
|
||||
<span class="sd"> :param ks: Parsed Kickstart object</span>
|
||||
<span class="sd"> :type ks: pykickstart.parser.KickstartParser</span>
|
||||
<span class="sd"> :param opts: Commandline options to control the process</span>
|
||||
<span class="sd"> :type opts: Either a DataHolder or ArgumentParser</span>
|
||||
<span class="sd"> :returns: List of error strings or empty list</span>
|
||||
<span class="sd"> :rtype: list</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"url"</span><span class="p">,</span> <span class="s2">"nfs"</span><span class="p">)</span> \
|
||||
<span class="ow">and</span> <span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">ostreesetup</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Only url, nfs and ostreesetup install methods are currently supported."</span>
|
||||
<span class="s2">"Please fix your kickstart file."</span> <span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">repo</span><span class="o">.</span><span class="n">seen</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="o">!=</span> <span class="s2">"url"</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"repo can only be used with the url install method. Add url to your "</span>
|
||||
<span class="s2">"kickstart file."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"url"</span><span class="p">,</span> <span class="s2">"nfs"</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">network</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"The kickstart must activate networking if "</span>
|
||||
<span class="s2">"the url or nfs install method is used."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">displaymode</span><span class="o">.</span><span class="n">displayMode</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"The kickstart must not set a display mode (text, cmdline, "</span>
|
||||
<span class="s2">"graphical), this will interfere with livemedia-creator."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">or</span> <span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span> <span class="ow">and</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">):</span>
|
||||
<span class="c1"># Make sure the kickstart isn't using autopart and only has a / mountpoint</span>
|
||||
<span class="n">part_ok</span> <span class="o">=</span> <span class="ow">not</span> <span class="nb">any</span><span class="p">(</span><span class="n">p</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">partition</span><span class="o">.</span><span class="n">partitions</span>
|
||||
<span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">mountpoint</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"/"</span><span class="p">,</span> <span class="s2">"swap"</span><span class="p">])</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">part_ok</span> <span class="ow">or</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">autopart</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Filesystem images must use a single / part, not autopart or "</span>
|
||||
<span class="s2">"multiple partitions. swap is allowed but not used."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">reboot</span><span class="o">.</span><span class="n">action</span> <span class="o">!=</span> <span class="n">KS_SHUTDOWN</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"The kickstart must include shutdown when using virt installation."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">errors</span></div>
|
||||
|
||||
<div class="viewcode-block" id="run_creator"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.run_creator">[docs]</a><span class="k">def</span> <span class="nf">run_creator</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""Run the image creator process</span>
|
||||
|
||||
<span class="sd"> :param opts: Commandline options to control the process</span>
|
||||
<span class="sd"> :type opts: Either a DataHolder or ArgumentParser</span>
|
||||
<span class="sd"> :param cancel_func: Function that returns True to cancel build</span>
|
||||
<span class="sd"> :type cancel_func: function</span>
|
||||
<span class="sd"> :returns: The result directory and the disk image path.</span>
|
||||
<span class="sd"> :rtype: Tuple of str</span>
|
||||
|
||||
@ -765,38 +847,15 @@
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Image creation requires a kickstart file"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"url"</span><span class="p">,</span> <span class="s2">"nfs"</span><span class="p">)</span> \
|
||||
<span class="ow">and</span> <span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">ostreesetup</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Only url, nfs and ostreesetup install methods are currently supported."</span>
|
||||
<span class="s2">"Please fix your kickstart file."</span> <span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"url"</span><span class="p">,</span> <span class="s2">"nfs"</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">network</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"The kickstart must activate networking if "</span>
|
||||
<span class="s2">"the url or nfs install method is used."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">displaymode</span><span class="o">.</span><span class="n">displayMode</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"The kickstart must not set a display mode (text, cmdline, "</span>
|
||||
<span class="s2">"graphical), this will interfere with livemedia-creator."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">or</span> <span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span> <span class="ow">and</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">):</span>
|
||||
<span class="c1"># Make sure the kickstart isn't using autopart and only has a / mountpoint</span>
|
||||
<span class="n">part_ok</span> <span class="o">=</span> <span class="ow">not</span> <span class="nb">any</span><span class="p">(</span><span class="n">p</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">partition</span><span class="o">.</span><span class="n">partitions</span>
|
||||
<span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">mountpoint</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"/"</span><span class="p">,</span> <span class="s2">"swap"</span><span class="p">])</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">part_ok</span> <span class="ow">or</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">autopart</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Filesystem images must use a single / part, not autopart or "</span>
|
||||
<span class="s2">"multiple partitions. swap is allowed but not used."</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">reboot</span><span class="o">.</span><span class="n">action</span> <span class="o">!=</span> <span class="n">KS_SHUTDOWN</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"The kickstart must include shutdown when using virt installation."</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Check the kickstart for problems</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="n">check_kickstart</span><span class="p">(</span><span class="n">ks</span><span class="p">,</span> <span class="n">opts</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
|
||||
<span class="nb">list</span><span class="p">(</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">errors</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">errors</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Make the image. Output of this is either a partitioned disk image or a fsimage</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">make_image</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">)</span>
|
||||
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">make_image</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="n">cancel_func</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">InstallError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"ERROR: Image creation failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Image creation failed: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">e</span><span class="p">)</span>
|
||||
@ -816,6 +875,9 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"squashfs.img creation failed"</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"squashfs.img creation failed"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">():</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"ISO creation canceled"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">Mount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">"loop"</span><span class="p">)</span> <span class="k">as</span> <span class="n">mount_dir</span><span class="p">:</span>
|
||||
<span class="n">result_dir</span> <span class="o">=</span> <span class="n">make_livecd</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">mount_dir</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
@ -881,7 +943,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -900,27 +962,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.decorators — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.decorators — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -197,7 +196,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -216,27 +215,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.discinfo — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.discinfo — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -179,6 +178,7 @@
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax.discinfo"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
|
||||
@ -189,9 +189,14 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">basearch</span> <span class="o">=</span> <span class="n">basearch</span>
|
||||
|
||||
<div class="viewcode-block" id="DiscInfo.write"><a class="viewcode-back" href="../../pylorax.html#pylorax.discinfo.DiscInfo.write">[docs]</a> <span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">outfile</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s1">'SOURCE_DATE_EPOCH'</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span>
|
||||
<span class="n">timestamp</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'SOURCE_DATE_EPOCH'</span><span class="p">])</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">timestamp</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
||||
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"writing .discinfo file"</span><span class="p">)</span>
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">outfile</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">fobj</span><span class="p">:</span>
|
||||
<span class="n">fobj</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">{0:f}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()))</span>
|
||||
<span class="n">fobj</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">{0:f}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">timestamp</span><span class="p">))</span>
|
||||
<span class="n">fobj</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">{0.release}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">))</span>
|
||||
<span class="n">fobj</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">{0.basearch}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">))</span></div></div>
|
||||
</pre></div>
|
||||
@ -206,7 +211,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -225,27 +230,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
402
docs/html/_modules/pylorax/dnfbase.html
Normal file
402
docs/html/_modules/pylorax/dnfbase.html
Normal file
@ -0,0 +1,402 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.dnfbase — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
|
||||
<script src="../../_static/js/modernizr.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search">
|
||||
|
||||
|
||||
|
||||
<a href="../../index.html" class="icon icon-home"> Lorax
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../intro.html">Introduction to Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../intro.html#before-lorax">Before Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../lorax.html">Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../livemedia-creator.html">livemedia-creator</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../lorax-composer.html">lorax-composer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../composer-cli.html">composer-cli</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">src</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../../index.html">Lorax</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../../index.html">Docs</a> »</li>
|
||||
|
||||
<li><a href="../index.html">Module code</a> »</li>
|
||||
|
||||
<li><a href="../pylorax.html">pylorax</a> »</li>
|
||||
|
||||
<li>pylorax.dnfbase</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.dnfbase</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">dnf</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">flatconfig</span>
|
||||
|
||||
<div class="viewcode-block" id="get_dnf_base_object"><a class="viewcode-back" href="../../pylorax.html#pylorax.dnfbase.get_dnf_base_object">[docs]</a><span class="k">def</span> <span class="nf">get_dnf_base_object</span><span class="p">(</span><span class="n">installroot</span><span class="p">,</span> <span class="n">sources</span><span class="p">,</span> <span class="n">mirrorlists</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">repos</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">enablerepos</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">disablerepos</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">tempdir</span><span class="o">=</span><span class="s2">"/var/tmp"</span><span class="p">,</span> <span class="n">proxy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">releasever</span><span class="o">=</span><span class="s2">"29"</span><span class="p">,</span>
|
||||
<span class="n">cachedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">logdir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">sslverify</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dnfplugins</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">""" Create a dnf Base object and setup the repositories and installroot</span>
|
||||
|
||||
<span class="sd"> :param string installroot: Full path to the installroot</span>
|
||||
<span class="sd"> :param list sources: List of source repo urls to use for the installation</span>
|
||||
<span class="sd"> :param list enablerepos: List of repo names to enable</span>
|
||||
<span class="sd"> :param list disablerepos: List of repo names to disable</span>
|
||||
<span class="sd"> :param list mirrorlist: List of mirrors to use</span>
|
||||
<span class="sd"> :param string tempdir: Path of temporary directory</span>
|
||||
<span class="sd"> :param string proxy: http proxy to use when fetching packages</span>
|
||||
<span class="sd"> :param string releasever: Release version to pass to dnf</span>
|
||||
<span class="sd"> :param string cachedir: Directory to use for caching packages</span>
|
||||
<span class="sd"> :param bool noverifyssl: Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.</span>
|
||||
|
||||
<span class="sd"> If tempdir is not set /var/tmp is used.</span>
|
||||
<span class="sd"> If cachedir is None a dnf.cache directory is created inside tmpdir</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">sanitize_repo</span><span class="p">(</span><span class="n">repo</span><span class="p">):</span>
|
||||
<span class="sd">"""Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum"""</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"/"</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="s2">"file://</span><span class="si">{0}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">repo</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="nb">any</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">p</span><span class="p">)</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">(</span><span class="s1">'http://'</span><span class="p">,</span> <span class="s1">'https://'</span><span class="p">,</span> <span class="s1">'ftp://'</span><span class="p">,</span> <span class="s1">'file://'</span><span class="p">)):</span>
|
||||
<span class="k">return</span> <span class="n">repo</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="n">mirrorlists</span> <span class="o">=</span> <span class="n">mirrorlists</span> <span class="ow">or</span> <span class="p">[]</span>
|
||||
|
||||
<span class="c1"># sanitize the repositories</span>
|
||||
<span class="n">sources</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">sanitize_repo</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">sources</span><span class="p">)</span>
|
||||
<span class="n">mirrorlists</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">sanitize_repo</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">mirrorlists</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># remove invalid repositories</span>
|
||||
<span class="n">sources</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">sources</span> <span class="k">if</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="n">mirrorlists</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">mirrorlists</span> <span class="k">if</span> <span class="n">r</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">cachedir</span><span class="p">:</span>
|
||||
<span class="n">cachedir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tempdir</span><span class="p">,</span> <span class="s2">"dnf.cache"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">cachedir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">cachedir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">logdir</span><span class="p">:</span>
|
||||
<span class="n">logdir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tempdir</span><span class="p">,</span> <span class="s2">"dnf.logs"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">logdir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">logdir</span><span class="p">)</span>
|
||||
|
||||
<span class="n">dnfbase</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">Base</span><span class="p">()</span>
|
||||
<span class="c1"># Enable DNF pluings</span>
|
||||
<span class="c1"># NOTE: These come from the HOST system's environment</span>
|
||||
<span class="k">if</span> <span class="n">dnfplugins</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">dnfplugins</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"*"</span><span class="p">:</span>
|
||||
<span class="c1"># Enable them all</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">init_plugins</span><span class="p">()</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># Only enable the listed plugins</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">init_plugins</span><span class="p">(</span><span class="n">disabled_glob</span><span class="o">=</span><span class="p">[</span><span class="s2">"*"</span><span class="p">],</span> <span class="n">enable_plugins</span><span class="o">=</span><span class="n">dnfplugins</span><span class="p">)</span>
|
||||
<span class="n">conf</span> <span class="o">=</span> <span class="n">dnfbase</span><span class="o">.</span><span class="n">conf</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">logdir</span> <span class="o">=</span> <span class="n">logdir</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">cachedir</span> <span class="o">=</span> <span class="n">cachedir</span>
|
||||
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">install_weak_deps</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">releasever</span> <span class="o">=</span> <span class="n">releasever</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">installroot</span> <span class="o">=</span> <span class="n">installroot</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">prepend_installroot</span><span class="p">(</span><span class="s1">'persistdir'</span><span class="p">)</span>
|
||||
<span class="c1"># this is a weird 'AppendOption' thing that, when you set it,</span>
|
||||
<span class="c1"># actually appends. Doing this adds 'nodocs' to the existing list</span>
|
||||
<span class="c1"># of values, over in libdnf, it does not replace the existing values.</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">tsflags</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'nodocs'</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">proxy</span><span class="p">:</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">proxy</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">sslverify</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">sslverify</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="c1"># DNF 3.2 needs to have module_platform_id set, otherwise depsolve won't work correctly</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"/etc/os-release is missing, cannot determine platform id, falling back to </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">DEFAULT_PLATFORM_ID</span><span class="p">)</span>
|
||||
<span class="n">platform_id</span> <span class="o">=</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">os_release</span> <span class="o">=</span> <span class="n">flatconfig</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">)</span>
|
||||
<span class="n">platform_id</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"PLATFORM_ID"</span><span class="p">,</span> <span class="n">DEFAULT_PLATFORM_ID</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Using </span><span class="si">%s</span><span class="s2"> for module_platform_id"</span><span class="p">,</span> <span class="n">platform_id</span><span class="p">)</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">module_platform_id</span> <span class="o">=</span> <span class="n">platform_id</span>
|
||||
|
||||
<span class="c1"># Add .repo files</span>
|
||||
<span class="k">if</span> <span class="n">repos</span><span class="p">:</span>
|
||||
<span class="n">reposdir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tempdir</span><span class="p">,</span> <span class="s2">"dnf.repos"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">reposdir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">reposdir</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">repos</span><span class="p">:</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">r</span><span class="p">,</span> <span class="n">reposdir</span><span class="p">)</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">reposdir</span> <span class="o">=</span> <span class="p">[</span><span class="n">reposdir</span><span class="p">]</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">read_all_repos</span><span class="p">()</span>
|
||||
|
||||
<span class="c1"># add the sources</span>
|
||||
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">sources</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s2">"SRPM"</span> <span class="ow">in</span> <span class="n">r</span> <span class="ow">or</span> <span class="s2">"srpm"</span> <span class="ow">in</span> <span class="n">r</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Skipping source repo: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">repo_name</span> <span class="o">=</span> <span class="s2">"lorax-repo-</span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span> <span class="n">i</span>
|
||||
<span class="n">repo</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">repo</span><span class="o">.</span><span class="n">Repo</span><span class="p">(</span><span class="n">repo_name</span><span class="p">,</span> <span class="n">conf</span><span class="p">)</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span> <span class="o">=</span> <span class="p">[</span><span class="n">r</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">proxy</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">proxy</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">repo</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Added '</span><span class="si">%s</span><span class="s2">': </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Fetching metadata..."</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RepoError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Error fetching metadata for </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># add the mirrorlists</span>
|
||||
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">mirrorlists</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s2">"SRPM"</span> <span class="ow">in</span> <span class="n">r</span> <span class="ow">or</span> <span class="s2">"srpm"</span> <span class="ow">in</span> <span class="n">r</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Skipping source repo: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">repo_name</span> <span class="o">=</span> <span class="s2">"lorax-mirrorlist-</span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span> <span class="n">i</span>
|
||||
<span class="n">repo</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">repo</span><span class="o">.</span><span class="n">Repo</span><span class="p">(</span><span class="n">repo_name</span><span class="p">,</span> <span class="n">conf</span><span class="p">)</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span> <span class="o">=</span> <span class="n">r</span>
|
||||
<span class="k">if</span> <span class="n">proxy</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">proxy</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">repo</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Added '</span><span class="si">%s</span><span class="s2">': </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Fetching metadata..."</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RepoError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Error fetching metadata for </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># Enable repos listed on the cmdline</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">enablerepos</span><span class="p">:</span>
|
||||
<span class="n">repolist</span> <span class="o">=</span> <span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">get_matching</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repolist</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is an unknown repo, not enabling it"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">repolist</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Enabled repo </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Disable repos listed on the cmdline</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">disablerepos</span><span class="p">:</span>
|
||||
<span class="n">repolist</span> <span class="o">=</span> <span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">get_matching</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repolist</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is an unknown repo, not disabling it"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">repolist</span><span class="o">.</span><span class="n">disable</span><span class="p">()</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Disabled repo </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">fill_sack</span><span class="p">(</span><span class="n">load_system_repo</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">read_comps</span><span class="p">()</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">dnfbase</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.dnfhelper — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.dnfhelper — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -277,7 +276,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -296,27 +295,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.executils — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.executils — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -184,6 +183,7 @@
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax"</span><span class="p">)</span>
|
||||
<span class="n">program_log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"program"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># pylint: disable=not-context-manager</span>
|
||||
<span class="kn">from</span> <span class="nn">threading</span> <span class="k">import</span> <span class="n">Lock</span>
|
||||
<span class="n">program_log_lock</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span>
|
||||
|
||||
@ -272,6 +272,7 @@
|
||||
<span class="k">if</span> <span class="n">env_add</span><span class="p">:</span>
|
||||
<span class="n">env</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">env_add</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># pylint: disable=subprocess-popen-preexec-fn</span>
|
||||
<span class="k">return</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span>
|
||||
<span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span>
|
||||
<span class="n">stdout</span><span class="o">=</span><span class="n">stdout</span><span class="p">,</span>
|
||||
@ -514,7 +515,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -533,27 +534,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.imgutils — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.imgutils — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -157,7 +156,7 @@
|
||||
<h1>Source code for pylorax.imgutils</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1"># imgutils.py - utility functions/classes for building disk images</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2011-2015 Red Hat, Inc.</span>
|
||||
<span class="c1"># Copyright (C) 2011-2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
@ -193,8 +192,8 @@
|
||||
|
||||
<span class="c1">######## Functions for making container images (cpio, tar, squashfs) ##########</span>
|
||||
|
||||
<div class="viewcode-block" id="compress"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.compress">[docs]</a><span class="k">def</span> <span class="nf">compress</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">'''Make a compressed archive of the given rootdir.</span>
|
||||
<div class="viewcode-block" id="compress"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.compress">[docs]</a><span class="k">def</span> <span class="nf">compress</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">root</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">'''Make a compressed archive of the given rootdir or file.</span>
|
||||
<span class="sd"> command is a list of the archiver commands to run</span>
|
||||
<span class="sd"> compression should be "xz", "gzip", "lzma", "bzip2", or None.</span>
|
||||
<span class="sd"> compressargs will be used on the compression commandline.'''</span>
|
||||
@ -217,12 +216,23 @@
|
||||
<span class="n">compression</span> <span class="o">=</span> <span class="s2">"pbzip2"</span>
|
||||
<span class="n">compressargs</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s2">"-p</span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span> <span class="n">multiprocessing</span><span class="o">.</span><span class="n">cpu_count</span><span class="p">())</span>
|
||||
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"find </span><span class="si">%s</span><span class="s2"> -print0 |</span><span class="si">%s</span><span class="s2"> | </span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2"> > </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">rootdir</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">command</span><span class="p">),</span>
|
||||
<span class="n">compression</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">compressargs</span><span class="p">),</span> <span class="n">outfile</span><span class="p">)</span>
|
||||
<span class="n">find</span><span class="p">,</span> <span class="n">archive</span><span class="p">,</span> <span class="n">comp</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">find</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">([</span><span class="s2">"find"</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="s2">"-print0"</span><span class="p">],</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">rootdir</span><span class="p">)</span>
|
||||
<span class="n">archive</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">find</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">rootdir</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">root</span><span class="p">):</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"find </span><span class="si">%s</span><span class="s2"> -print0 |</span><span class="si">%s</span><span class="s2"> | </span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2"> > </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">root</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">command</span><span class="p">),</span>
|
||||
<span class="n">compression</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">compressargs</span><span class="p">),</span> <span class="n">outfile</span><span class="p">)</span>
|
||||
|
||||
<span class="n">find</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">([</span><span class="s2">"find"</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="s2">"-print0"</span><span class="p">],</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">root</span><span class="p">)</span>
|
||||
<span class="n">archive</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">find</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">root</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"echo </span><span class="si">%s</span><span class="s2"> |</span><span class="si">%s</span><span class="s2"> | </span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2"> > </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">root</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">command</span><span class="p">),</span>
|
||||
<span class="n">compression</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">compressargs</span><span class="p">),</span> <span class="n">outfile</span><span class="p">)</span>
|
||||
|
||||
<span class="n">archive</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">root</span><span class="p">))</span>
|
||||
<span class="n">archive</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">root</span><span class="p">)</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="o">+</span> <span class="sa">b</span><span class="s2">"</span><span class="se">\0</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="n">archive</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
||||
|
||||
<span class="n">comp</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">([</span><span class="n">compression</span><span class="p">]</span> <span class="o">+</span> <span class="n">compressargs</span><span class="p">,</span>
|
||||
<span class="n">stdin</span><span class="o">=</span><span class="n">archive</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="nb">open</span><span class="p">(</span><span class="n">outfile</span><span class="p">,</span> <span class="s2">"wb"</span><span class="p">))</span>
|
||||
<span class="n">comp</span><span class="o">.</span><span class="n">wait</span><span class="p">()</span>
|
||||
@ -233,18 +243,18 @@
|
||||
<span class="nb">list</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">kill</span><span class="p">()</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">(</span><span class="n">find</span><span class="p">,</span> <span class="n">archive</span><span class="p">,</span> <span class="n">comp</span><span class="p">)</span> <span class="k">if</span> <span class="n">p</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="mi">1</span></div>
|
||||
|
||||
<div class="viewcode-block" id="mkcpio"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mkcpio">[docs]</a><span class="k">def</span> <span class="nf">mkcpio</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="mkcpio"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mkcpio">[docs]</a><span class="k">def</span> <span class="nf">mkcpio</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">compressargs</span> <span class="o">=</span> <span class="n">compressargs</span> <span class="ow">or</span> <span class="p">[</span><span class="s2">"-9"</span><span class="p">]</span>
|
||||
<span class="k">return</span> <span class="n">compress</span><span class="p">([</span><span class="s2">"cpio"</span><span class="p">,</span> <span class="s2">"--null"</span><span class="p">,</span> <span class="s2">"--quiet"</span><span class="p">,</span> <span class="s2">"-H"</span><span class="p">,</span> <span class="s2">"newc"</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">],</span>
|
||||
<span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span></div>
|
||||
<span class="n">root</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="mktar"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mktar">[docs]</a><span class="k">def</span> <span class="nf">mktar</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="mktar"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mktar">[docs]</a><span class="k">def</span> <span class="nf">mktar</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||||
<span class="n">compressargs</span> <span class="o">=</span> <span class="n">compressargs</span> <span class="ow">or</span> <span class="p">[</span><span class="s2">"-9"</span><span class="p">]</span>
|
||||
<span class="n">tar_cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"tar"</span><span class="p">,</span> <span class="s2">"--no-recursion"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">selinux</span><span class="p">:</span>
|
||||
<span class="n">tar_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"--selinux"</span><span class="p">,</span> <span class="s2">"--acls"</span><span class="p">,</span> <span class="s2">"--xattrs"</span><span class="p">]</span>
|
||||
<span class="n">tar_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-cf-"</span><span class="p">,</span> <span class="s2">"--null"</span><span class="p">,</span> <span class="s2">"-T-"</span><span class="p">]</span>
|
||||
<span class="k">return</span> <span class="n">compress</span><span class="p">(</span><span class="n">tar_cmd</span><span class="p">,</span> <span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">compress</span><span class="p">(</span><span class="n">tar_cmd</span><span class="p">,</span> <span class="n">root</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="mksquashfs"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mksquashfs">[docs]</a><span class="k">def</span> <span class="nf">mksquashfs</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">'''Make a squashfs image containing the given rootdir.'''</span>
|
||||
@ -268,20 +278,7 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">fssize</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># Let mkext4img figure out the needed size</span>
|
||||
|
||||
<span class="n">mkext4img</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">fssize</span><span class="p">)</span>
|
||||
<span class="c1"># Reset selinux context on new rootfs</span>
|
||||
<span class="k">with</span> <span class="n">LoopDev</span><span class="p">(</span><span class="n">outfile</span><span class="p">)</span> <span class="k">as</span> <span class="n">loopdev</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">Mount</span><span class="p">(</span><span class="n">loopdev</span><span class="p">)</span> <span class="k">as</span> <span class="n">mnt</span><span class="p">:</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"setfiles"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/proc"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/sys"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/dev"</span><span class="p">,</span>
|
||||
<span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/install"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/ostree"</span><span class="p">,</span>
|
||||
<span class="s2">"/etc/selinux/targeted/contexts/files/file_contexts"</span><span class="p">,</span> <span class="s2">"/"</span><span class="p">]</span>
|
||||
<span class="n">root</span> <span class="o">=</span> <span class="n">join</span><span class="p">(</span><span class="n">mnt</span><span class="p">,</span> <span class="n">sysroot</span><span class="o">.</span><span class="n">lstrip</span><span class="p">(</span><span class="s2">"/"</span><span class="p">))</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">runcmd</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"setfiles exited with a non-zero return code (</span><span class="si">%d</span><span class="s2">) which may "</span>
|
||||
<span class="s2">"be caused by running without SELinux in Permissive mode."</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">returncode</span><span class="p">)</span>
|
||||
<span class="k">raise</span></div>
|
||||
<span class="n">mkext4img</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">fssize</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<span class="c1">######## Utility functions ###############################################</span>
|
||||
@ -353,10 +350,7 @@
|
||||
|
||||
<span class="c1"># Sometimes the loop device isn't ready yet, make extra sure before returning</span>
|
||||
<span class="n">loop_waitfor</span><span class="p">(</span><span class="n">dev</span><span class="p">,</span> <span class="n">outfile</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">CalledProcessError</span><span class="p">:</span>
|
||||
<span class="c1"># Problems running losetup are always errors, raise immediately</span>
|
||||
<span class="k">raise</span>
|
||||
<span class="k">except</span> <span class="ne">RuntimeError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">:</span>
|
||||
<span class="c1"># Try to setup the loop device 3 times</span>
|
||||
<span class="k">if</span> <span class="n">retries</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"loop_attach failed, retries exhausted."</span><span class="p">)</span>
|
||||
@ -444,7 +438,7 @@
|
||||
<span class="sd"> If preserve is False, uses cp -R (useful for modeless filesystems)</span>
|
||||
<span class="sd"> raises CalledProcessError if copy fails.'''</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"copytree </span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">src</span><span class="p">,</span> <span class="n">dest</span><span class="p">)</span>
|
||||
<span class="n">cp</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"cp"</span><span class="p">,</span> <span class="s2">"-a"</span><span class="p">]</span> <span class="k">if</span> <span class="n">preserve</span> <span class="k">else</span> <span class="p">[</span><span class="s2">"cp"</span><span class="p">,</span> <span class="s2">"-R"</span><span class="p">,</span> <span class="s2">"-L"</span><span class="p">]</span>
|
||||
<span class="n">cp</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"cp"</span><span class="p">,</span> <span class="s2">"-a"</span><span class="p">]</span> <span class="k">if</span> <span class="n">preserve</span> <span class="k">else</span> <span class="p">[</span><span class="s2">"cp"</span><span class="p">,</span> <span class="s2">"-R"</span><span class="p">,</span> <span class="s2">"-L"</span><span class="p">,</span> <span class="s2">"--preserve=timestamps"</span><span class="p">]</span>
|
||||
<span class="n">cp</span> <span class="o">+=</span> <span class="p">[</span><span class="n">join</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="s2">"."</span><span class="p">),</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">dest</span><span class="p">)]</span>
|
||||
<span class="n">runcmd</span><span class="p">(</span><span class="n">cp</span><span class="p">)</span></div>
|
||||
|
||||
@ -529,6 +523,31 @@
|
||||
<span class="k">def</span> <span class="nf">__exit__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exc_type</span><span class="p">,</span> <span class="n">exc_value</span><span class="p">,</span> <span class="n">tracebk</span><span class="p">):</span>
|
||||
<span class="n">umount</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mnt</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="kpartx_disk_img"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.kpartx_disk_img">[docs]</a><span class="k">def</span> <span class="nf">kpartx_disk_img</span><span class="p">(</span><span class="n">disk_img</span><span class="p">):</span>
|
||||
<span class="sd">"""Attach a disk image's partitions to /dev/loopX using kpartx</span>
|
||||
|
||||
<span class="sd"> :param disk_img: The full path to a partitioned disk image</span>
|
||||
<span class="sd"> :type disk_img: str</span>
|
||||
<span class="sd"> :returns: list of (loopXpN, size)</span>
|
||||
<span class="sd"> :rtype: list of tuples</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># Example kpartx output</span>
|
||||
<span class="c1"># kpartx -p p -v -a /tmp/diskV2DiCW.im</span>
|
||||
<span class="c1"># add map loop2p1 (253:2): 0 3481600 linear /dev/loop2 2048</span>
|
||||
<span class="c1"># add map loop2p2 (253:3): 0 614400 linear /dev/loop2 3483648</span>
|
||||
<span class="n">kpartx_output</span> <span class="o">=</span> <span class="n">runcmd_output</span><span class="p">([</span><span class="s2">"kpartx"</span><span class="p">,</span> <span class="s2">"-v"</span><span class="p">,</span> <span class="s2">"-a"</span><span class="p">,</span> <span class="s2">"-s"</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">])</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">kpartx_output</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># list of (deviceName, sizeInBytes)</span>
|
||||
<span class="n">loop_devices</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">kpartx_output</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
|
||||
<span class="c1"># add map loop2p3 (253:4): 0 7139328 linear /dev/loop2 528384</span>
|
||||
<span class="c1"># 3rd element is size in 512 byte blocks</span>
|
||||
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"add map "</span><span class="p">):</span>
|
||||
<span class="n">fields</span> <span class="o">=</span> <span class="n">line</span><span class="p">[</span><span class="mi">8</span><span class="p">:]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
|
||||
<span class="n">loop_devices</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> <span class="p">(</span><span class="n">fields</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">int</span><span class="p">(</span><span class="n">fields</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span><span class="o">*</span><span class="mi">512</span><span class="p">)</span> <span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">loop_devices</span></div>
|
||||
|
||||
<div class="viewcode-block" id="PartitionMount"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.PartitionMount">[docs]</a><span class="k">class</span> <span class="nc">PartitionMount</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">""" Mount a partitioned image file using kpartx """</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">mount_ok</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">submount</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
@ -560,21 +579,8 @@
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">mount_ok</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mount_ok</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">mount_dir</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">mount_dir</span><span class="o">+</span><span class="s2">"/etc/passwd"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Example kpartx output</span>
|
||||
<span class="c1"># kpartx -p p -v -a /tmp/diskV2DiCW.im</span>
|
||||
<span class="c1"># add map loop2p1 (253:2): 0 3481600 linear /dev/loop2 2048</span>
|
||||
<span class="c1"># add map loop2p2 (253:3): 0 614400 linear /dev/loop2 3483648</span>
|
||||
<span class="n">kpartx_output</span> <span class="o">=</span> <span class="n">runcmd_output</span><span class="p">([</span><span class="s2">"kpartx"</span><span class="p">,</span> <span class="s2">"-v"</span><span class="p">,</span> <span class="s2">"-a"</span><span class="p">,</span> <span class="s2">"-s"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">disk_img</span><span class="p">])</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">kpartx_output</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># list of (deviceName, sizeInBytes)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">loop_devices</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">kpartx_output</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
|
||||
<span class="c1"># add map loop2p3 (253:4): 0 7139328 linear /dev/loop2 528384</span>
|
||||
<span class="c1"># 3rd element is size in 512 byte blocks</span>
|
||||
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"add map "</span><span class="p">):</span>
|
||||
<span class="n">fields</span> <span class="o">=</span> <span class="n">line</span><span class="p">[</span><span class="mi">8</span><span class="p">:]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">loop_devices</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> <span class="p">(</span><span class="n">fields</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">int</span><span class="p">(</span><span class="n">fields</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span><span class="o">*</span><span class="mi">512</span><span class="p">)</span> <span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">loop_devices</span> <span class="o">=</span> <span class="n">kpartx_disk_img</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">disk_img</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__enter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="c1"># Mount the device selected by mount_ok, if possible</span>
|
||||
@ -618,7 +624,7 @@
|
||||
<span class="sd">'''Generic filesystem image creation function.</span>
|
||||
<span class="sd"> fstype should be a filesystem type - "mkfs.${fstype}" must exist.</span>
|
||||
<span class="sd"> graft should be a dict: {"some/path/in/image": "local/file/or/dir"};</span>
|
||||
<span class="sd"> if the path ends with a '/' it's assumed to be a directory.</span>
|
||||
<span class="sd"> if the path ends with a '/' it's assumed to be a directory.</span>
|
||||
<span class="sd"> Will raise CalledProcessError if something goes wrong.'''</span>
|
||||
<span class="n">mkfsargs</span> <span class="o">=</span> <span class="n">mkfsargs</span> <span class="ow">or</span> <span class="p">[]</span>
|
||||
<span class="n">graft</span> <span class="o">=</span> <span class="n">graft</span> <span class="ow">or</span> <span class="p">{}</span>
|
||||
@ -638,14 +644,21 @@
|
||||
<span class="n">copytree</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">mnt</span><span class="p">,</span> <span class="n">preserve</span><span class="p">)</span>
|
||||
<span class="n">do_grafts</span><span class="p">(</span><span class="n">graft</span><span class="p">,</span> <span class="n">mnt</span><span class="p">,</span> <span class="n">preserve</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Save information about filesystem usage</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"df"</span><span class="p">,</span> <span class="p">[</span><span class="n">mnt</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># Make absolutely sure that the data has been written</span>
|
||||
<span class="n">runcmd</span><span class="p">([</span><span class="s2">"sync"</span><span class="p">])</span></div>
|
||||
|
||||
<span class="c1"># convenience functions with useful defaults</span>
|
||||
<div class="viewcode-block" id="mkdosimg"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mkdosimg">[docs]</a><span class="k">def</span> <span class="nf">mkdosimg</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="n">mountargs</span><span class="o">=</span><span class="s2">"shortname=winnt,umask=0077"</span><span class="p">,</span> <span class="n">graft</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">graft</span> <span class="o">=</span> <span class="n">graft</span> <span class="ow">or</span> <span class="p">{}</span>
|
||||
<span class="n">mkfsargs</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"-n"</span><span class="p">,</span> <span class="n">label</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="s1">'SOURCE_DATE_EPOCH'</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span>
|
||||
<span class="n">mkfsargs</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="s2">"-i"</span><span class="p">,</span>
|
||||
<span class="s2">"</span><span class="si">{:x}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'SOURCE_DATE_EPOCH'</span><span class="p">]))])</span>
|
||||
<span class="n">mkfsimage</span><span class="p">(</span><span class="s2">"msdos"</span><span class="p">,</span> <span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">size</span><span class="p">,</span> <span class="n">mountargs</span><span class="o">=</span><span class="n">mountargs</span><span class="p">,</span>
|
||||
<span class="n">mkfsargs</span><span class="o">=</span><span class="p">[</span><span class="s2">"-n"</span><span class="p">,</span> <span class="n">label</span><span class="p">],</span> <span class="n">graft</span><span class="o">=</span><span class="n">graft</span><span class="p">)</span></div>
|
||||
<span class="n">mkfsargs</span><span class="o">=</span><span class="n">mkfsargs</span><span class="p">,</span> <span class="n">graft</span><span class="o">=</span><span class="n">graft</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="mkext4img"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mkext4img">[docs]</a><span class="k">def</span> <span class="nf">mkext4img</span><span class="p">(</span><span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="n">mountargs</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="n">graft</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">graft</span> <span class="o">=</span> <span class="n">graft</span> <span class="ow">or</span> <span class="p">{}</span>
|
||||
@ -707,7 +720,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -726,27 +739,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.installer — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.installer — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -303,7 +302,7 @@
|
||||
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">opts</span><span class="p">,</span> <span class="n">iso</span><span class="p">,</span> <span class="n">ks_paths</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">img_size</span><span class="o">=</span><span class="mi">2048</span><span class="p">,</span>
|
||||
<span class="n">kernel_args</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">memory</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span> <span class="n">vcpus</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">vnc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">log_check</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">virtio_host</span><span class="o">=</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> <span class="n">virtio_port</span><span class="o">=</span><span class="mi">6080</span><span class="p">,</span>
|
||||
<span class="n">cancel_func</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">virtio_host</span><span class="o">=</span><span class="s2">"127.0.0.1"</span><span class="p">,</span> <span class="n">virtio_port</span><span class="o">=</span><span class="mi">6080</span><span class="p">,</span>
|
||||
<span class="n">image_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">boot_uefi</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">ovmf_path</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Start the installation</span>
|
||||
@ -319,8 +318,8 @@
|
||||
<span class="sd"> :param int vcpus: Number of virtual cpus</span>
|
||||
<span class="sd"> :param str vnc: Arguments to pass to qemu -display</span>
|
||||
<span class="sd"> :param str arch: Optional architecture to use in the virt</span>
|
||||
<span class="sd"> :param log_check: Method that returns True if the installation fails</span>
|
||||
<span class="sd"> :type log_check: method</span>
|
||||
<span class="sd"> :param cancel_func: Function that returns True if the installation fails</span>
|
||||
<span class="sd"> :type cancel_func: function</span>
|
||||
<span class="sd"> :param str virtio_host: Hostname to connect virtio log to</span>
|
||||
<span class="sd"> :param int virtio_port: Port to connect virtio log to</span>
|
||||
<span class="sd"> :param str image_type: Type of qemu-img disk to create, or None.</span>
|
||||
@ -332,13 +331,17 @@
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">"/usr/bin/"</span><span class="o">+</span><span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">]):</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> does not exist, cannot run qemu"</span> <span class="o">%</span> <span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-nodefconfig"</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-no-user-config"</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-m"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">memory</span><span class="p">)]</span>
|
||||
<span class="k">if</span> <span class="n">vcpus</span><span class="p">:</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-smp"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">vcpus</span><span class="p">)]</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_kvm</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">"/dev/kvm"</span><span class="p">):</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"--machine"</span><span class="p">,</span> <span class="s2">"accel=kvm"</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-machine"</span><span class="p">,</span> <span class="s2">"accel=kvm"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">boot_uefi</span><span class="p">:</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-machine"</span><span class="p">,</span> <span class="s2">"q35,smm=on"</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-global"</span><span class="p">,</span> <span class="s2">"driver=cfi.pflash01,property=secure,value=on"</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># Copy the initrd from the iso, create a cpio archive of the kickstart files</span>
|
||||
<span class="c1"># and append it to the temporary initrd.</span>
|
||||
@ -380,7 +383,7 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">display_args</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">vnc</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"qemu </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">display_args</span><span class="p">)</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-nographic"</span><span class="p">,</span> <span class="s2">"-display"</span><span class="p">,</span> <span class="n">display_args</span> <span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-nographic"</span><span class="p">,</span> <span class="s2">"-monitor"</span><span class="p">,</span> <span class="s2">"none"</span><span class="p">,</span> <span class="s2">"-serial"</span><span class="p">,</span> <span class="s2">"null"</span><span class="p">,</span> <span class="s2">"-display"</span><span class="p">,</span> <span class="n">display_args</span> <span class="p">]</span>
|
||||
|
||||
<span class="c1"># Setup the virtio log port</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-device"</span><span class="p">,</span> <span class="s2">"virtio-serial-pci,id=virtio-serial0"</span><span class="p">]</span>
|
||||
@ -388,17 +391,20 @@
|
||||
<span class="s2">",id=channel0,name=org.fedoraproject.anaconda.log.0"</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-chardev"</span><span class="p">,</span> <span class="s2">"socket,id=charchannel0,host=</span><span class="si">%s</span><span class="s2">,port=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">virtio_host</span><span class="p">,</span> <span class="n">virtio_port</span><span class="p">)]</span>
|
||||
|
||||
<span class="c1"># PAss through rng from host</span>
|
||||
<span class="c1"># Pass through rng from host</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">with_rng</span> <span class="o">!=</span> <span class="s2">"none"</span><span class="p">:</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-object"</span><span class="p">,</span> <span class="s2">"rng-random,id=virtio-rng0,filename=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">opts</span><span class="o">.</span><span class="n">with_rng</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-device"</span><span class="p">,</span> <span class="s2">"virtio-rng-pci,rng=virtio-rng0,id=rng0,bus=pci.0,addr=0x9"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">boot_uefi</span><span class="p">:</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-device"</span><span class="p">,</span> <span class="s2">"virtio-rng-pci,rng=virtio-rng0,id=rng0,bus=pcie.0,addr=0x9"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-device"</span><span class="p">,</span> <span class="s2">"virtio-rng-pci,rng=virtio-rng0,id=rng0,bus=pci.0,addr=0x9"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">boot_uefi</span> <span class="ow">and</span> <span class="n">ovmf_path</span><span class="p">:</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-drive"</span><span class="p">,</span> <span class="s2">"file=</span><span class="si">%s</span><span class="s2">/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on"</span> <span class="o">%</span> <span class="n">ovmf_path</span><span class="p">]</span>
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-drive"</span><span class="p">,</span> <span class="s2">"file=</span><span class="si">%s</span><span class="s2">/OVMF_CODE.secboot.fd,if=pflash,format=raw,unit=0,readonly=on"</span> <span class="o">%</span> <span class="n">ovmf_path</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># Make a copy of the OVMF_VARS.fd for this run</span>
|
||||
<span class="c1"># Make a copy of the OVMF_VARS.secboot.fd for this run</span>
|
||||
<span class="n">ovmf_vars</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">"lmc-OVMF_VARS-"</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">".fd"</span><span class="p">)</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">ovmf_path</span><span class="p">,</span> <span class="s2">"/OVMF_VARS.fd"</span><span class="p">),</span> <span class="n">ovmf_vars</span><span class="p">)</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">ovmf_path</span><span class="p">,</span> <span class="s2">"/OVMF_VARS.secboot.fd"</span><span class="p">),</span> <span class="n">ovmf_vars</span><span class="p">)</span>
|
||||
|
||||
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"-drive"</span><span class="p">,</span> <span class="s2">"file=</span><span class="si">%s</span><span class="s2">,if=pflash,format=raw,unit=1"</span> <span class="o">%</span> <span class="n">ovmf_vars</span><span class="p">]</span>
|
||||
|
||||
@ -406,7 +412,7 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">qemu_cmd</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">1</span><span class="p">:],</span> <span class="n">reset_lang</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="ow">not</span> <span class="n">log_check</span><span class="p">())</span>
|
||||
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="ow">not</span> <span class="p">(</span><span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">()))</span>
|
||||
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Running qemu failed:"</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"cmd: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">cmd</span><span class="p">))</span>
|
||||
@ -420,27 +426,30 @@
|
||||
<span class="k">if</span> <span class="n">boot_uefi</span> <span class="ow">and</span> <span class="n">ovmf_path</span><span class="p">:</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">ovmf_vars</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">log_check</span><span class="p">():</span>
|
||||
<span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">():</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Installation error detected. See logfile for details."</span><span class="p">)</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"QEMUInstall failed"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Installation finished without errors."</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="novirt_log_check"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.novirt_log_check">[docs]</a><span class="k">def</span> <span class="nf">novirt_log_check</span><span class="p">(</span><span class="n">log_check</span><span class="p">,</span> <span class="n">proc</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="novirt_cancel_check"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.novirt_cancel_check">[docs]</a><span class="k">def</span> <span class="nf">novirt_cancel_check</span><span class="p">(</span><span class="n">cancel_funcs</span><span class="p">,</span> <span class="n">proc</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Check to see if there has been an error in the logs</span>
|
||||
|
||||
<span class="sd"> :param log_check: method to call to check for an error in the logs</span>
|
||||
<span class="sd"> :param cancel_funcs: list of functions to call, True from any one cancels the build</span>
|
||||
<span class="sd"> :type cancel_funcs: list</span>
|
||||
<span class="sd"> :param proc: Popen object for the anaconda process</span>
|
||||
<span class="sd"> :type proc: subprocess.Popen</span>
|
||||
<span class="sd"> :returns: True if the process has been terminated</span>
|
||||
|
||||
<span class="sd"> The log_check method should return a True if an error has been detected.</span>
|
||||
<span class="sd"> The cancel_funcs functions should return a True if an error has been detected.</span>
|
||||
<span class="sd"> When an error is detected the process is terminated and this returns True</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">log_check</span><span class="p">():</span>
|
||||
<span class="n">proc</span><span class="o">.</span><span class="n">terminate</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">cancel_funcs</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">f</span><span class="p">():</span>
|
||||
<span class="n">proc</span><span class="o">.</span><span class="n">terminate</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">return</span> <span class="kc">False</span></div>
|
||||
|
||||
|
||||
@ -471,7 +480,7 @@
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="novirt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.novirt_install">[docs]</a><span class="k">def</span> <span class="nf">novirt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="novirt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.novirt_install">[docs]</a><span class="k">def</span> <span class="nf">novirt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tar_img</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Use Anaconda to install to a disk image</span>
|
||||
|
||||
@ -479,6 +488,9 @@
|
||||
<span class="sd"> :type opts: argparse options</span>
|
||||
<span class="sd"> :param str disk_img: The full path to the disk image to be created</span>
|
||||
<span class="sd"> :param int disk_size: The size of the disk_img in MiB</span>
|
||||
<span class="sd"> :param cancel_func: Function that returns True to cancel build</span>
|
||||
<span class="sd"> :type cancel_func: function</span>
|
||||
<span class="sd"> :param str tar_img: For make_tar_disk, the path to final tarball to be created</span>
|
||||
|
||||
<span class="sd"> This method runs anaconda to create the image and then based on the opts</span>
|
||||
<span class="sd"> passed creates a qemu disk image or tarfile.</span>
|
||||
@ -528,6 +540,9 @@
|
||||
|
||||
<span class="n">log_monitor</span> <span class="o">=</span> <span class="n">LogMonitor</span><span class="p">(</span><span class="n">timeout</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">timeout</span><span class="p">)</span>
|
||||
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">"--remotelog"</span><span class="p">,</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">log_monitor</span><span class="o">.</span><span class="n">host</span><span class="p">,</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">port</span><span class="p">)]</span>
|
||||
<span class="n">cancel_funcs</span> <span class="o">=</span> <span class="p">[</span><span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">cancel_funcs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cancel_func</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Make sure anaconda has the right product and release</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Running anaconda."</span><span class="p">)</span>
|
||||
@ -535,23 +550,30 @@
|
||||
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">execReadlines</span><span class="p">(</span><span class="s2">"anaconda"</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
|
||||
<span class="n">env_add</span><span class="o">=</span><span class="p">{</span><span class="s2">"ANACONDA_PRODUCTNAME"</span><span class="p">:</span> <span class="n">opts</span><span class="o">.</span><span class="n">project</span><span class="p">,</span>
|
||||
<span class="s2">"ANACONDA_PRODUCTVERSION"</span><span class="p">:</span> <span class="n">opts</span><span class="o">.</span><span class="n">releasever</span><span class="p">},</span>
|
||||
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="ow">not</span> <span class="n">novirt_log_check</span><span class="p">(</span><span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">,</span> <span class="n">p</span><span class="p">)):</span>
|
||||
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="ow">not</span> <span class="n">novirt_cancel_check</span><span class="p">(</span><span class="n">cancel_funcs</span><span class="p">,</span> <span class="n">p</span><span class="p">)):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Make sure the new filesystem is correctly labeled</span>
|
||||
<span class="n">setfiles_args</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/proc"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/sys"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/dev"</span><span class="p">,</span>
|
||||
<span class="n">setfiles_args</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/proc"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/sys"</span><span class="p">,</span>
|
||||
<span class="s2">"/etc/selinux/targeted/contexts/files/file_contexts"</span><span class="p">,</span> <span class="s2">"/"</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># setfiles may not be available, warn instead of fail</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="s2">"--dirinstall"</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="s2">"--dirinstall"</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
|
||||
<span class="c1"># setfiles may not be available, warn instead of fail</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"setfiles"</span><span class="p">,</span> <span class="n">setfiles_args</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">dirinstall_path</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"setfiles"</span><span class="p">,</span> <span class="n">setfiles_args</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># For image installs, run fstrim to discard unused blocks. This way</span>
|
||||
<span class="c1"># unused blocks do not need to be allocated for sparse image types</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"fstrim"</span><span class="p">,</span> <span class="p">[</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">])</span>
|
||||
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Running anaconda failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
@ -574,10 +596,14 @@
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_iso</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span><span class="p">:</span>
|
||||
<span class="n">dm_name</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">disk_img</span><span class="p">))[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="n">dm_path</span> <span class="o">=</span> <span class="s2">"/dev/mapper/"</span><span class="o">+</span><span class="n">dm_name</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">dm_path</span><span class="p">):</span>
|
||||
<span class="n">dm_detach</span><span class="p">(</span><span class="n">dm_path</span><span class="p">)</span>
|
||||
<span class="n">loop_detach</span><span class="p">(</span><span class="n">get_loop_name</span><span class="p">(</span><span class="n">disk_img</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Remove device-mapper for partitions and disk</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Removing device-mapper setup on </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">dm_name</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s2">"/dev/mapper/"</span><span class="o">+</span><span class="n">dm_name</span><span class="o">+</span><span class="s2">"*"</span><span class="p">),</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||||
<span class="n">dm_detach</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
|
||||
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Removing loop device for </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
|
||||
<span class="n">loop_detach</span><span class="p">(</span><span class="s2">"/dev/"</span><span class="o">+</span><span class="n">get_loop_name</span><span class="p">(</span><span class="n">disk_img</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># qemu disk image is used by bare qcow2 images and by Vagrant</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">:</span>
|
||||
@ -637,10 +663,25 @@
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">ROOT_PATH</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span></div>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># For raw disk images, use fallocate to deallocate unused space</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"fallocate"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"--dig-holes"</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">],</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># For make_tar_disk, wrap the result in a tar file, and remove the original disk image.</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar_disk</span><span class="p">:</span>
|
||||
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
|
||||
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" "</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="virt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.virt_install">[docs]</a><span class="k">def</span> <span class="nf">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">):</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">tar_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span>
|
||||
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="virt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.virt_install">[docs]</a><span class="k">def</span> <span class="nf">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tar_img</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Use qemu to install to a disk image</span>
|
||||
|
||||
@ -649,6 +690,9 @@
|
||||
<span class="sd"> :param str install_log: The path to write the log from qemu</span>
|
||||
<span class="sd"> :param str disk_img: The full path to the disk image to be created</span>
|
||||
<span class="sd"> :param int disk_size: The size of the disk_img in MiB</span>
|
||||
<span class="sd"> :param cancel_func: Function that returns True to cancel build</span>
|
||||
<span class="sd"> :type cancel_func: function</span>
|
||||
<span class="sd"> :param str tar_img: For make_tar_disk, the path to final tarball to be created</span>
|
||||
|
||||
<span class="sd"> This uses qemu with a boot.iso and a kickstart to create a disk</span>
|
||||
<span class="sd"> image and then optionally, based on the opts passed, creates tarfile.</span>
|
||||
@ -659,6 +703,9 @@
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"ISO is missing stage2, cannot continue"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">log_monitor</span> <span class="o">=</span> <span class="n">LogMonitor</span><span class="p">(</span><span class="n">install_log</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">timeout</span><span class="p">)</span>
|
||||
<span class="n">cancel_funcs</span> <span class="o">=</span> <span class="p">[</span><span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">cancel_funcs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cancel_func</span><span class="p">)</span>
|
||||
|
||||
<span class="n">kernel_args</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">kernel_args</span><span class="p">:</span>
|
||||
@ -683,7 +730,7 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">QEMUInstall</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">iso_mount</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">,</span> <span class="n">diskimg_path</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span>
|
||||
<span class="n">kernel_args</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ram</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">vcpus</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">vnc</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
|
||||
<span class="n">log_check</span> <span class="o">=</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">,</span>
|
||||
<span class="n">cancel_func</span> <span class="o">=</span> <span class="k">lambda</span> <span class="p">:</span> <span class="nb">any</span><span class="p">(</span><span class="n">f</span><span class="p">()</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">cancel_funcs</span><span class="p">),</span>
|
||||
<span class="n">virtio_host</span> <span class="o">=</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">host</span><span class="p">,</span>
|
||||
<span class="n">virtio_port</span> <span class="o">=</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">port</span><span class="p">,</span>
|
||||
<span class="n">image_type</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">,</span> <span class="n">boot_uefi</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">virt_uefi</span><span class="p">,</span>
|
||||
@ -702,6 +749,8 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">msg</span> <span class="o">=</span> <span class="s2">"virt_install failed on line: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">error_line</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">():</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"virt_install canceled by cancel_func"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span><span class="p">:</span>
|
||||
<span class="n">mkfsimage_from_disk</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">fs_label</span><span class="p">)</span>
|
||||
@ -757,7 +806,20 @@
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"virt_install failed"</span><span class="p">)</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">)</span></div>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># For make_tar_disk, wrap the result in a tar file, and remove the original disk image.</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar_disk</span><span class="p">:</span>
|
||||
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
|
||||
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" "</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
|
||||
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">tar_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"virt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span>
|
||||
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -770,7 +832,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -789,27 +851,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.ltmpl — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.ltmpl — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -158,7 +157,7 @@
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># ltmpl.py</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2009-2015 Red Hat, Inc.</span>
|
||||
<span class="c1"># Copyright (C) 2009-2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
@ -224,10 +223,16 @@
|
||||
<span class="c1"># remove comments</span>
|
||||
<span class="n">lines</span> <span class="o">=</span> <span class="p">[</span><span class="n">line</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"#"</span><span class="p">)]</span>
|
||||
|
||||
<span class="c1"># split with shlex and perform brace expansion</span>
|
||||
<span class="n">lines</span> <span class="o">=</span> <span class="p">[</span><span class="n">split_and_expand</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">]</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">lines</span></div></div>
|
||||
<span class="c1"># split with shlex and perform brace expansion. This can fail, so we unroll the loop</span>
|
||||
<span class="c1"># for better error reporting.</span>
|
||||
<span class="n">expanded_lines</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
|
||||
<span class="n">expanded_lines</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">split_and_expand</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s1">'shlex error processing "</span><span class="si">%s</span><span class="s1">": </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">line</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">raise</span>
|
||||
<span class="k">return</span> <span class="n">expanded_lines</span></div></div>
|
||||
|
||||
<div class="viewcode-block" id="split_and_expand"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.split_and_expand">[docs]</a><span class="k">def</span> <span class="nf">split_and_expand</span><span class="p">(</span><span class="n">line</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="p">[</span><span class="n">exp</span> <span class="k">for</span> <span class="n">word</span> <span class="ow">in</span> <span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">for</span> <span class="n">exp</span> <span class="ow">in</span> <span class="n">brace_expand</span><span class="p">(</span><span class="n">word</span><span class="p">)]</span></div>
|
||||
@ -260,8 +265,83 @@
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">return</span> <span class="kc">False</span></div>
|
||||
|
||||
<div class="viewcode-block" id="TemplateRunner"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.TemplateRunner">[docs]</a><span class="k">class</span> <span class="nc">TemplateRunner</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> This class parses and executes Lorax templates. Sample usage:</span>
|
||||
|
||||
<span class="sd"> # install a bunch of packages</span>
|
||||
<span class="sd"> runner = LoraxTemplateRunner(inroot=rundir, outroot=rundir, dbo=dnf_obj)</span>
|
||||
<span class="sd"> runner.run("install-packages.ltmpl")</span>
|
||||
<span class="sd"> NOTES:</span>
|
||||
|
||||
<span class="sd"> * Parsing procedure is roughly:</span>
|
||||
<span class="sd"> 1. Mako template expansion (on the whole file)</span>
|
||||
<span class="sd"> 2. For each line of the result,</span>
|
||||
|
||||
<span class="sd"> a. Whitespace splitting (using shlex.split())</span>
|
||||
<span class="sd"> b. Brace expansion (using brace_expand())</span>
|
||||
<span class="sd"> c. If the first token is the name of a function, call that function</span>
|
||||
<span class="sd"> with the rest of the line as arguments</span>
|
||||
|
||||
<span class="sd"> * Parsing and execution are *separate* passes - so you can't use the result</span>
|
||||
<span class="sd"> of a command in an %if statement (or any other control statements)!</span>
|
||||
<span class="sd"> '''</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fatalerrors</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">builtins</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">fatalerrors</span> <span class="o">=</span> <span class="n">fatalerrors</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">templatedir</span> <span class="o">=</span> <span class="n">templatedir</span> <span class="ow">or</span> <span class="s2">"/usr/share/lorax"</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">builtins</span> <span class="o">=</span> <span class="n">builtins</span> <span class="ow">or</span> <span class="p">{}</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">defaults</span> <span class="o">=</span> <span class="n">defaults</span> <span class="ow">or</span> <span class="p">{}</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="TemplateRunner.run"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.TemplateRunner.run">[docs]</a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">templatefile</span><span class="p">,</span> <span class="o">**</span><span class="n">variables</span><span class="p">):</span>
|
||||
<span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">defaults</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">builtins</span><span class="o">.</span><span class="n">items</span><span class="p">()):</span>
|
||||
<span class="n">variables</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">k</span><span class="p">,</span><span class="n">v</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"executing </span><span class="si">%s</span><span class="s2"> with variables=</span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">templatefile</span><span class="p">,</span> <span class="n">variables</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span> <span class="o">=</span> <span class="n">templatefile</span>
|
||||
<span class="n">t</span> <span class="o">=</span> <span class="n">LoraxTemplate</span><span class="p">(</span><span class="n">directories</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">templatedir</span><span class="p">])</span>
|
||||
<span class="n">commands</span> <span class="o">=</span> <span class="n">t</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">templatefile</span><span class="p">,</span> <span class="n">variables</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_run</span><span class="p">(</span><span class="n">commands</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">_run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parsed_template</span><span class="p">):</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"running </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">line</span><span class="p">)</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">parsed_template</span><span class="p">,</span><span class="mi">1</span><span class="p">):</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"template line </span><span class="si">%i</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">num</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
|
||||
<span class="n">skiperror</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">args</span><span class="p">)</span> <span class="o">=</span> <span class="p">(</span><span class="n">line</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">line</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
|
||||
<span class="c1"># Following Makefile convention, if the command is prefixed with</span>
|
||||
<span class="c1"># a dash ('-'), we'll ignore any errors on that line.</span>
|
||||
<span class="k">if</span> <span class="n">cmd</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">'-'</span><span class="p">):</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="n">cmd</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||
<span class="n">skiperror</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c1"># grab the method named in cmd and pass it the given arguments</span>
|
||||
<span class="n">f</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'_'</span> <span class="ow">or</span> <span class="n">cmd</span> <span class="o">==</span> <span class="s1">'run'</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">Callable</span><span class="p">):</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"unknown command </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span> <span class="c1"># pylint: disable=broad-except</span>
|
||||
<span class="k">if</span> <span class="n">skiperror</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"ignoring error"</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"template command error in </span><span class="si">%s</span><span class="s2">:"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">" </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
|
||||
<span class="c1"># format the exception traceback</span>
|
||||
<span class="n">exclines</span> <span class="o">=</span> <span class="n">traceback</span><span class="o">.</span><span class="n">format_exception</span><span class="p">(</span><span class="o">*</span><span class="n">sys</span><span class="o">.</span><span class="n">exc_info</span><span class="p">())</span>
|
||||
<span class="c1"># skip the bit about "ltmpl.py, in _run()" - we know that</span>
|
||||
<span class="n">exclines</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="c1"># log the "ErrorType: this is what happened" line</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">" </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">exclines</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
|
||||
<span class="c1"># and log the entire traceback to the debug log</span>
|
||||
<span class="k">for</span> <span class="n">_line</span> <span class="ow">in</span> <span class="s1">''</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">exclines</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">" </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">_line</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fatalerrors</span><span class="p">:</span>
|
||||
<span class="k">raise</span></div>
|
||||
|
||||
|
||||
<span class="c1"># TODO: operate inside an actual chroot for safety? Not that RPM bothers..</span>
|
||||
<div class="viewcode-block" id="LoraxTemplateRunner"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LoraxTemplateRunner">[docs]</a><span class="k">class</span> <span class="nc">LoraxTemplateRunner</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="LoraxTemplateRunner"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LoraxTemplateRunner">[docs]</a><span class="k">class</span> <span class="nc">LoraxTemplateRunner</span><span class="p">(</span><span class="n">TemplateRunner</span><span class="p">):</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> This class parses and executes Lorax templates. Sample usage:</span>
|
||||
|
||||
@ -275,17 +355,6 @@
|
||||
|
||||
<span class="sd"> NOTES:</span>
|
||||
|
||||
<span class="sd"> * Parsing procedure is roughly:</span>
|
||||
<span class="sd"> 1. Mako template expansion (on the whole file)</span>
|
||||
<span class="sd"> 2. For each line of the result,</span>
|
||||
<span class="sd"> a. Whitespace splitting (using shlex.split())</span>
|
||||
<span class="sd"> b. Brace expansion (using brace_expand())</span>
|
||||
<span class="sd"> c. If the first token is the name of a function, call that function</span>
|
||||
<span class="sd"> with the rest of the line as arguments</span>
|
||||
|
||||
<span class="sd"> * Parsing and execution are *separate* passes - so you can't use the result</span>
|
||||
<span class="sd"> of a command in an %if statement (or any other control statements)!</span>
|
||||
|
||||
<span class="sd"> * Commands that run external programs (e.g. systemctl) currently use</span>
|
||||
<span class="sd"> the *host*'s copy of that program, which may cause problems if there's a</span>
|
||||
<span class="sd"> big enough difference between the host and the image you're modifying.</span>
|
||||
@ -308,14 +377,11 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">inroot</span> <span class="o">=</span> <span class="n">inroot</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">outroot</span> <span class="o">=</span> <span class="n">outroot</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">dbo</span> <span class="o">=</span> <span class="n">dbo</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">fatalerrors</span> <span class="o">=</span> <span class="n">fatalerrors</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">templatedir</span> <span class="o">=</span> <span class="n">templatedir</span> <span class="ow">or</span> <span class="s2">"/usr/share/lorax"</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="c1"># some builtin methods</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">builtins</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">exists</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">rexists</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">inroot</span><span class="p">),</span>
|
||||
<span class="n">glob</span><span class="o">=</span><span class="k">lambda</span> <span class="n">g</span><span class="p">:</span> <span class="nb">list</span><span class="p">(</span><span class="n">rglob</span><span class="p">(</span><span class="n">g</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">inroot</span><span class="p">)))</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">defaults</span> <span class="o">=</span> <span class="n">defaults</span> <span class="ow">or</span> <span class="p">{}</span>
|
||||
<span class="n">builtins</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">exists</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">rexists</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">inroot</span><span class="p">),</span>
|
||||
<span class="n">glob</span><span class="o">=</span><span class="k">lambda</span> <span class="n">g</span><span class="p">:</span> <span class="nb">list</span><span class="p">(</span><span class="n">rglob</span><span class="p">(</span><span class="n">g</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">inroot</span><span class="p">)))</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">results</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">treeinfo</span><span class="o">=</span><span class="nb">dict</span><span class="p">())</span> <span class="c1"># just treeinfo for now</span>
|
||||
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">LoraxTemplateRunner</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">fatalerrors</span><span class="p">,</span> <span class="n">templatedir</span><span class="p">,</span> <span class="n">defaults</span><span class="p">,</span> <span class="n">builtins</span><span class="p">)</span>
|
||||
<span class="c1"># TODO: set up custom logger with a filter to add line info</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">_out</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">path</span><span class="p">):</span>
|
||||
@ -366,52 +432,6 @@
|
||||
<span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">debug_pkgs</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">pkg</span><span class="p">)</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="LoraxTemplateRunner.run"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run">[docs]</a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">templatefile</span><span class="p">,</span> <span class="o">**</span><span class="n">variables</span><span class="p">):</span>
|
||||
<span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">defaults</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">builtins</span><span class="o">.</span><span class="n">items</span><span class="p">()):</span>
|
||||
<span class="n">variables</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">k</span><span class="p">,</span><span class="n">v</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"executing </span><span class="si">%s</span><span class="s2"> with variables=</span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">templatefile</span><span class="p">,</span> <span class="n">variables</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span> <span class="o">=</span> <span class="n">templatefile</span>
|
||||
<span class="n">t</span> <span class="o">=</span> <span class="n">LoraxTemplate</span><span class="p">(</span><span class="n">directories</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">templatedir</span><span class="p">])</span>
|
||||
<span class="n">commands</span> <span class="o">=</span> <span class="n">t</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">templatefile</span><span class="p">,</span> <span class="n">variables</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_run</span><span class="p">(</span><span class="n">commands</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">_run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parsed_template</span><span class="p">):</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"running </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">line</span><span class="p">)</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">parsed_template</span><span class="p">,</span><span class="mi">1</span><span class="p">):</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"template line </span><span class="si">%i</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">num</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
|
||||
<span class="n">skiperror</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">args</span><span class="p">)</span> <span class="o">=</span> <span class="p">(</span><span class="n">line</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">line</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
|
||||
<span class="c1"># Following Makefile convention, if the command is prefixed with</span>
|
||||
<span class="c1"># a dash ('-'), we'll ignore any errors on that line.</span>
|
||||
<span class="k">if</span> <span class="n">cmd</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">'-'</span><span class="p">):</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="n">cmd</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||
<span class="n">skiperror</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c1"># grab the method named in cmd and pass it the given arguments</span>
|
||||
<span class="n">f</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'_'</span> <span class="ow">or</span> <span class="n">cmd</span> <span class="o">==</span> <span class="s1">'run'</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">Callable</span><span class="p">):</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"unknown command </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span> <span class="c1"># pylint: disable=broad-except</span>
|
||||
<span class="k">if</span> <span class="n">skiperror</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"ignoring error"</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"template command error in </span><span class="si">%s</span><span class="s2">:"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">templatefile</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">" </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
|
||||
<span class="c1"># format the exception traceback</span>
|
||||
<span class="n">exclines</span> <span class="o">=</span> <span class="n">traceback</span><span class="o">.</span><span class="n">format_exception</span><span class="p">(</span><span class="o">*</span><span class="n">sys</span><span class="o">.</span><span class="n">exc_info</span><span class="p">())</span>
|
||||
<span class="c1"># skip the bit about "ltmpl.py, in _run()" - we know that</span>
|
||||
<span class="n">exclines</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="c1"># log the "ErrorType: this is what happened" line</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">exclines</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
|
||||
<span class="c1"># and log the entire traceback to the debug log</span>
|
||||
<span class="k">for</span> <span class="n">_line</span> <span class="ow">in</span> <span class="s1">''</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">exclines</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">_line</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fatalerrors</span><span class="p">:</span>
|
||||
<span class="k">raise</span>
|
||||
|
||||
<div class="viewcode-block" id="LoraxTemplateRunner.install"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install">[docs]</a> <span class="k">def</span> <span class="nf">install</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">srcglob</span><span class="p">,</span> <span class="n">dest</span><span class="p">):</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> install SRC DEST</span>
|
||||
@ -422,6 +442,7 @@
|
||||
<span class="sd"> If DEST doesn't exist, SRC will be copied to a file with that name,</span>
|
||||
<span class="sd"> assuming the rest of the path exists.</span>
|
||||
<span class="sd"> This is pretty much like how the 'cp' command works.</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
<span class="sd"> install usr/share/myconfig/grub.conf /boot</span>
|
||||
<span class="sd"> install /usr/share/myconfig/grub.conf.in /boot/grub.conf</span>
|
||||
@ -477,6 +498,7 @@
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> mkdir DIR [DIR ...]</span>
|
||||
<span class="sd"> Create the named DIR(s). Will create leading directories as needed.</span>
|
||||
|
||||
<span class="sd"> Example:</span>
|
||||
<span class="sd"> mkdir /images</span>
|
||||
<span class="sd"> '''</span>
|
||||
@ -490,6 +512,7 @@
|
||||
<span class="sd"> replace PATTERN REPLACEMENT FILEGLOB [FILEGLOB ...]</span>
|
||||
<span class="sd"> Find-and-replace the given PATTERN (Python-style regex) with the given</span>
|
||||
<span class="sd"> REPLACEMENT string for each of the files listed.</span>
|
||||
|
||||
<span class="sd"> Example:</span>
|
||||
<span class="sd"> replace @VERSION@ ${product.version} /boot/grub.conf /boot/isolinux.cfg</span>
|
||||
<span class="sd"> '''</span>
|
||||
@ -507,7 +530,9 @@
|
||||
<span class="sd"> Append STRING (followed by a newline character) to FILE.</span>
|
||||
<span class="sd"> Python character escape sequences ('\\n', '\\t', etc.) will be</span>
|
||||
<span class="sd"> converted to the appropriate characters.</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
|
||||
<span class="sd"> append /etc/depmod.d/dd.conf "search updates built-in"</span>
|
||||
<span class="sd"> append /etc/resolv.conf ""</span>
|
||||
<span class="sd"> '''</span>
|
||||
@ -520,6 +545,7 @@
|
||||
<span class="sd"> Add an item to the treeinfo data store.</span>
|
||||
<span class="sd"> The given SECTION will have a new item added where</span>
|
||||
<span class="sd"> KEY = ARG ARG ...</span>
|
||||
|
||||
<span class="sd"> Example:</span>
|
||||
<span class="sd"> treeinfo images-${kernel.arch} boot.iso images/boot.iso</span>
|
||||
<span class="sd"> '''</span>
|
||||
@ -620,6 +646,7 @@
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> log MESSAGE</span>
|
||||
<span class="sd"> Emit the given log message. Be sure to put it in quotes!</span>
|
||||
|
||||
<span class="sd"> Example:</span>
|
||||
<span class="sd"> log "Reticulating splines, please wait..."</span>
|
||||
<span class="sd"> '''</span>
|
||||
@ -643,7 +670,7 @@
|
||||
<span class="sd"> (this should be replaced with a "find" function)</span>
|
||||
<span class="sd"> runcmd find ${root} -name "*.pyo" -type f -delete</span>
|
||||
<span class="sd"> %for f in find(root, name="*.pyo"):</span>
|
||||
<span class="sd"> remove ${f}</span>
|
||||
<span class="sd"> remove ${f}</span>
|
||||
<span class="sd"> %endfor</span>
|
||||
<span class="sd"> '''</span>
|
||||
<span class="n">cmd</span> <span class="o">=</span> <span class="n">cmdlist</span>
|
||||
@ -738,6 +765,7 @@
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> removepkg PKGGLOB [PKGGLOB...]</span>
|
||||
<span class="sd"> Delete the named package(s).</span>
|
||||
|
||||
<span class="sd"> IMPLEMENTATION NOTES:</span>
|
||||
<span class="sd"> RPM scriptlets (%preun/%postun) are *not* run.</span>
|
||||
<span class="sd"> Files are deleted, but directories are left behind.</span>
|
||||
@ -802,6 +830,7 @@
|
||||
<span class="sd"> (or packages) named.</span>
|
||||
<span class="sd"> If '--allbut' is used, all the files from the given package(s) will</span>
|
||||
<span class="sd"> be removed *except* the ones which match the file globs.</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
<span class="sd"> removefrom usbutils /usr/bin/*</span>
|
||||
<span class="sd"> removefrom xfsprogs --allbut /sbin/*</span>
|
||||
@ -835,6 +864,7 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"removefrom </span><span class="si">%s</span><span class="s2">: no files to remove!"</span><span class="p">,</span> <span class="n">cmd</span><span class="p">)</span></div>
|
||||
|
||||
<span class="c1"># pylint: disable=anomalous-backslash-in-string</span>
|
||||
<div class="viewcode-block" id="LoraxTemplateRunner.removekmod"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod">[docs]</a> <span class="k">def</span> <span class="nf">removekmod</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">globs</span><span class="p">):</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> removekmod GLOB [GLOB...] [--allbut] KEEPGLOB [KEEPGLOB...]</span>
|
||||
@ -846,7 +876,7 @@
|
||||
<span class="sd"> to search and one KEEPGLOB to keep. The KEEPGLOB is expanded to be *KEEPGLOB*</span>
|
||||
<span class="sd"> so that it will match anywhere in the path.</span>
|
||||
|
||||
<span class="sd"> This only removes files from under /lib/modules/*/kernel/</span>
|
||||
<span class="sd"> This only removes files from under /lib/modules/\*/kernel/</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
<span class="sd"> removekmod sound drivers/media drivers/hwmon drivers/video</span>
|
||||
@ -895,6 +925,7 @@
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> createaddrsize INITRD_ADDRESS INITRD ADDRSIZE</span>
|
||||
<span class="sd"> Create the initrd.addrsize file required in LPAR boot process.</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
<span class="sd"> createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize</span>
|
||||
<span class="sd"> '''</span>
|
||||
@ -907,6 +938,7 @@
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> systemctl [enable|disable|mask] UNIT [UNIT...]</span>
|
||||
<span class="sd"> Enable, disable, or mask the given systemd units.</span>
|
||||
|
||||
<span class="sd"> Examples:</span>
|
||||
<span class="sd"> systemctl disable lvm2-monitor.service</span>
|
||||
<span class="sd"> systemctl mask fedora-storage-init.service fedora-configure.service</span>
|
||||
@ -926,6 +958,89 @@
|
||||
<span class="n">runcmd</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">CalledProcessError</span><span class="p">:</span>
|
||||
<span class="k">pass</span></div></div>
|
||||
|
||||
<div class="viewcode-block" id="LiveTemplateRunner"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LiveTemplateRunner">[docs]</a><span class="k">class</span> <span class="nc">LiveTemplateRunner</span><span class="p">(</span><span class="n">TemplateRunner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> This class parses and executes a limited Lorax template. Sample usage:</span>
|
||||
|
||||
<span class="sd"> # install a bunch of packages</span>
|
||||
<span class="sd"> runner = LiveTemplateRunner(dbo, templatedir, defaults)</span>
|
||||
<span class="sd"> runner.run("live-install.tmpl")</span>
|
||||
|
||||
<span class="sd"> It is meant to be used with the live-install.tmpl which lists the per-arch</span>
|
||||
<span class="sd"> pacages needed to build the live-iso output.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dbo</span><span class="p">,</span> <span class="n">fatalerrors</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">dbo</span> <span class="o">=</span> <span class="n">dbo</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">pkgs</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">pkgnames</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">LiveTemplateRunner</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">fatalerrors</span><span class="p">,</span> <span class="n">templatedir</span><span class="p">,</span> <span class="n">defaults</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="LiveTemplateRunner.installpkg"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LiveTemplateRunner.installpkg">[docs]</a> <span class="k">def</span> <span class="nf">installpkg</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">pkgs</span><span class="p">):</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> installpkg [--required|--optional] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...]</span>
|
||||
<span class="sd"> Request installation of all packages matching the given globs.</span>
|
||||
<span class="sd"> Note that this is just a *request* - nothing is *actually* installed</span>
|
||||
<span class="sd"> until the 'run_pkg_transaction' command is given.</span>
|
||||
|
||||
<span class="sd"> --required is now the default. If the PKGGLOB can be missing pass --optional</span>
|
||||
<span class="sd"> '''</span>
|
||||
<span class="k">if</span> <span class="n">pkgs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'--optional'</span><span class="p">:</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">pkgs</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||
<span class="n">required</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">elif</span> <span class="n">pkgs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'--required'</span><span class="p">:</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">pkgs</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||
<span class="n">required</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">required</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="n">excludes</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">while</span> <span class="s1">'--except'</span> <span class="ow">in</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="n">idx</span> <span class="o">=</span> <span class="n">pkgs</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="s1">'--except'</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">pkgs</span><span class="p">)</span> <span class="o">==</span> <span class="n">idx</span><span class="o">+</span><span class="mi">1</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"installpkg needs an argument after --except"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">excludes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">pkgs</span><span class="p">[</span><span class="n">idx</span><span class="o">+</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">pkgs</span><span class="p">[:</span><span class="n">idx</span><span class="p">]</span> <span class="o">+</span> <span class="n">pkgs</span><span class="p">[</span><span class="n">idx</span><span class="o">+</span><span class="mi">2</span><span class="p">:]</span>
|
||||
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c1"># Start by using Subject to generate a package query, which will</span>
|
||||
<span class="c1"># give us a query object similar to what dbo.install would select,</span>
|
||||
<span class="c1"># minus the handling for multilib. This query may contain</span>
|
||||
<span class="c1"># multiple arches. Pull the package names out of that, filter any</span>
|
||||
<span class="c1"># that match the excludes patterns, and pass those names back to</span>
|
||||
<span class="c1"># dbo.install to do the actual, arch and version and multilib</span>
|
||||
<span class="c1"># aware, package selction.</span>
|
||||
|
||||
<span class="c1"># dnf queries don't have a concept of negative globs which is why</span>
|
||||
<span class="c1"># the filtering is done the hard way.</span>
|
||||
|
||||
<span class="n">pkgnames</span> <span class="o">=</span> <span class="p">[</span><span class="n">pkg</span> <span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">dnf</span><span class="o">.</span><span class="n">subject</span><span class="o">.</span><span class="n">Subject</span><span class="p">(</span><span class="n">p</span><span class="p">)</span><span class="o">.</span><span class="n">get_best_query</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">latest</span><span class="o">=</span><span class="kc">True</span><span class="p">)]</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">pkgnames</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">PackageNotFoundError</span><span class="p">(</span><span class="s2">"no package matched"</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Apply excludes to the name only</span>
|
||||
<span class="k">for</span> <span class="n">exclude</span> <span class="ow">in</span> <span class="n">excludes</span><span class="p">:</span>
|
||||
<span class="n">pkgnames</span> <span class="o">=</span> <span class="p">[</span><span class="n">pkg</span> <span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">pkgnames</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">fnmatch</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="n">pkg</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">exclude</span><span class="p">)]</span>
|
||||
|
||||
<span class="c1"># Convert to a sorted NVR list for installation</span>
|
||||
<span class="n">pkgnvrs</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">([</span><span class="s2">"</span><span class="si">{}</span><span class="s2">-</span><span class="si">{}</span><span class="s2">-</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">pkg</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">pkg</span><span class="o">.</span><span class="n">version</span><span class="p">,</span> <span class="n">pkg</span><span class="o">.</span><span class="n">release</span><span class="p">)</span> <span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">pkgnames</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># If the request is a glob, expand it in the log</span>
|
||||
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="n">g</span> <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">'*'</span><span class="p">,</span><span class="s1">'?'</span><span class="p">,</span><span class="s1">'.'</span><span class="p">]</span> <span class="k">if</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">p</span><span class="p">):</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"installpkg: </span><span class="si">%s</span><span class="s2"> expands to </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">pkgnvrs</span><span class="p">))</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">pkgs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">pkgnvrs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">pkgnames</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">pkg</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">pkgnames</span><span class="p">])</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="c1"># pylint: disable=broad-except</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"installpkg </span><span class="si">%s</span><span class="s2"> failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">errors</span> <span class="ow">and</span> <span class="n">required</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">"Required installpkg failed."</span><span class="p">)</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -938,7 +1053,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -957,27 +1072,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.monitor — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.monitor — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -370,7 +369,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -389,27 +388,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.mount — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.mount — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -269,7 +268,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -288,27 +287,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.sysutils — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.sysutils — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -187,6 +186,8 @@
|
||||
<span class="kn">import</span> <span class="nn">grp</span>
|
||||
<span class="kn">import</span> <span class="nn">glob</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
<span class="kn">import</span> <span class="nn">shlex</span>
|
||||
<span class="kn">from</span> <span class="nn">configparser</span> <span class="k">import</span> <span class="n">ConfigParser</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.executils</span> <span class="k">import</span> <span class="n">runcmd</span>
|
||||
|
||||
@ -263,6 +264,28 @@
|
||||
|
||||
<div class="viewcode-block" id="linktree"><a class="viewcode-back" href="../../pylorax.html#pylorax.sysutils.linktree">[docs]</a><span class="k">def</span> <span class="nf">linktree</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">):</span>
|
||||
<span class="n">runcmd</span><span class="p">([</span><span class="s2">"/bin/cp"</span><span class="p">,</span> <span class="s2">"-alx"</span><span class="p">,</span> <span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">])</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">unquote</span><span class="p">(</span><span class="n">s</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="s1">' '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">s</span><span class="p">))</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">UnquotingConfigParser</span><span class="p">(</span><span class="n">ConfigParser</span><span class="p">):</span>
|
||||
<span class="sd">"""A ConfigParser, only with unquoting of the values."""</span>
|
||||
<span class="c1"># pylint: disable=arguments-differ</span>
|
||||
<span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">ret</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">ret</span><span class="p">:</span>
|
||||
<span class="n">ret</span> <span class="o">=</span> <span class="n">unquote</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">ret</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">flatconfig</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
|
||||
<span class="sd">"""Use UnquotingConfigParser to read a flat config file (without</span>
|
||||
<span class="sd"> section headers) by adding a section header.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">with</span> <span class="nb">open</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s1">'r'</span><span class="p">)</span> <span class="k">as</span> <span class="n">conffh</span><span class="p">:</span>
|
||||
<span class="n">conftext</span> <span class="o">=</span> <span class="s2">"[main]</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span> <span class="n">conffh</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||||
<span class="n">config</span> <span class="o">=</span> <span class="n">UnquotingConfigParser</span><span class="p">()</span>
|
||||
<span class="n">config</span><span class="o">.</span><span class="n">read_string</span><span class="p">(</span><span class="n">conftext</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">config</span><span class="p">[</span><span class="s1">'main'</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -275,7 +298,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -294,27 +317,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.treebuilder — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.treebuilder — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -366,13 +365,22 @@
|
||||
<div class="viewcode-block" id="RuntimeBuilder.generate_module_data"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.generate_module_data">[docs]</a> <span class="k">def</span> <span class="nf">generate_module_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="n">root</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span>
|
||||
<span class="n">moddir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="s2">"lib/modules/"</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">kver</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">moddir</span><span class="p">):</span>
|
||||
<span class="n">ksyms</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="s2">"boot/System.map-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">kver</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"doing depmod and module-info for </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">kver</span><span class="p">)</span>
|
||||
<span class="n">runcmd</span><span class="p">([</span><span class="s2">"depmod"</span><span class="p">,</span> <span class="s2">"-a"</span><span class="p">,</span> <span class="s2">"-F"</span><span class="p">,</span> <span class="n">ksyms</span><span class="p">,</span> <span class="s2">"-b"</span><span class="p">,</span> <span class="n">root</span><span class="p">,</span> <span class="n">kver</span><span class="p">])</span>
|
||||
<span class="n">generate_module_info</span><span class="p">(</span><span class="n">moddir</span><span class="o">+</span><span class="n">kver</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="n">moddir</span><span class="o">+</span><span class="s2">"module-info"</span><span class="p">)</span></div>
|
||||
<span class="k">for</span> <span class="n">kernel</span> <span class="ow">in</span> <span class="n">findkernels</span><span class="p">(</span><span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">):</span>
|
||||
<span class="n">ksyms</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="s2">"boot/System.map-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">kernel</span><span class="o">.</span><span class="n">version</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"doing depmod and module-info for </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">kernel</span><span class="o">.</span><span class="n">version</span><span class="p">)</span>
|
||||
<span class="n">runcmd</span><span class="p">([</span><span class="s2">"depmod"</span><span class="p">,</span> <span class="s2">"-a"</span><span class="p">,</span> <span class="s2">"-F"</span><span class="p">,</span> <span class="n">ksyms</span><span class="p">,</span> <span class="s2">"-b"</span><span class="p">,</span> <span class="n">root</span><span class="p">,</span> <span class="n">kernel</span><span class="o">.</span><span class="n">version</span><span class="p">])</span>
|
||||
<span class="n">generate_module_info</span><span class="p">(</span><span class="n">moddir</span><span class="o">+</span><span class="n">kernel</span><span class="o">.</span><span class="n">version</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="n">moddir</span><span class="o">+</span><span class="s2">"module-info"</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="RuntimeBuilder.create_runtime"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_runtime">[docs]</a> <span class="k">def</span> <span class="nf">create_runtime</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="s2">"/var/tmp/squashfs.img"</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="RuntimeBuilder.create_squashfs_runtime"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_squashfs_runtime">[docs]</a> <span class="k">def</span> <span class="nf">create_squashfs_runtime</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="s2">"/var/tmp/squashfs.img"</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
|
||||
<span class="sd">"""Create a plain squashfs runtime"""</span>
|
||||
<span class="n">compressargs</span> <span class="o">=</span> <span class="n">compressargs</span> <span class="ow">or</span> <span class="p">[]</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">outfile</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># squash the rootfs</span>
|
||||
<span class="n">imgutils</span><span class="o">.</span><span class="n">mksquashfs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="RuntimeBuilder.create_ext4_runtime"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_ext4_runtime">[docs]</a> <span class="k">def</span> <span class="nf">create_ext4_runtime</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="s2">"/var/tmp/squashfs.img"</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"xz"</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
|
||||
<span class="sd">"""Create a squashfs compressed ext4 runtime"""</span>
|
||||
<span class="c1"># make live rootfs image - must be named "LiveOS/rootfs.img" for dracut</span>
|
||||
<span class="n">compressargs</span> <span class="o">=</span> <span class="n">compressargs</span> <span class="ow">or</span> <span class="p">[]</span>
|
||||
<span class="n">workdir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">outfile</span><span class="p">),</span> <span class="s2">"runtime-workdir"</span><span class="p">)</span>
|
||||
@ -395,7 +403,8 @@
|
||||
<div class="viewcode-block" id="TreeBuilder"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.TreeBuilder">[docs]</a><span class="k">class</span> <span class="nc">TreeBuilder</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">'''Builds the arch-specific boot images.</span>
|
||||
<span class="sd"> inroot should be the installtree root (the newly-built runtime dir)'''</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">runtime</span><span class="p">,</span> <span class="n">isolabel</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">add_templates</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">add_template_vars</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">runtime</span><span class="p">,</span> <span class="n">isolabel</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
|
||||
<span class="n">templatedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">add_templates</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">add_template_vars</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">extra_boot_args</span><span class="o">=</span><span class="s2">""</span><span class="p">):</span>
|
||||
|
||||
<span class="c1"># NOTE: if you pass an arg named "runtime" to a mako template it'll</span>
|
||||
<span class="c1"># clobber some mako internal variables - hence "runtime_img".</span>
|
||||
@ -404,7 +413,8 @@
|
||||
<span class="n">inroot</span><span class="o">=</span><span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="o">=</span><span class="n">outroot</span><span class="p">,</span>
|
||||
<span class="n">basearch</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</span><span class="p">,</span> <span class="n">libdir</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">libdir</span><span class="p">,</span>
|
||||
<span class="n">isolabel</span><span class="o">=</span><span class="n">isolabel</span><span class="p">,</span> <span class="n">udev</span><span class="o">=</span><span class="n">udev_escape</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="n">domacboot</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="n">doupgrade</span><span class="p">,</span>
|
||||
<span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">,</span> <span class="n">lower</span><span class="o">=</span><span class="n">string_lower</span><span class="p">)</span>
|
||||
<span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">,</span> <span class="n">lower</span><span class="o">=</span><span class="n">string_lower</span><span class="p">,</span>
|
||||
<span class="n">extra_boot_args</span><span class="o">=</span><span class="n">extra_boot_args</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_runner</span> <span class="o">=</span> <span class="n">LoraxTemplateRunner</span><span class="p">(</span><span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="n">templatedir</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_runner</span><span class="o">.</span><span class="n">defaults</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vars</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">add_templates</span> <span class="o">=</span> <span class="n">add_templates</span> <span class="ow">or</span> <span class="p">[]</span>
|
||||
@ -567,7 +577,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -586,27 +596,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.treeinfo — Lorax 29.11 documentation</title>
|
||||
<title>pylorax.treeinfo — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -180,6 +179,7 @@
|
||||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax.treeinfo"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">configparser</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
|
||||
@ -190,8 +190,13 @@
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">c</span> <span class="o">=</span> <span class="n">configparser</span><span class="o">.</span><span class="n">ConfigParser</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="s1">'SOURCE_DATE_EPOCH'</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span>
|
||||
<span class="n">timestamp</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'SOURCE_DATE_EPOCH'</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">timestamp</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">())</span>
|
||||
|
||||
<span class="n">section</span> <span class="o">=</span> <span class="s2">"general"</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"timestamp"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()),</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"timestamp"</span><span class="p">:</span> <span class="n">timestamp</span><span class="p">,</span>
|
||||
<span class="s2">"family"</span><span class="p">:</span> <span class="n">product</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="n">version</span><span class="p">,</span>
|
||||
<span class="s2">"name"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">product</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span>
|
||||
@ -224,7 +229,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -243,27 +248,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -39,9 +39,10 @@ Build a ``qcow2`` disk image from this blueprint by running ``composer-cli
|
||||
compose start http-server qcow2``. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.
|
||||
|
||||
<<<<<<< HEAD
|
||||
The available types of images is displayed by ``composer-cli compose types``.
|
||||
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
|
||||
tar
|
||||
Currently this consists of: alibaba, ami, ext4-filesystem, google, hyper-v,
|
||||
live-iso, openstack, partitioned-disk, qcow2, tar, vhd, vmdk
|
||||
|
||||
Monitor the build status
|
||||
------------------------
|
||||
|
@ -208,10 +208,7 @@ install. There are a couple of things to keep in mind when doing this:
|
||||
running under you may encounter strange bugs if you try to build newer or
|
||||
older releases.
|
||||
|
||||
2. Make sure selinux is set to permissive or disabled. It won't install
|
||||
correctly with selinux set to enforcing yet.
|
||||
|
||||
3. It may totally trash your host. So far I haven't had this happen, but the
|
||||
2. It may totally trash your host. So far I haven't had this happen, but the
|
||||
possibility exists that a bug in Anaconda could result in it operating on
|
||||
real devices. I recommend running it in a virt or on a system that you can
|
||||
afford to lose all data from.
|
||||
@ -229,6 +226,10 @@ Example cmdline:
|
||||
or UEFI). You can create BIOS partitioned disk images on UEFI by using
|
||||
virt.
|
||||
|
||||
.. note::
|
||||
As of version 30.7 SELinux can be set to Enforcing. The current state is
|
||||
logged for debugging purposes and if there are SELinux denials they should
|
||||
be reported as a bug.
|
||||
|
||||
AMI Images
|
||||
----------
|
||||
@ -578,18 +579,10 @@ Creating UEFI disk images with virt
|
||||
|
||||
Partitioned disk images can only be created for the same platform as the host system (BIOS or
|
||||
UEFI). You can use virt to create BIOS images on UEFI systems, and it is also possible
|
||||
to create UEFI images on BIOS systems using OVMF. You first need to setup your system with
|
||||
the OVMF firmware. The details can be `found here linux-kvm OVMF page <http://www.linux-kvm.org/page/OVMF>`_
|
||||
but it amounts to:
|
||||
to create UEFI images on BIOS systems using OVMF firmware and qemu.
|
||||
|
||||
1. Download the firmware.repo from `Gerd Hoffmann <https://www.kraxel.org/repos/>`_ and install it
|
||||
in /etc/yum.repos.d/
|
||||
|
||||
2. Install the edk2.git-ovmf-x64 package
|
||||
|
||||
3. Copy /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd to /usr/share/OVMF/OVMF_CODE.fd
|
||||
|
||||
4. Copy /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd to /usr/share/OVMF/OVMF_VARS.fd
|
||||
Install the lorax-lmc-virt package, this will install qemu and the OVMF
|
||||
firmware files.
|
||||
|
||||
Now you can run livemedia-creator with ``--virt-uefi`` to boot and install using UEFI::
|
||||
|
||||
@ -600,11 +593,10 @@ Make sure that the kickstart you are using creates a /boot/efi partition by incl
|
||||
|
||||
part /boot/efi --fstype="efi" --size=500
|
||||
|
||||
Or use ``reqpart`` in the kickstart and Anaconda will create the required partitions.
|
||||
|
||||
.. note::
|
||||
When using the resulting image with the current version of OVMF (edk2.git-ovmf-x64-0-20151103.b1295.ge5cffca)
|
||||
it will not boot automatically because there is a problem with the fallback path.
|
||||
You can boot it by entering the UEFI shell and running EFI/fedora/shim.efi and
|
||||
then using efibootmgr to setup the correct boot entry.
|
||||
The --virt-uefi method is currently only supported on the x86_64 architecture.
|
||||
|
||||
|
||||
Debugging problems
|
||||
|
@ -13,6 +13,19 @@ Behind the scenes it uses `livemedia-creator <livemedia-creator.html>`_ and
|
||||
`Anaconda <https://anaconda-installer.readthedocs.io/en/latest/>`_ to handle the
|
||||
installation and configuration of the images.
|
||||
|
||||
Important Things To Note
|
||||
------------------------
|
||||
|
||||
* As of version 30.7 SELinux can be set to Enforcing. The current state is
|
||||
logged for debugging purposes and if there are SELinux denials they should
|
||||
be reported as a bug.
|
||||
|
||||
* All image types lock the root account, except for live-iso. You will need to either
|
||||
use one of the `Customizations`_ methods for setting a ssh key/password, install a
|
||||
package that creates a user, or use something like `cloud-init` to setup access at
|
||||
boot time.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
@ -63,7 +76,6 @@ Security
|
||||
Some security related issues that you should be aware of before running ``lorax-composer``:
|
||||
|
||||
* One of the API server threads needs to retain root privileges in order to run Anaconda.
|
||||
* SELinux must be set to Permissive or disabled to allow ``livemedia-creator`` to run Anaconda.
|
||||
* Only allow authorized users access to the ``weldr`` group and socket.
|
||||
|
||||
Since Anaconda kickstarts are used there is the possibility that a user could
|
||||
@ -163,11 +175,25 @@ for selecting optional packages.
|
||||
Customizations
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
The ``[[customizations]]`` section can be used to configure the hostname of the final image. eg.::
|
||||
The ``[customizations]`` section can be used to configure the hostname of the final image. eg.::
|
||||
|
||||
[[customizations]]
|
||||
[customizations]
|
||||
hostname = "baseimage"
|
||||
|
||||
This is optional and may be left out to use the defaults.
|
||||
|
||||
|
||||
[customizations.kernel]
|
||||
***********************
|
||||
|
||||
This allows you to append arguments to the bootloader's kernel commandline. This will not have any
|
||||
effect on ``tar`` or ``ext4-filesystem`` images since they do not include a bootloader.
|
||||
|
||||
For example::
|
||||
|
||||
[customizations.kernel]
|
||||
append = "nosmt=force"
|
||||
|
||||
|
||||
[[customizations.sshkey]]
|
||||
*************************
|
||||
@ -180,6 +206,10 @@ Set an existing user's ssh key in the final image::
|
||||
|
||||
The key will be added to the user's authorized_keys file.
|
||||
|
||||
.. warning::
|
||||
|
||||
``key`` expects the entire content of ``~/.ssh/id_rsa.pub``
|
||||
|
||||
|
||||
[[customizations.user]]
|
||||
***********************
|
||||
@ -201,6 +231,10 @@ All fields for this section are optional except for the ``name``, here is a comp
|
||||
If the password starts with ``$6$``, ``$5$``, or ``$2b$`` it will be stored as
|
||||
an encrypted password. Otherwise it will be treated as a plain text password.
|
||||
|
||||
.. warning::
|
||||
|
||||
``key`` expects the entire content of ``~/.ssh/id_rsa.pub``
|
||||
|
||||
|
||||
[[customizations.group]]
|
||||
************************
|
||||
@ -212,6 +246,132 @@ Add a group to the image. ``name`` is required and ``gid`` is optional::
|
||||
gid = 1130
|
||||
|
||||
|
||||
[customizations.timezone]
|
||||
*************************
|
||||
|
||||
Customizing the timezone and the NTP servers to use for the system::
|
||||
|
||||
[customizations.timezone]
|
||||
timezone = "US/Eastern"
|
||||
ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"]
|
||||
|
||||
The values supported by ``timezone`` can be listed by running ``timedatectl list-timezones``.
|
||||
|
||||
If no timezone is setup the system will default to using `UTC`. The ntp servers are also
|
||||
optional and will default to using the distribution defaults which are fine for most uses.
|
||||
|
||||
In some image types there are already NTP servers setup, eg. Google cloud image, and they
|
||||
cannot be overridden because they are required to boot in the selected environment. But the
|
||||
timezone will be updated to the one selected in the blueprint.
|
||||
|
||||
|
||||
[customizations.locale]
|
||||
***********************
|
||||
|
||||
Customize the locale settings for the system::
|
||||
|
||||
[customizations.locale]
|
||||
languages = ["en_US.UTF-8"]
|
||||
keyboard = "us"
|
||||
|
||||
The values supported by ``languages`` can be listed by running ``localectl list-locales`` from
|
||||
the command line.
|
||||
|
||||
The values supported by ``keyboard`` can be listed by running ``localectl list-keymaps`` from
|
||||
the command line.
|
||||
|
||||
Multiple languages can be added. The first one becomes the
|
||||
primary, and the others are added as secondary. One or the other of ``languages``
|
||||
or ``keyboard`` must be included (or both) in the section.
|
||||
|
||||
|
||||
[customizations.firewall]
|
||||
*************************
|
||||
|
||||
By default the firewall blocks all access except for services that enable their ports explicitly,
|
||||
like ``sshd``. This command can be used to open other ports or services. Ports are configured using
|
||||
the port:protocol format::
|
||||
|
||||
[customizations.firewall]
|
||||
ports = ["22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"]
|
||||
|
||||
Numeric ports, or their names from ``/etc/services`` can be used in the ``ports`` enabled/disabled lists.
|
||||
|
||||
The blueprint settings extend any existing settings in the image templates, so if ``sshd`` is
|
||||
already enabled it will extend the list of ports with the ones listed by the blueprint.
|
||||
|
||||
If the distribution uses ``firewalld`` you can specify services listed by ``firewall-cmd --get-services``
|
||||
in a ``customizations.firewall.services`` section::
|
||||
|
||||
[customizations.firewall.services]
|
||||
enabled = ["ftp", "ntp", "dhcp"]
|
||||
disabled = ["telnet"]
|
||||
|
||||
Remember that the ``firewall.services`` are different from the names in ``/etc/services``.
|
||||
|
||||
Both are optional, if they are not used leave them out or set them to an empty list ``[]``. If you
|
||||
only want the default firewall setup this section can be omitted from the blueprint.
|
||||
|
||||
NOTE: The ``Google`` and ``OpenStack`` templates explicitly disable the firewall for their environment.
|
||||
This cannot be overridden by the blueprint.
|
||||
|
||||
[customizations.services]
|
||||
*************************
|
||||
|
||||
This section can be used to control which services are enabled at boot time.
|
||||
Some image types already have services enabled or disabled in order for the
|
||||
image to work correctly, and cannot be overridden. eg. ``ami`` requires
|
||||
``sshd``, ``chronyd``, and ``cloud-init``. Without them the image will not
|
||||
boot. Blueprint services are added to, not replacing, the list already in the
|
||||
templates, if any.
|
||||
|
||||
The service names are systemd service units. You may specify any systemd unit
|
||||
file accepted by ``systemctl enable`` eg. ``cockpit.socket``::
|
||||
|
||||
[customizations.services]
|
||||
enabled = ["sshd", "cockpit.socket", "httpd"]
|
||||
disabled = ["postfix", "telnetd"]
|
||||
|
||||
|
||||
[[repos.git]]
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
The ``[[repos.git]]`` entries are used to add files from a `git repository<https://git-scm.com/>`
|
||||
repository to the created image. The repository is cloned, the specified ``ref`` is checked out
|
||||
and an rpm is created to install the files to a ``destination`` path. The rpm includes a summary
|
||||
with the details of the repository and reference used to create it. The rpm is also included in the
|
||||
image build metadata.
|
||||
|
||||
To create an rpm named ``server-config-1.0-1.noarch.rpm`` you would add this to your blueprint::
|
||||
|
||||
[[repos.git]]
|
||||
rpmname="server-config"
|
||||
rpmversion="1.0"
|
||||
rpmrelease="1"
|
||||
summary="Setup files for server deployment"
|
||||
repo="PATH OF GIT REPO TO CLONE"
|
||||
ref="v1.0"
|
||||
destination="/opt/server/"
|
||||
|
||||
* rpmname: Name of the rpm to create, also used as the prefix name in the tar archive
|
||||
* rpmversion: Version of the rpm, eg. "1.0.0"
|
||||
* rpmrelease: Release of the rpm, eg. "1"
|
||||
* summary: Summary string for the rpm
|
||||
* repo: URL of the get repo to clone and create the archive from
|
||||
* ref: Git reference to check out. eg. origin/branch-name, git tag, or git commit hash
|
||||
* destination: Path to install the / of the git repo at when installing the rpm
|
||||
|
||||
An rpm will be created with the contents of the git repository referenced, with the files
|
||||
being installed under ``/opt/server/`` in this case.
|
||||
|
||||
``ref`` can be any valid git reference for use with ``git archive``. eg. to use the head
|
||||
of a branch set it to ``origin/branch-name``, a tag name, or a commit hash.
|
||||
|
||||
Note that the repository is cloned in full each time a build is started, so pointing to a
|
||||
repository with a large amount of history may take a while to clone and use a significant
|
||||
amount of disk space. The clone is temporary and is removed once the rpm is created.
|
||||
|
||||
|
||||
Adding Output Types
|
||||
-------------------
|
||||
|
||||
@ -312,3 +472,33 @@ The documentation for the source API routes can be `found here <pylorax.api.html
|
||||
The configured sources are used for all blueprint depsolve operations, and for composing images.
|
||||
When adding additional sources you must make sure that the packages in the source do not
|
||||
conflict with any other package sources, otherwise depsolving will fail.
|
||||
|
||||
DVD ISO Package Source
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In some situations the system may want to *only* use a DVD iso as the package
|
||||
source, not the repos from the network. ``lorax-composer`` and ``anaconda``
|
||||
understand ``file://`` URLs so you can mount an iso on the host, and replace the
|
||||
system repo files with a configuration file pointing to the DVD.
|
||||
|
||||
* Stop the ``lorax-composer.service`` if it is running
|
||||
* Move the repo files in ``/etc/yum.repos.d/`` someplace safe
|
||||
* Create a new ``iso.repo`` file in ``/etc/yum.repos.d/``::
|
||||
|
||||
[iso]
|
||||
name=iso
|
||||
baseurl=file:///mnt/iso/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///mnt/iso/RPM-GPG-KEY-redhat-release
|
||||
|
||||
* Remove all the cached repo files from ``/var/lib/lorax/composer/repos/``
|
||||
* Restart the ``lorax-composer.service``
|
||||
* Check the output of ``composer-cli status show`` for any output specific depsolve errors.
|
||||
For example, the DVD usually does not include ``grub2-efi-*-cdboot-*`` so the live-iso image
|
||||
type will not be available.
|
||||
|
||||
If you want to *add* the DVD source to the existing sources you can do that by
|
||||
mounting the iso and creating a source file to point to it as described in the
|
||||
`Package Sources`_ documentation. In that case there is no need to remove the other
|
||||
sources from ``/etc/yum.repos.d/`` or clear the cached repos.
|
||||
|
@ -4,6 +4,14 @@ pylorax.api package
|
||||
Submodules
|
||||
----------
|
||||
|
||||
pylorax.api.bisect module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.api.bisect
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.checkparams module
|
||||
------------------------------
|
||||
|
||||
@ -60,6 +68,14 @@ pylorax.api.errors module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.gitrpm module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.api.gitrpm
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.projects module
|
||||
---------------------------
|
||||
|
||||
|
@ -59,6 +59,14 @@ pylorax.discinfo module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.dnfbase module
|
||||
----------------------
|
||||
|
||||
.. automodule:: pylorax.dnfbase
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.dnfhelper module
|
||||
------------------------
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||
VERSION: '29.11',
|
||||
VERSION: '29.28',
|
||||
LANGUAGE: 'None',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
|
@ -1 +1,3 @@
|
||||
require=function r(s,a,l){function c(i,n){if(!a[i]){if(!s[i]){var e="function"==typeof require&&require;if(!n&&e)return e(i,!0);if(u)return u(i,!0);var t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[i]={exports:{}};s[i][0].call(o.exports,function(n){var e=s[i][1][n];return c(e||n)},o,o.exports,r,s,a,l)}return a[i].exports}for(var u="function"==typeof require&&require,n=0;n<l.length;n++)c(l[n]);return c}({"sphinx-rtd-theme":[function(n,e,i){var jQuery="undefined"!=typeof window?window.jQuery:n("jquery");e.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(e){var i=this;"undefined"==typeof withStickNav&&(e=!0),i.isRunning||(i.isRunning=!0,jQuery(function(n){i.init(n),i.reset(),i.win.on("hashchange",i.reset),e&&i.win.on("scroll",function(){i.linkScroll||i.winScroll||(i.winScroll=!0,requestAnimationFrame(function(){i.onScroll()}))}),i.win.on("resize",function(){i.winResize||(i.winResize=!0,requestAnimationFrame(function(){i.onResize()}))}),i.onResize()}))},enableSticky:function(){this.enable(!0)},init:function(i){i(document);var t=this;this.navBar=i("div.wy-side-scroll:first"),this.win=i(window),i(document).on("click","[data-toggle='wy-nav-top']",function(){i("[data-toggle='wy-nav-shift']").toggleClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift")}).on("click",".wy-menu-vertical .current ul li a",function(){var n=i(this);i("[data-toggle='wy-nav-shift']").removeClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift"),t.toggleCurrent(n),t.hashChange()}).on("click","[data-toggle='rst-current-version']",function(){i("[data-toggle='rst-versions']").toggleClass("shift-up")}),i("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),i("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),i("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i('<span class="toctree-expand"></span>'),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0<i.length&&($(".wy-menu-vertical .current").removeClass("current"),i.addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l1").parent().addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l2").addClass("current"),i.closest("li.toctree-l3").addClass("current"),i.closest("li.toctree-l4").addClass("current"))}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,i=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e<n.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[n[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[e]+"CancelAnimationFrame"]||window[n[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(n,e){var i=(new Date).getTime(),t=Math.max(0,16-(i-r)),o=window.setTimeout(function(){n(i+t)},t);return r=i+t,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()},{jquery:"jquery"}]},{},["sphinx-rtd-theme"]);
|
||||
/* sphinx_rtd_theme version 0.4.2 | MIT license */
|
||||
/* Built 20181005 13:10 */
|
||||
require=function r(s,a,l){function c(e,n){if(!a[e]){if(!s[e]){var i="function"==typeof require&&require;if(!n&&i)return i(e,!0);if(u)return u(e,!0);var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[e]={exports:{}};s[e][0].call(o.exports,function(n){return c(s[e][1][n]||n)},o,o.exports,r,s,a,l)}return a[e].exports}for(var u="function"==typeof require&&require,n=0;n<l.length;n++)c(l[n]);return c}({"sphinx-rtd-theme":[function(n,e,i){var jQuery="undefined"!=typeof window?window.jQuery:n("jquery");e.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(e){var i=this;void 0===e&&(e=!0),i.isRunning||(i.isRunning=!0,jQuery(function(n){i.init(n),i.reset(),i.win.on("hashchange",i.reset),e&&i.win.on("scroll",function(){i.linkScroll||i.winScroll||(i.winScroll=!0,requestAnimationFrame(function(){i.onScroll()}))}),i.win.on("resize",function(){i.winResize||(i.winResize=!0,requestAnimationFrame(function(){i.onResize()}))}),i.onResize()}))},enableSticky:function(){this.enable(!0)},init:function(i){i(document);var t=this;this.navBar=i("div.wy-side-scroll:first"),this.win=i(window),i(document).on("click","[data-toggle='wy-nav-top']",function(){i("[data-toggle='wy-nav-shift']").toggleClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift")}).on("click",".wy-menu-vertical .current ul li a",function(){var n=i(this);i("[data-toggle='wy-nav-shift']").removeClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift"),t.toggleCurrent(n),t.hashChange()}).on("click","[data-toggle='rst-current-version']",function(){i("[data-toggle='rst-versions']").toggleClass("shift-up")}),i("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),i("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),i("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i('<span class="toctree-expand"></span>'),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0<i.length&&($(".wy-menu-vertical .current").removeClass("current"),i.addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l1").parent().addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l2").addClass("current"),i.closest("li.toctree-l3").addClass("current"),i.closest("li.toctree-l4").addClass("current"))}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,i=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e<n.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[n[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[e]+"CancelAnimationFrame"]||window[n[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(n,e){var i=(new Date).getTime(),t=Math.max(0,16-(i-r)),o=window.setTimeout(function(){n(i+t)},t);return r=i+t,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()},{jquery:"jquery"}]},{},["sphinx-rtd-theme"]);
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer-cli — Lorax 29.11 documentation</title>
|
||||
<title>composer-cli — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -215,17 +214,15 @@ group. They do not need to be root, but all of the <a class="reference external"
|
||||
<tr><td class="option-group">
|
||||
<kbd>-s, --socket</kbd></td>
|
||||
<td><p class="first">Path to the socket file to listen on</p>
|
||||
<p class="last">Default: “/run/weldr/api.socket”</p>
|
||||
<p class="last">Default: "/run/weldr/api.socket"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--log</kbd></td>
|
||||
<td><p class="first">Path to logfile (./composer-cli.log)</p>
|
||||
<p class="last">Default: “./composer-cli.log”</p>
|
||||
</td></tr>
|
||||
<td>Path to logfile (./composer-cli.log)</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-a, --api</kbd></td>
|
||||
<td><p class="first">API Version to use</p>
|
||||
<p class="last">Default: “0”</p>
|
||||
<p class="last">Default: "0"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--test</kbd></td>
|
||||
@ -234,7 +231,7 @@ group. They do not need to be root, but all of the <a class="reference external"
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td><p class="first">show program’s version number and exit</p>
|
||||
<td><p class="first">show program's version number and exit</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
@ -253,7 +250,7 @@ group. They do not need to be root, but all of the <a class="reference external"
|
||||
<dd>Show the last SIZE kB of the compose log.</dd>
|
||||
<dt>compose cancel <UUID></dt>
|
||||
<dd>Cancel a running compose and delete any intermediate results.</dd>
|
||||
<dt>compose delete <UUID,…></dt>
|
||||
<dt>compose delete <UUID,...></dt>
|
||||
<dd>Delete the listed compose results.</dd>
|
||||
<dt>compose info <UUID></dt>
|
||||
<dd>Show detailed information on the compose.</dd>
|
||||
@ -267,27 +264,27 @@ group. They do not need to be root, but all of the <a class="reference external"
|
||||
<dd>Download the output image from the compose. Filename depends on the type.</dd>
|
||||
<dt>blueprints list</dt>
|
||||
<dd>List the names of the available blueprints.</dd>
|
||||
<dt>blueprints show <BLUEPRINT,…></dt>
|
||||
<dt>blueprints show <BLUEPRINT,...></dt>
|
||||
<dd>Display the blueprint in TOML format.</dd>
|
||||
<dt>blueprints changes <BLUEPRINT,…></dt>
|
||||
<dt>blueprints changes <BLUEPRINT,...></dt>
|
||||
<dd>Display the changes for each blueprint.</dd>
|
||||
<dt>blueprints diff <BLUEPRINT> <FROM-COMMIT> <TO-COMMIT></dt>
|
||||
<dd>Display the differences between 2 versions of a blueprint.
|
||||
FROM-COMMIT can be a commit hash or NEWEST
|
||||
TO-COMMIT can be a commit hash, NEWEST, or WORKSPACE</dd>
|
||||
<dt>blueprints save <BLUEPRINT,…></dt>
|
||||
<dt>blueprints save <BLUEPRINT,...></dt>
|
||||
<dd>Save the blueprint to a file, <BLUEPRINT>.toml</dd>
|
||||
<dt>blueprints delete <BLUEPRINT></dt>
|
||||
<dd>Delete a blueprint from the server</dd>
|
||||
<dt>blueprints depsolve <BLUEPRINT,…></dt>
|
||||
<dt>blueprints depsolve <BLUEPRINT,...></dt>
|
||||
<dd>Display the packages needed to install the blueprint.</dd>
|
||||
<dt>blueprints push <BLUEPRINT></dt>
|
||||
<dd>Push a blueprint TOML file to the server.</dd>
|
||||
<dt>blueprints freeze <BLUEPRINT,…></dt>
|
||||
<dd>Display the frozen blueprint’s modules and packages.</dd>
|
||||
<dt>blueprints freeze show <BLUEPRINT,…></dt>
|
||||
<dt>blueprints freeze <BLUEPRINT,...></dt>
|
||||
<dd>Display the frozen blueprint's modules and packages.</dd>
|
||||
<dt>blueprints freeze show <BLUEPRINT,...></dt>
|
||||
<dd>Display the frozen blueprint in TOML format.</dd>
|
||||
<dt>blueprints freeze save <BLUEPRINT,…></dt>
|
||||
<dt>blueprints freeze save <BLUEPRINT,...></dt>
|
||||
<dd>Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.</dd>
|
||||
<dt>blueprints tag <BLUEPRINT></dt>
|
||||
<dd>Tag the most recent blueprint commit as a release.</dd>
|
||||
@ -299,11 +296,11 @@ TO-COMMIT can be a commit hash, NEWEST, or WORKSPACE</dd>
|
||||
<dd>List the available modules.</dd>
|
||||
<dt>projects list</dt>
|
||||
<dd>List the available projects.</dd>
|
||||
<dt>projects info <PROJECT,…></dt>
|
||||
<dt>projects info <PROJECT,...></dt>
|
||||
<dd>Show details about the listed projects.</dd>
|
||||
<dt>sources list</dt>
|
||||
<dd>List the available sources</dd>
|
||||
<dt>sources info <SOURCE-NAME,…></dt>
|
||||
<dt>sources info <SOURCE-NAME,...></dt>
|
||||
<dd>Details about the source.</dd>
|
||||
<dt>sources add <SOURCE.TOML></dt>
|
||||
<dd>Add a package source to the server.</dd>
|
||||
@ -331,9 +328,10 @@ saved by viewing the changelog - <code class="docutils literal notranslate"><spa
|
||||
<p>Build a <code class="docutils literal notranslate"><span class="pre">qcow2</span></code> disk image from this blueprint by running <code class="docutils literal notranslate"><span class="pre">composer-cli</span>
|
||||
<span class="pre">compose</span> <span class="pre">start</span> <span class="pre">http-server</span> <span class="pre">qcow2</span></code>. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.</p>
|
||||
<p>The available types of images is displayed by <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></code>.
|
||||
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
|
||||
tar</p>
|
||||
<p><<<<<<< HEAD
|
||||
The available types of images is displayed by <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></code>.
|
||||
Currently this consists of: alibaba, ami, ext4-filesystem, google, hyper-v,
|
||||
live-iso, openstack, partitioned-disk, qcow2, tar, vhd, vmdk</p>
|
||||
</div>
|
||||
<div class="section" id="monitor-the-build-status">
|
||||
<h2>Monitor the build status<a class="headerlink" href="#monitor-the-build-status" title="Permalink to this headline">¶</a></h2>
|
||||
@ -373,7 +371,7 @@ save the qcow2 image as <code class="docutils literal notranslate"><span class="
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -392,27 +390,27 @@ save the qcow2 image as <code class="docutils literal notranslate"><span class="
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli package — Lorax 29.11 documentation</title>
|
||||
<title>composer.cli package — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -190,16 +189,16 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints changes <blueprint,…> Display the changes for each blueprint.</p>
|
||||
<p>blueprints changes <blueprint,...> Display the changes for each blueprint.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -210,7 +209,7 @@
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
@ -230,10 +229,10 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -251,16 +250,16 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints depsolve <blueprint,…> Display the packages needed to install the blueprint.</p>
|
||||
<p>blueprints depsolve <blueprint,...> Display the packages needed to install the blueprint.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -272,10 +271,10 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -297,18 +296,18 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints freeze <blueprint,…> Display the frozen blueprint’s modules and packages.
|
||||
blueprints freeze show <blueprint,…> Display the frozen blueprint in TOML format.
|
||||
blueprints freeze save <blueprint,…> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.</p>
|
||||
<p>blueprints freeze <blueprint,...> Display the frozen blueprint's modules and packages.
|
||||
blueprints freeze show <blueprint,...> Display the frozen blueprint in TOML format.
|
||||
blueprints freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -320,16 +319,16 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints freeze save <blueprint,…> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.</p>
|
||||
<p>blueprints freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -341,16 +340,16 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints freeze show <blueprint,…> Display the frozen blueprint in TOML format.</p>
|
||||
<p>blueprints freeze show <blueprint,...> Display the frozen blueprint in TOML format.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -362,10 +361,10 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -383,10 +382,10 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -404,16 +403,16 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints save <blueprint,…> Save the blueprint to a file, <blueprint-name>.toml</p>
|
||||
<p>blueprints save <blueprint,...> Save the blueprint to a file, <blueprint-name>.toml</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -425,16 +424,16 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>blueprints show <blueprint,…> Display the blueprint in TOML format.</p>
|
||||
<p>blueprints show <blueprint,...> Display the blueprint in TOML format.</p>
|
||||
<p>Multiple blueprints will be separated by</p>
|
||||
</dd></dl>
|
||||
|
||||
@ -447,10 +446,10 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -468,10 +467,10 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -489,10 +488,10 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -504,14 +503,14 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.blueprints.prettyCommitDetails">
|
||||
<code class="descclassname">composer.cli.blueprints.</code><code class="descname">prettyCommitDetails</code><span class="sig-paren">(</span><em>change</em>, <em>indent=4</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/blueprints.html#prettyCommitDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.prettyCommitDetails" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Print the blueprint’s change in a nice way</p>
|
||||
<dd><p>Print the blueprint's change in a nice way</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>change</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – The individual blueprint change dict</li>
|
||||
<li><strong>indent</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – Number of spaces to indent</li>
|
||||
<li><strong>change</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- The individual blueprint change dict</li>
|
||||
<li><strong>indent</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Number of spaces to indent</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -527,7 +526,7 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>diff</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – Difference entry dict</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>diff</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- Difference entry dict</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Nice string</td>
|
||||
</tr>
|
||||
@ -556,11 +555,11 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -578,7 +577,7 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
@ -592,23 +591,23 @@ blueprints freeze save <blueprint,…> Save the frozen blueprint to a file
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_delete">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_delete</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_delete" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Delete a finished compose’s results</p>
|
||||
<dd><p>Delete a finished compose's results</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>compose delete <uuid,…></p>
|
||||
<p>compose delete <uuid,...></p>
|
||||
<p>Delete the listed compose results. It will only delete results for composes that have finished
|
||||
or failed, not a running compose.</p>
|
||||
</dd></dl>
|
||||
@ -616,17 +615,17 @@ or failed, not a running compose.</p>
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_image">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_image</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_image" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Download the compose’s output image</p>
|
||||
<dd><p>Download the compose's output image</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -646,11 +645,11 @@ of compose that was selected.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -675,35 +674,35 @@ of compose that was selected.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>compose log <uuid> [<size>kB]</p>
|
||||
<p>This will display the last 1kB of the compose’s log file. Can be used to follow progress
|
||||
<p>This will display the last 1kB of the compose's log file. Can be used to follow progress
|
||||
during the build.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_logs">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_logs</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_logs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_logs" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Download a tar of the compose’s logs</p>
|
||||
<dd><p>Download a tar of the compose's logs</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -716,17 +715,17 @@ during the build.</p>
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_metadata">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_metadata</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_metadata" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Download a tar file of the compose’s metadata</p>
|
||||
<dd><p>Download a tar file of the compose's metadata</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -739,17 +738,17 @@ during the build.</p>
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_results">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_results</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_results" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Download a tar file of the compose’s results</p>
|
||||
<dd><p>Download a tar file of the compose's results</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -769,11 +768,11 @@ It is saved as uuid.tar</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – Set to 1 to simulate a failed compose, set to 2 to simulate a finished one.</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Set to 1 to simulate a failed compose, set to 2 to simulate a finished one.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -791,17 +790,17 @@ It is saved as uuid.tar</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>This doesn’t map directly to an API command, it combines the results from queue, finished,
|
||||
<p>This doesn't map directly to an API command, it combines the results from queue, finished,
|
||||
and failed so raw JSON output is not available.</p>
|
||||
</dd></dl>
|
||||
|
||||
@ -814,11 +813,11 @@ and failed so raw JSON output is not available.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – unused in this function</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>testmode</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- unused in this function</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -842,7 +841,7 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
@ -863,7 +862,7 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
@ -882,16 +881,16 @@ include this extra information.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>projects info <project,…></p>
|
||||
<p>projects info <project,...></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -903,10 +902,10 @@ include this extra information.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -927,10 +926,10 @@ include this extra information.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -947,7 +946,7 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
@ -966,10 +965,10 @@ include this extra information.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -987,10 +986,10 @@ include this extra information.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1008,10 +1007,10 @@ include this extra information.</p>
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) – List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Set to True to show the JSON output instead of the human readable output</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>args</strong> (<em>list of str</em>) -- List of remaining arguments from the cmdline</li>
|
||||
<li><strong>show_json</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to show the JSON output instead of the human readable output</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1031,7 +1030,7 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
@ -1052,7 +1051,7 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>args</strong> (<em>list of str</em>) – list of strings with possible commas and spaces</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>args</strong> (<em>list of str</em>) -- list of strings with possible commas and spaces</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">List of all the items</td>
|
||||
</tr>
|
||||
@ -1061,7 +1060,7 @@ include this extra information.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Examples:</p>
|
||||
<p>[“one,two”, “three”, “,four”, “,five,”] returns [“one”, “two”, “three”, “four”, “five”]</p>
|
||||
<p>["one,two", "three", ",four", ",five,"] returns ["one", "two", "three", "four", "five"]</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -1072,9 +1071,9 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>blueprint_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The blueprint’s name</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>blueprint_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The blueprint's name</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The blueprint name with ‘ ‘ converted to - and .toml appended</td>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The blueprint name with ' ' converted to - and .toml appended</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
|
||||
</tr>
|
||||
@ -1090,7 +1089,7 @@ include this extra information.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>result</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – JSON result from the http query</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>result</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- JSON result from the http query</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)">tuple</a></td>
|
||||
</tr>
|
||||
@ -1110,7 +1109,7 @@ not to continue processing the results.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pkg</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – The package details</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pkg</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- The package details</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">name-[epoch:]version-release-arch</td>
|
||||
</tr>
|
||||
@ -1128,9 +1127,9 @@ not to continue processing the results.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>blueprint_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The blueprint’s name</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>blueprint_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The blueprint's name</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The blueprint name with ‘ ‘ converted to - and .toml appended</td>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The blueprint name with ' ' converted to - and .toml appended</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
|
||||
</tr>
|
||||
@ -1149,7 +1148,7 @@ not to continue processing the results.</p>
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) -- Cmdline arguments</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1178,7 +1177,7 @@ not to continue processing the results.</p>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -1197,27 +1196,27 @@ not to continue processing the results.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer package — Lorax 29.11 documentation</title>
|
||||
<title>composer package — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -209,8 +208,8 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The version of the API to talk to. eg. “0”</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The API route to talk to</li>
|
||||
<li><strong>api_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The version of the API to talk to. eg. "0"</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The API route to talk to</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -224,6 +223,33 @@
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.append_query">
|
||||
<code class="descclassname">composer.http_client.</code><code class="descname">append_query</code><span class="sig-paren">(</span><em>url</em>, <em>query</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/http_client.html#append_query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.append_query" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Add a query argument to a URL</p>
|
||||
<p>The query should be of the form "param1=what&param2=ever", i.e., no
|
||||
leading '?'. The new query data will be appended to any existing
|
||||
query string.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The original URL</li>
|
||||
<li><strong>query</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The query to append</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The new URL with the query argument included</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.delete_url_json">
|
||||
<code class="descclassname">composer.http_client.</code><code class="descname">delete_url_json</code><span class="sig-paren">(</span><em>socket_path</em>, <em>url</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/http_client.html#delete_url_json"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.delete_url_json" title="Permalink to this definition">¶</a></dt>
|
||||
@ -233,8 +259,8 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to send DELETE to</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to send DELETE to</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -257,8 +283,8 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to send POST to</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -274,7 +300,7 @@
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>response</strong> (<em>Response</em>) – The urllib3 response object</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>response</strong> (<em>Response</em>) -- The urllib3 response object</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">RuntimeError if it cannot find a filename in the header</td>
|
||||
</tr>
|
||||
@ -295,8 +321,34 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to request</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to request</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The json response from the server</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.get_url_json_unlimited">
|
||||
<code class="descclassname">composer.http_client.</code><code class="descname">get_url_json_unlimited</code><span class="sig-paren">(</span><em>socket_path</em>, <em>url</em>, <em>total_fn=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/http_client.html#get_url_json_unlimited"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.get_url_json_unlimited" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the JSON results of a GET request</p>
|
||||
<p>For URLs that use offset/limit arguments, this command will
|
||||
fetch all results for the given request.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to request</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -319,8 +371,8 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to request</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to request</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -343,9 +395,9 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
|
||||
<li><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The data for the body of the POST</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to send POST to</li>
|
||||
<li><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The data for the body of the POST</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -368,9 +420,9 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
|
||||
<li><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The data for the body of the POST</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to send POST to</li>
|
||||
<li><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The data for the body of the POST</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -393,9 +445,9 @@
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
|
||||
<li><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The data for the body of the POST</li>
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL to send POST to</li>
|
||||
<li><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The data for the body of the POST</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -456,7 +508,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -475,27 +527,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Index — Lorax 29.11 documentation</title>
|
||||
<title>Index — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -25,8 +25,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="#" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -186,6 +185,8 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.add_customizations">add_customizations() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.add_git_tarball">add_git_tarball() (pylorax.api.gitrpm.GitRpmBuild method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treeinfo.TreeInfo.add_section">add_section() (pylorax.treeinfo.TreeInfo method)</a>
|
||||
</li>
|
||||
@ -202,6 +203,8 @@
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append">append() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.installer.append_initrd">append_initrd() (in module pylorax.installer)</a>
|
||||
</li>
|
||||
<li><a href="composer.html#composer.http_client.append_query">append_query() (in module composer.http_client)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ArchData">ArchData (class in pylorax)</a>
|
||||
</li>
|
||||
@ -237,10 +240,10 @@
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_freeze_show">blueprints_freeze_show() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_list">blueprints_list() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_push">blueprints_push() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_save">blueprints_save() (in module composer.cli.blueprints)</a>
|
||||
@ -252,6 +255,8 @@
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_undo">blueprints_undo() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_workspace">blueprints_workspace() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.bootloader_append">bootloader_append() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.brace_expand">brace_expand() (in module pylorax.ltmpl)</a>
|
||||
</li>
|
||||
@ -270,6 +275,12 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.creator.calculate_disk_size">calculate_disk_size() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.check">check() (pylorax.api.gitrpm.GitRpmBuild method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.check_kickstart">check_kickstart() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.queue.check_queues">check_queues() (in module pylorax.api.queue)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.checkparams.checkparams">checkparams() (in module pylorax.api.checkparams)</a>
|
||||
</li>
|
||||
@ -278,8 +289,12 @@
|
||||
<li><a href="pylorax.html#pylorax.sysutils.chmod_">chmod_() (in module pylorax.sysutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.sysutils.chown_">chown_() (in module pylorax.sysutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.clean">clean() (pylorax.api.gitrpm.GitRpmBuild method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.cleanup">cleanup() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.cleanup_tmpdir">cleanup_tmpdir() (pylorax.api.gitrpm.GitRpmBuild method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.commit_recipe">commit_recipe() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
@ -325,10 +340,10 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.compose_types">(in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="composer.html#module-composer">composer (module)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.html#module-composer">composer (module)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#module-composer.cli">composer.cli (module)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#module-composer.cli.blueprints">composer.cli.blueprints (module)</a>
|
||||
@ -376,10 +391,14 @@
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.copy_dracut_hooks">copy_dracut_hooks() (pylorax.treebuilder.TreeBuilder method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.copytree">copytree() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_ext4_runtime">create_ext4_runtime() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.create_gitrpm_repo">create_gitrpm_repo() (in module pylorax.api.gitrpm)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.create_pxe_config">create_pxe_config() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_runtime">create_runtime() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_squashfs_runtime">create_squashfs_runtime() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.installer.create_vagrant_metadata">create_vagrant_metadata() (in module pylorax.installer)</a>
|
||||
</li>
|
||||
@ -391,6 +410,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.crossdomain.crossdomain">(in module pylorax.api.crossdomain)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.customize_ks_template">customize_ks_template() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
@ -428,6 +449,8 @@
|
||||
<li><a href="pylorax.html#pylorax.imgutils.DMDev">DMDev (class in pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.dnf_repo_to_file_repo">dnf_repo_to_file_repo() (in module pylorax.api.projects)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.DNFLock">DNFLock (class in pylorax.api.dnfbase)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.do_grafts">do_grafts() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
@ -488,6 +511,8 @@
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler.finish">finish() (pylorax.monitor.LogRequestHandler method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.finished">finished() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.firewall_cmd">firewall_cmd() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.freeze">freeze() (pylorax.api.recipes.Recipe method)</a>
|
||||
</li>
|
||||
@ -504,6 +529,8 @@
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.generate_module_info">generate_module_info() (in module pylorax.treebuilder)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.get_arch">get_arch() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild.get_base_dir">get_base_dir() (pylorax.api.gitrpm.GitRpmBuild method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.get_base_object">get_base_object() (in module pylorax.api.dnfbase)</a>
|
||||
</li>
|
||||
@ -514,30 +541,56 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.queue.get_compose_type">get_compose_type() (in module pylorax.api.queue)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.ComposerConfig.get_default">get_default() (pylorax.api.config.ComposerConfig method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_default_services">get_default_services() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.dnfbase.get_dnf_base_object">get_dnf_base_object() (in module pylorax.dnfbase)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_extra_pkgs">get_extra_pkgs() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="composer.html#composer.http_client.get_filename">get_filename() (in module composer.http_client)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_firewall_settings">get_firewall_settings() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.queue.get_image_name">get_image_name() (in module pylorax.api.queue)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.mount.IsoMountpoint.get_iso_label">get_iso_label() (pylorax.mount.IsoMountpoint method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_kernel_append">get_kernel_append() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_keyboard_layout">get_keyboard_layout() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_languages">get_languages() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.get_loop_name">get_loop_name() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.get_repo_description">get_repo_description() (in module pylorax.api.gitrpm)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.get_repo_sources">get_repo_sources() (in module pylorax.api.projects)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.get_revision_from_tag">get_revision_from_tag() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_services">get_services() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.get_source_ids">get_source_ids() (in module pylorax.api.projects)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.get_timezone_settings">get_timezone_settings() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="composer.html#composer.http_client.get_url_json">get_url_json() (in module composer.http_client)</a>
|
||||
</li>
|
||||
<li><a href="composer.html#composer.http_client.get_url_json_unlimited">get_url_json_unlimited() (in module composer.http_client)</a>
|
||||
</li>
|
||||
<li><a href="composer.html#composer.http_client.get_url_raw">get_url_raw() (in module composer.http_client)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.gfile">gfile() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitArchiveTarball">GitArchiveTarball (class in pylorax.api.gitrpm)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.server.GitLock">GitLock (class in pylorax.api.server)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitRpmBuild">GitRpmBuild (class in pylorax.api.gitrpm)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.group_names">group_names (pylorax.api.recipes.Recipe attribute)</a>
|
||||
</li>
|
||||
@ -568,6 +621,8 @@
|
||||
<li><a href="pylorax.html#pylorax.Lorax.init_file_logging">init_file_logging() (pylorax.Lorax method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.Lorax.init_stream_logging">init_stream_logging() (pylorax.Lorax method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.bisect.insort_left">insort_left() (in module pylorax.api.bisect)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install">install() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
|
||||
@ -585,8 +640,12 @@
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installkernel">installkernel() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installpkg">installpkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LiveTemplateRunner.installpkg">installpkg() (pylorax.ltmpl.LiveTemplateRunner method)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installpkg">(pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">installupgradeinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.is_commit_tag">is_commit_tag() (in module pylorax.api.recipes)</a>
|
||||
@ -614,6 +673,12 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.kernels">kernels (pylorax.treebuilder.TreeBuilder attribute)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.keyboard_cmd">keyboard_cmd() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.kpartx_disk_img">kpartx_disk_img() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
@ -621,6 +686,8 @@
|
||||
<h2 id="L">L</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.lang_cmd">lang_cmd() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ArchData.lib64_arches">lib64_arches (pylorax.ArchData attribute)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.sysutils.linktree">linktree() (in module pylorax.sysutils)</a>
|
||||
@ -630,21 +697,31 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.list_commit_files">list_commit_files() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.list_commits">list_commits() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LiveTemplateRunner">LiveTemplateRunner (class in pylorax.ltmpl)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.cmdline.lmc_parser">lmc_parser() (in module pylorax.cmdline)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">lock (pylorax.api.server.GitLock attribute)</a>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.DNFLock.lock">lock (pylorax.api.dnfbase.DNFLock attribute)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">(pylorax.api.server.GitLock attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.DNFLock.lock_check">lock_check (pylorax.api.dnfbase.DNFLock attribute)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.log">log() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogServer.log_check">log_check() (pylorax.monitor.LogServer method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.log_selinux_state">log_selinux_state() (in module pylorax)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogMonitor">LogMonitor (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler">LogRequestHandler (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogServer">LogServer (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.loop_attach">loop_attach() (in module pylorax.imgutils)</a>
|
||||
@ -682,12 +759,16 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.queue.make_compose">make_compose() (in module pylorax.api.queue)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.make_dnf_dirs">make_dnf_dirs() (in module pylorax.api.config)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.make_git_rpm">make_git_rpm() (in module pylorax.api.gitrpm)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.make_image">make_image() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.make_live_images">make_live_images() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.make_livecd">make_livecd() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.make_owned_dir">make_owned_dir() (in module pylorax.api.config)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.make_queue_dirs">make_queue_dirs() (in module pylorax.api.config)</a>
|
||||
</li>
|
||||
@ -706,11 +787,11 @@
|
||||
<li><a href="pylorax.html#pylorax.imgutils.mkext4img">mkext4img() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.mkfsimage">mkfsimage() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.mkfsimage_from_disk">mkfsimage_from_disk() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.mkfsimage_from_disk">mkfsimage_from_disk() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.mkhfsimg">mkhfsimg() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.mkqcow2">mkqcow2() (in module pylorax.imgutils)</a>
|
||||
@ -753,11 +834,13 @@
|
||||
<h2 id="N">N</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.installer.novirt_install">novirt_install() (in module pylorax.installer)</a>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.NewRecipeGit">NewRecipeGit() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.installer.novirt_log_check">novirt_log_check() (in module pylorax.installer)</a>
|
||||
<li><a href="pylorax.html#pylorax.installer.novirt_cancel_check">novirt_cancel_check() (in module pylorax.installer)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.installer.novirt_install">novirt_install() (in module pylorax.installer)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
@ -790,6 +873,8 @@
|
||||
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.perror">perror() (pylorax.base.BaseLoraxClass method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pinfo">pinfo() (pylorax.base.BaseLoraxClass method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.pkg_to_build">pkg_to_build() (in module pylorax.api.projects)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.pkg_to_dep">pkg_to_dep() (in module pylorax.api.projects)</a>
|
||||
</li>
|
||||
@ -842,10 +927,12 @@
|
||||
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pwarning">pwarning() (pylorax.base.BaseLoraxClass method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax">pylorax (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api">pylorax.api (module)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api">pylorax.api (module)</a>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.bisect">pylorax.api.bisect (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams (module)</a>
|
||||
</li>
|
||||
@ -860,6 +947,8 @@
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.dnfbase">pylorax.api.dnfbase (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.gitrpm">pylorax.api.gitrpm (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects (module)</a>
|
||||
</li>
|
||||
@ -888,6 +977,8 @@
|
||||
<li><a href="pylorax.html#module-pylorax.decorators">pylorax.decorators (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax.dnfbase">pylorax.dnfbase (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper (module)</a>
|
||||
</li>
|
||||
@ -960,6 +1051,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeError">RecipeError</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeFileError">RecipeFileError</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeGit">RecipeGit (class in pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeGroup">RecipeGroup (class in pylorax.api.recipes)</a>
|
||||
</li>
|
||||
@ -988,6 +1081,8 @@
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.repo">repo (pylorax.api.server.GitLock attribute)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.repo_file_exists">repo_file_exists() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.repo_to_ks">repo_to_ks() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
@ -1008,7 +1103,7 @@
|
||||
<li><a href="pylorax.html#pylorax.Lorax.run">run() (pylorax.Lorax method)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run">(pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.TemplateRunner.run">(pylorax.ltmpl.TemplateRunner method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="pylorax.html#pylorax.creator.run_creator">run_creator() (in module pylorax.creator)</a>
|
||||
@ -1031,6 +1126,8 @@
|
||||
<h2 id="S">S</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.services_cmd">services_cmd() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.executils.setenv">setenv() (in module pylorax.executils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler.setup">setup() (pylorax.monitor.LogRequestHandler method)</a>
|
||||
@ -1050,11 +1147,11 @@
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_cmd">sources_cmd() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_delete">sources_delete() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_info">sources_info() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_info">sources_info() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_list">sources_list() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.split_and_expand">split_and_expand() (in module pylorax.ltmpl)</a>
|
||||
@ -1090,6 +1187,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.v0.take_limits">take_limits() (in module pylorax.api.v0)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.Lorax.templatedir">templatedir (pylorax.Lorax attribute)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.TemplateRunner">TemplateRunner (class in pylorax.ltmpl)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.test_templates">test_templates() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
@ -1098,6 +1197,8 @@
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.timestamp.timestamp_dict">timestamp_dict() (in module pylorax.api.timestamp)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.timezone_cmd">timezone_cmd() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a>
|
||||
</li>
|
||||
@ -1186,8 +1287,12 @@
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.write_commit">write_commit() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.gitrpm.GitArchiveTarball.write_file">write_file() (pylorax.api.gitrpm.GitArchiveTarball method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_group">write_ks_group() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_root">write_ks_root() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_user">write_ks_user() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
@ -1212,7 +1317,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -1231,27 +1336,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 29.11 documentation</title>
|
||||
<title>Welcome to Lorax's documentation! — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -136,7 +135,7 @@
|
||||
|
||||
<li><a href="#">Docs</a> »</li>
|
||||
|
||||
<li>Welcome to Lorax’s documentation!</li>
|
||||
<li>Welcome to Lorax's documentation!</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
@ -156,7 +155,7 @@
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="welcome-to-lorax-s-documentation">
|
||||
<h1>Welcome to Lorax’s documentation!<a class="headerlink" href="#welcome-to-lorax-s-documentation" title="Permalink to this headline">¶</a></h1>
|
||||
<h1>Welcome to Lorax's documentation!<a class="headerlink" href="#welcome-to-lorax-s-documentation" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Contents:</p>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
@ -205,7 +204,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -224,27 +223,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Introduction to Lorax — Lorax 29.11 documentation</title>
|
||||
<title>Introduction to Lorax — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,13 +24,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Lorax" href="lorax.html" />
|
||||
<link rel="prev" title="Welcome to Lorax’s documentation!" href="index.html" />
|
||||
<link rel="prev" title="Welcome to Lorax's documentation!" href="index.html" />
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -167,14 +166,14 @@ of the iso for all of the supported architectures.</p>
|
||||
</div>
|
||||
<div class="section" id="before-lorax">
|
||||
<h1>Before Lorax<a class="headerlink" href="#before-lorax" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Tree building tools such as pungi and revisor rely on ‘buildinstall’ in
|
||||
<p>Tree building tools such as pungi and revisor rely on 'buildinstall' in
|
||||
anaconda/scripts/ to produce the boot images and other such control files
|
||||
in the final tree. The existing buildinstall scripts written in a mix of
|
||||
bash and Python are unmaintainable. Lorax is an attempt to replace them
|
||||
with something more flexible.</p>
|
||||
<p>EXISTING WORKFLOW:</p>
|
||||
<p>pungi and other tools call scripts/buildinstall, which in turn call other
|
||||
scripts to do the image building and data generation. Here’s how it
|
||||
scripts to do the image building and data generation. Here's how it
|
||||
currently looks:</p>
|
||||
<blockquote>
|
||||
<div><dl class="docutils">
|
||||
@ -201,7 +200,7 @@ maketreeinfo.py, makestamp.py, and buildinstall</li>
|
||||
First, almost all knowledge of what goes in to the stage 1 and stage 2
|
||||
images lives in upd-instroot. The mk-images* scripts copy things from the
|
||||
root created by upd-instroot in order to build the stage 1 image, though
|
||||
it’s not completely clear from reading the scripts.</p>
|
||||
it's not completely clear from reading the scripts.</p>
|
||||
<p>NEW IDEAS:</p>
|
||||
<p>Create a new central driver with all information living in Python modules.
|
||||
Configuration files will provide the knowledge previously contained in the
|
||||
@ -219,7 +218,7 @@ upd-instroot and mk-images* scripts.</p>
|
||||
<a href="lorax.html" class="btn btn-neutral float-right" title="Lorax" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="index.html" class="btn btn-neutral" title="Welcome to Lorax’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
<a href="index.html" class="btn btn-neutral" title="Welcome to Lorax's documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
@ -228,7 +227,7 @@ upd-instroot and mk-images* scripts.</p>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -247,27 +246,27 @@ upd-instroot and mk-images* scripts.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>livemedia-creator — Lorax 29.11 documentation</title>
|
||||
<title>livemedia-creator — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -113,7 +112,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="#tar-file-creation">TAR File Creation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#live-image-for-pxe-boot">Live Image for PXE Boot</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#atomic-live-image-for-pxe-boot">Atomic Live Image for PXE Boot</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#using-mock-and-no-virt-to-create-images">Using Mock and –no-virt to Create Images</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#using-mock-and-no-virt-to-create-images">Using Mock and --no-virt to Create Images</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#using-mock-and-qemu-to-create-images">Using Mock and qemu to Create Images</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#openstack-image-creation">OpenStack Image Creation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#docker-image-creation">Docker Image Creation</a></li>
|
||||
@ -211,7 +210,7 @@ OpenStack.</p>
|
||||
<p>The general idea is to use qemu with kickstart and an Anaconda boot.iso to
|
||||
install into a disk image and then use the disk image to create the bootable
|
||||
media.</p>
|
||||
<p>livemedia-creator –help will describe all of the options available. At the
|
||||
<p>livemedia-creator --help will describe all of the options available. At the
|
||||
minimum you need:</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">--make-iso</span></code> to create a final bootable .iso or one of the other <code class="docutils literal notranslate"><span class="pre">--make-*</span></code> options.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">--iso</span></code> to specify the Anaconda install media to use with qemu.</p>
|
||||
@ -227,7 +226,7 @@ you have the anaconda-tui package installed.</p>
|
||||
<h2>livemedia-creator cmdline arguments<a class="headerlink" href="#livemedia-creator-cmdline-arguments" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Create Live Install Media</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span>
|
||||
<span class="p">(</span><span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">disk</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">fsimage</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">appliance</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ami</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">pxe</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ostree</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">oci</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">vagrant</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">disk</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">fsimage</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">appliance</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ami</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span><span class="o">-</span><span class="n">disk</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">pxe</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ostree</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">oci</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">vagrant</span><span class="p">)</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">iso</span> <span class="n">ISO</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">iso</span><span class="o">-</span><span class="n">only</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">iso</span><span class="o">-</span><span class="n">name</span> <span class="n">ISO_NAME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">ks</span> <span class="n">KS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">only</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">virt</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">PROXY</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">anaconda</span><span class="o">-</span><span class="n">arg</span> <span class="n">ANACONDA_ARGS</span><span class="p">]</span>
|
||||
@ -235,11 +234,14 @@ you have the anaconda-tui package installed.</p>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">logfile</span> <span class="n">LOGFILE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">lorax</span><span class="o">-</span><span class="n">templates</span> <span class="n">LORAX_TEMPLATES</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">resultdir</span> <span class="n">RESULT_DIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">macboot</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">nomacboot</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">extra</span><span class="o">-</span><span class="n">boot</span><span class="o">-</span><span class="n">args</span> <span class="n">EXTRA_BOOT_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">disk</span><span class="o">-</span><span class="n">image</span> <span class="n">DISK_IMAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">keep</span><span class="o">-</span><span class="n">image</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">image</span> <span class="n">FS_IMAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">name</span> <span class="n">IMAGE_NAME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">label</span> <span class="n">FS_LABEL</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="nb">type</span> <span class="n">IMAGE_TYPE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">qemu</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">compression</span> <span class="n">COMPRESSION</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">tar</span><span class="o">-</span><span class="n">disk</span><span class="o">-</span><span class="n">name</span> <span class="n">TAR_DISK_NAME</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">label</span> <span class="n">FS_LABEL</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">size</span><span class="o">-</span><span class="n">align</span> <span class="n">IMAGE_SIZE_ALIGN</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="nb">type</span> <span class="n">IMAGE_TYPE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">qemu</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">compression</span> <span class="n">COMPRESSION</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">compress</span><span class="o">-</span><span class="n">arg</span> <span class="n">COMPRESS_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">name</span> <span class="n">APP_NAME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">template</span> <span class="n">APP_TEMPLATE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">file</span> <span class="n">APP_FILE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">ram</span> <span class="n">MEMORY</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">vcpus</span> <span class="n">VCPUS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">vnc</span> <span class="n">VNC</span><span class="p">]</span>
|
||||
@ -294,6 +296,12 @@ you have the anaconda-tui package installed.</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--make-tar-disk</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Build a tar of a partitioned disk image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--make-pxe-live</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Build a live pxe boot squashfs image</p>
|
||||
@ -320,12 +328,12 @@ you have the anaconda-tui package installed.</p>
|
||||
<td>Anaconda installation .iso path to use for qemu</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--iso-only</kbd></td>
|
||||
<td><p class="first">Remove all iso creation artifacts except the boot.iso, combine with –iso-name to rename the boot.iso</p>
|
||||
<td><p class="first">Remove all iso creation artifacts except the boot.iso, combine with --iso-name to rename the boot.iso</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--iso-name</kbd></td>
|
||||
<td>Name of output iso file for –iso-only. Default is boot.iso</td></tr>
|
||||
<td>Name of output iso file for --iso-only. Default is boot.iso</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--ks</kbd></td>
|
||||
<td>Kickstart file defining the install.</td></tr>
|
||||
@ -374,20 +382,26 @@ you have the anaconda-tui package installed.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--nomacboot</kbd></td>
|
||||
<td>Default: True</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--extra-boot-args</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Extra arguments to add to the bootloader kernel cmdline in the templates</p>
|
||||
<p class="last">Default: ""</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--title</kbd></td>
|
||||
<td><p class="first">Substituted for @TITLE@ in bootloader config files</p>
|
||||
<p class="last">Default: “Linux Live Media”</p>
|
||||
<p class="last">Default: "Linux Live Media"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--project</kbd></td>
|
||||
<td><p class="first">substituted for @PROJECT@ in bootloader config files</p>
|
||||
<p class="last">Default: “Linux”</p>
|
||||
<p class="last">Default: "Linux"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--releasever</kbd></td>
|
||||
<td><p class="first">substituted for @VERSION@ in bootloader config files</p>
|
||||
<p class="last">Default: “29”</p>
|
||||
<p class="last">Default: "29"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--volid</kbd></td>
|
||||
@ -401,7 +415,7 @@ you have the anaconda-tui package installed.</p>
|
||||
<td>Cancel installer after X minutes</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td>show program’s version number and exit</td></tr>
|
||||
<td>show program's version number and exit</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -425,14 +439,24 @@ you have the anaconda-tui package installed.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--image-name</kbd></td>
|
||||
<td>Name of output file to create. Used for tar, fs and disk image. Default is a random name.</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--tar-disk-name</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td>Name of the archive member for make-tar-disk.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--fs-label</kbd></td>
|
||||
<td><p class="first">Label to set on fsimage, default is ‘Anaconda’</p>
|
||||
<p class="last">Default: “Anaconda”</p>
|
||||
<td><p class="first">Label to set on fsimage, default is 'Anaconda'</p>
|
||||
<p class="last">Default: "Anaconda"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--image-size-align</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Create a disk image with a size that is a multiple of this value in MiB.</p>
|
||||
<p class="last">Default: 0</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--image-type</kbd></td>
|
||||
<td>Create an image with qemu-img. See qemu-img –help for supported formats.</td></tr>
|
||||
<td>Create an image with qemu-img. See qemu-img --help for supported formats.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--qemu-arg</kbd></td>
|
||||
<td><p class="first">Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img.</p>
|
||||
@ -451,7 +475,7 @@ you have the anaconda-tui package installed.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--compression</kbd></td>
|
||||
<td><p class="first">Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default.</p>
|
||||
<p class="last">Default: “xz”</p>
|
||||
<p class="last">Default: "xz"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--compress-arg</kbd></td>
|
||||
@ -476,7 +500,7 @@ you have the anaconda-tui package installed.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--app-file</kbd></td>
|
||||
<td><p class="first">Appliance template results file.</p>
|
||||
<p class="last">Default: “appliance.xml”</p>
|
||||
<p class="last">Default: "appliance.xml"</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -507,7 +531,7 @@ you have the anaconda-tui package installed.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--ovmf-path</kbd></td>
|
||||
<td><p class="first">Path to OVMF firmware</p>
|
||||
<p class="last">Default: “/usr/share/edk2/ovmf/”</p>
|
||||
<p class="last">Default: "/usr/share/edk2/ovmf/"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--virt-uefi</kbd></td>
|
||||
@ -522,7 +546,7 @@ you have the anaconda-tui package installed.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--with-rng</kbd></td>
|
||||
<td><p class="first">RNG device for QEMU (none for no RNG)</p>
|
||||
<p class="last">Default: “/dev/random”</p>
|
||||
<p class="last">Default: "/dev/random"</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -623,14 +647,14 @@ kickstart is used to customize the installed system in the same way that
|
||||
current spin-kickstarts do.</p>
|
||||
<p>livemedia-creator monitors the install process for problems by watching the
|
||||
install logs. They are written to the current directory or to the base
|
||||
directory specified by the –logfile command. You can also monitor the install
|
||||
directory specified by the --logfile command. You can also monitor the install
|
||||
by using a vnc client. This is recommended when first modifying a kickstart,
|
||||
since there are still places where Anaconda may get stuck without the log
|
||||
monitor catching it.</p>
|
||||
<p>The output from this process is a partitioned disk image. kpartx can be used
|
||||
to mount and examine it when there is a problem with the install. It can also
|
||||
be booted using kvm.</p>
|
||||
<p>When creating an iso the disk image’s / partition is copied into a formatted
|
||||
<p>When creating an iso the disk image's / partition is copied into a formatted
|
||||
filesystem image which is then used as the input to lorax for creation of the
|
||||
final media.</p>
|
||||
<p>The final image is created by lorax, using the templates in /usr/share/lorax/live/
|
||||
@ -639,7 +663,7 @@ templates are written using the Mako template system with some extra commands
|
||||
added by lorax.</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">The output from –make-iso includes the artifacts used to create the boot.iso;
|
||||
<p class="last">The output from --make-iso includes the artifacts used to create the boot.iso;
|
||||
the kernel, initrd, the squashfs filesystem, etc. If you only want the
|
||||
boot.iso you can pass <code class="docutils literal notranslate"><span class="pre">--iso-only</span></code> and the other files will be removed. You
|
||||
can also name the iso by using <code class="docutils literal notranslate"><span class="pre">--iso-name</span> <span class="pre">my-live.iso</span></code>.</p>
|
||||
@ -656,9 +680,9 @@ changes. Here are the steps I used to convert the Fedora XFCE spin.</p>
|
||||
<ol class="arabic">
|
||||
<li><p class="first">Flatten the xfce kickstart using ksflatten</p>
|
||||
</li>
|
||||
<li><p class="first">Add zerombr so you don’t get the disk init dialog</p>
|
||||
<li><p class="first">Add zerombr so you don't get the disk init dialog</p>
|
||||
</li>
|
||||
<li><p class="first">Add clearpart –all</p>
|
||||
<li><p class="first">Add clearpart --all</p>
|
||||
</li>
|
||||
<li><p class="first">Add swap partition</p>
|
||||
</li>
|
||||
@ -666,7 +690,7 @@ changes. Here are the steps I used to convert the Fedora XFCE spin.</p>
|
||||
</li>
|
||||
<li><p class="first">Add shutdown to the kickstart</p>
|
||||
</li>
|
||||
<li><p class="first">Add network –bootproto=dhcp –activate to activate the network
|
||||
<li><p class="first">Add network --bootproto=dhcp --activate to activate the network
|
||||
This works for F16 builds but for F15 and before you need to pass
|
||||
something on the cmdline that activate the network, like sshd:</p>
|
||||
<blockquote>
|
||||
@ -693,12 +717,12 @@ that you create to the %wheel group so that sudo works if you wanted to.</p>
|
||||
</li>
|
||||
<li><p class="first">Remove /etc/fstab in %post, dracut handles mounting the rootfs</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">cat</span> <span class="pre">/dev/null</span> <span class="pre">></span> <span class="pre">/dev/fstab</span></code></p>
|
||||
<p>Do this only for live iso’s, the filesystem will be mounted read only if
|
||||
<p>Do this only for live iso's, the filesystem will be mounted read only if
|
||||
there is no /etc/fstab</p>
|
||||
</li>
|
||||
<li><p class="first">Don’t delete initramfs files from /boot in %post</p>
|
||||
<li><p class="first">Don't delete initramfs files from /boot in %post</p>
|
||||
</li>
|
||||
<li><p class="first">When creating live iso’s you need to have, at least, these packages in the %package section::
|
||||
<li><p class="first">When creating live iso's you need to have, at least, these packages in the %package section::
|
||||
dracut-config-generic
|
||||
dracut-live
|
||||
-dracut-config-rescue
|
||||
@ -725,10 +749,10 @@ livemedia-creator like this:</p>
|
||||
packages will get cached, so your kickstart url would look like:</p>
|
||||
<blockquote>
|
||||
<div><code class="docutils literal notranslate"><span class="pre">url</span> <span class="pre">--url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"</span></code></div></blockquote>
|
||||
<p>You can also add an update repo, but don’t name it updates. Add –proxy to it
|
||||
<p>You can also add an update repo, but don't name it updates. Add --proxy to it
|
||||
as well. You can use all of the <a class="reference external" href="https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#chapter-2-kickstart-commands-in-fedora">kickstart commands</a> in your kickstart. Make sure there
|
||||
is only one <code class="docutils literal notranslate"><span class="pre">url</span></code> command, other repos have to use the <code class="docutils literal notranslate"><span class="pre">repo</span></code> command and cannot be
|
||||
named <code class="docutils literal notranslate"><span class="pre">updates</span></code> which is reserved for Anaconda’s use. eg.:</p>
|
||||
named <code class="docutils literal notranslate"><span class="pre">updates</span></code> which is reserved for Anaconda's use. eg.:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">url</span> <span class="o">--</span><span class="n">url</span><span class="o">=</span><span class="n">PRIMARY</span><span class="o">-</span><span class="n">REPO</span><span class="o">-</span><span class="n">URL</span> <span class="o">--</span><span class="n">proxy</span><span class="o">=</span><span class="n">PROXY</span><span class="o">-</span><span class="n">URL</span>
|
||||
<span class="n">repo</span> <span class="o">--</span><span class="n">name</span><span class="o">=</span><span class="s2">"repo1"</span> <span class="o">--</span><span class="n">baseurl</span><span class="o">=</span><span class="n">FIRST</span><span class="o">-</span><span class="n">REPO</span><span class="o">-</span><span class="n">URL</span> <span class="o">--</span><span class="n">proxy</span><span class="o">=</span><span class="n">PROXY</span><span class="o">-</span><span class="n">URL</span>
|
||||
<span class="n">repo</span> <span class="o">--</span><span class="n">name</span><span class="o">=</span><span class="s2">"repo2"</span> <span class="o">--</span><span class="n">baseurl</span><span class="o">=</span><span class="n">SECOND</span><span class="o">-</span><span class="n">REPO_URL</span> <span class="o">--</span><span class="n">proxy</span><span class="o">=</span><span class="n">PROXY</span><span class="o">-</span><span class="n">URL</span>
|
||||
@ -739,35 +763,39 @@ named <code class="docutils literal notranslate"><span class="pre">updates</span
|
||||
<div class="section" id="anaconda-image-install-no-virt">
|
||||
<h2>Anaconda image install (no-virt)<a class="headerlink" href="#anaconda-image-install-no-virt" title="Permalink to this headline">¶</a></h2>
|
||||
<p>You can create images without using qemu by passing <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> on the
|
||||
cmdline. This will use Anaconda’s directory install feature to handle the
|
||||
cmdline. This will use Anaconda's directory install feature to handle the
|
||||
install. There are a couple of things to keep in mind when doing this:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>It will be most reliable when building images for the same release that the
|
||||
host is running. Because Anaconda has expectations about the system it is
|
||||
running under you may encounter strange bugs if you try to build newer or
|
||||
older releases.</li>
|
||||
<li>Make sure selinux is set to permissive or disabled. It won’t install
|
||||
correctly with selinux set to enforcing yet.</li>
|
||||
<li>It may totally trash your host. So far I haven’t had this happen, but the
|
||||
<li>It may totally trash your host. So far I haven't had this happen, but the
|
||||
possibility exists that a bug in Anaconda could result in it operating on
|
||||
real devices. I recommend running it in a virt or on a system that you can
|
||||
afford to lose all data from.</li>
|
||||
</ol>
|
||||
<p>The logs from anaconda will be placed in an ./anaconda/ directory in either
|
||||
the current directory or in the directory used for –logfile</p>
|
||||
the current directory or in the directory used for --logfile</p>
|
||||
<p>Example cmdline:</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">livemedia-creator</span> <span class="pre">--make-iso</span> <span class="pre">--no-virt</span> <span class="pre">--ks=./fedora-livemedia.ks</span></code></p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">Using no-virt to create a partitioned disk image (eg. –make-disk or
|
||||
–make-vagrant) will only create disks usable on the host platform (BIOS
|
||||
<p class="last">Using no-virt to create a partitioned disk image (eg. --make-disk or
|
||||
--make-vagrant) will only create disks usable on the host platform (BIOS
|
||||
or UEFI). You can create BIOS partitioned disk images on UEFI by using
|
||||
virt.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">As of version 30.7 SELinux can be set to Enforcing. The current state is
|
||||
logged for debugging purposes and if there are SELinux denials they should
|
||||
be reported as a bug.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="ami-images">
|
||||
<h2>AMI Images<a class="headerlink" href="#ami-images" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Amazon EC2 images can be created by using the –make-ami switch and an appropriate
|
||||
<p>Amazon EC2 images can be created by using the --make-ami switch and an appropriate
|
||||
kickstart file. All of the work to customize the image is handled by the kickstart.
|
||||
The example currently included was modified from the cloud-kickstarts version so
|
||||
that it would work with livemedia-creator.</p>
|
||||
@ -778,7 +806,7 @@ that it would work with livemedia-creator.</p>
|
||||
</div>
|
||||
<div class="section" id="appliance-creation">
|
||||
<h2>Appliance Creation<a class="headerlink" href="#appliance-creation" title="Permalink to this headline">¶</a></h2>
|
||||
<p>livemedia-creator can now replace appliance-tools by using the –make-appliance
|
||||
<p>livemedia-creator can now replace appliance-tools by using the --make-appliance
|
||||
switch. This will create the partitioned disk image and an XML file that can be
|
||||
used with virt-image to setup a virtual system.</p>
|
||||
<p>The XML is generated using the Mako template from
|
||||
@ -797,16 +825,16 @@ Each entry has the following attributes:</p>
|
||||
<div><p><code class="docutils literal notranslate"><span class="pre">name</span></code>
|
||||
base name of the disk image file</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">format</span></code>
|
||||
“raw”</p>
|
||||
"raw"</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">checksum_type</span></code>
|
||||
“sha256”</p>
|
||||
"sha256"</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">checksum</span></code>
|
||||
sha256 checksum of the disk image</p>
|
||||
</div></blockquote>
|
||||
</dd>
|
||||
</dl>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">name</span></code>
|
||||
Name of appliance, from –app-name argument</p>
|
||||
Name of appliance, from --app-name argument</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">arch</span></code>
|
||||
Architecture</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">memory</span></code>
|
||||
@ -872,9 +900,9 @@ kickstart in docs/fedora-atomic-pxe-live-novirt.ks. This also works inside the
|
||||
mock environment.</p>
|
||||
</div>
|
||||
<div class="section" id="using-mock-and-no-virt-to-create-images">
|
||||
<h2>Using Mock and –no-virt to Create Images<a class="headerlink" href="#using-mock-and-no-virt-to-create-images" title="Permalink to this headline">¶</a></h2>
|
||||
<h2>Using Mock and --no-virt to Create Images<a class="headerlink" href="#using-mock-and-no-virt-to-create-images" title="Permalink to this headline">¶</a></h2>
|
||||
<p>As of lorax version 22.2 you can use livemedia-creator and anaconda version
|
||||
22.15 inside of a mock chroot with –make-iso and –make-fsimage.</p>
|
||||
22.15 inside of a mock chroot with --make-iso and --make-fsimage.</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">As of mock 1.3.4 you need to use <code class="docutils literal notranslate"><span class="pre">--old-chroot</span></code> with mock. Mock now defaults to using systemd-nspawn
|
||||
@ -992,26 +1020,26 @@ add <code class="docutils literal notranslate"><span class="pre">mknod</span> <s
|
||||
<div class="section" id="openstack-image-creation">
|
||||
<h2>OpenStack Image Creation<a class="headerlink" href="#openstack-image-creation" title="Permalink to this headline">¶</a></h2>
|
||||
<p>OpenStack supports partitioned disk images so <code class="docutils literal notranslate"><span class="pre">--make-disk</span></code> can be used to
|
||||
create images for importing into glance, OpenStack’s image storage component.
|
||||
create images for importing into glance, OpenStack's image storage component.
|
||||
You need to have access to an OpenStack provider that allows image uploads, or
|
||||
setup your own using the instructions from the <a class="reference external" href="https://www.rdoproject.org/Quickstart">RDO Project</a>.</p>
|
||||
<p>The example kickstart, fedora-openstack.ks, is only slightly different than the
|
||||
fedora-minimal.ks one. It adds the cloud-init and cloud-utils-growpart
|
||||
packages. OpenStack supports setting up the image using cloud-init, and
|
||||
cloud-utils-growpart will grow the image to fit the instance’s disk size.</p>
|
||||
cloud-utils-growpart will grow the image to fit the instance's disk size.</p>
|
||||
<p>Create a qcow2 image using the kickstart like this:</p>
|
||||
<blockquote>
|
||||
<div><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">livemedia-creator</span> <span class="pre">--make-disk</span> <span class="pre">--iso=/path/to/boot.iso</span> <span class="pre">--ks=/path/to/fedora-openstack.ks</span> <span class="pre">--image-type=qcow2</span></code></div></blockquote>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">On the RHEL7 version of lmc <code class="docutils literal notranslate"><span class="pre">--image-type</span></code> isn’t supported. You can only create a bare partitioned disk image.</p>
|
||||
<p class="last">On the RHEL7 version of lmc <code class="docutils literal notranslate"><span class="pre">--image-type</span></code> isn't supported. You can only create a bare partitioned disk image.</p>
|
||||
</div>
|
||||
<p>Import the resulting disk image into the OpenStack system, either via the web UI, or glance on the cmdline:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">glance</span> <span class="n">image</span><span class="o">-</span><span class="n">create</span> <span class="o">--</span><span class="n">name</span> <span class="s2">"fedora-openstack"</span> <span class="o">--</span><span class="ow">is</span><span class="o">-</span><span class="n">public</span> <span class="n">true</span> <span class="o">--</span><span class="n">disk</span><span class="o">-</span><span class="nb">format</span> <span class="n">qcow2</span> \
|
||||
<span class="o">--</span><span class="n">container</span><span class="o">-</span><span class="nb">format</span> <span class="n">bare</span> <span class="o">--</span><span class="n">file</span> <span class="o">./</span><span class="n">fedora</span><span class="o">-</span><span class="n">openstack</span><span class="o">.</span><span class="n">qcow2</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If qcow2 wasn’t used then <code class="docutils literal notranslate"><span class="pre">--disk-format</span></code> should be set to raw.</p>
|
||||
<p>If qcow2 wasn't used then <code class="docutils literal notranslate"><span class="pre">--disk-format</span></code> should be set to raw.</p>
|
||||
</div>
|
||||
<div class="section" id="docker-image-creation">
|
||||
<h2>Docker Image Creation<a class="headerlink" href="#docker-image-creation" title="Permalink to this headline">¶</a></h2>
|
||||
@ -1036,7 +1064,7 @@ OCI images using the following command:</p>
|
||||
<p>You must provide the config.json and runtime.json files to be included in the bundle,
|
||||
their specifications can be found <a class="reference external" href="https://github.com/opencontainers/specs">on the OCI github project</a>
|
||||
output will be in the results directory with a default name of bundle.tar.xz</p>
|
||||
<p>This will work with <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> and inside a mock since it doesn’t use any
|
||||
<p>This will work with <code class="docutils literal notranslate"><span class="pre">--no-virt</span></code> and inside a mock since it doesn't use any
|
||||
partitioned disk images.</p>
|
||||
</div>
|
||||
<div class="section" id="vagrant-image-creation">
|
||||
@ -1062,16 +1090,9 @@ use of partitioned disk images and qcow2.</p>
|
||||
<h2>Creating UEFI disk images with virt<a class="headerlink" href="#creating-uefi-disk-images-with-virt" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Partitioned disk images can only be created for the same platform as the host system (BIOS or
|
||||
UEFI). You can use virt to create BIOS images on UEFI systems, and it is also possible
|
||||
to create UEFI images on BIOS systems using OVMF. You first need to setup your system with
|
||||
the OVMF firmware. The details can be <a class="reference external" href="http://www.linux-kvm.org/page/OVMF">found here linux-kvm OVMF page</a>
|
||||
but it amounts to:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Download the firmware.repo from <a class="reference external" href="https://www.kraxel.org/repos/">Gerd Hoffmann</a> and install it
|
||||
in /etc/yum.repos.d/</li>
|
||||
<li>Install the edk2.git-ovmf-x64 package</li>
|
||||
<li>Copy /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd to /usr/share/OVMF/OVMF_CODE.fd</li>
|
||||
<li>Copy /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd to /usr/share/OVMF/OVMF_VARS.fd</li>
|
||||
</ol>
|
||||
to create UEFI images on BIOS systems using OVMF firmware and qemu.</p>
|
||||
<p>Install the lorax-lmc-virt package, this will install qemu and the OVMF
|
||||
firmware files.</p>
|
||||
<p>Now you can run livemedia-creator with <code class="docutils literal notranslate"><span class="pre">--virt-uefi</span></code> to boot and install using UEFI:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">disk</span> <span class="o">--</span><span class="n">virt</span><span class="o">-</span><span class="n">uefi</span> <span class="o">--</span><span class="n">iso</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">boot</span><span class="o">.</span><span class="n">iso</span> \
|
||||
<span class="o">--</span><span class="n">ks</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">fedora</span><span class="o">-</span><span class="n">minimal</span><span class="o">.</span><span class="n">ks</span>
|
||||
@ -1081,12 +1102,10 @@ in /etc/yum.repos.d/</li>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">part</span> <span class="o">/</span><span class="n">boot</span><span class="o">/</span><span class="n">efi</span> <span class="o">--</span><span class="n">fstype</span><span class="o">=</span><span class="s2">"efi"</span> <span class="o">--</span><span class="n">size</span><span class="o">=</span><span class="mi">500</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Or use <code class="docutils literal notranslate"><span class="pre">reqpart</span></code> in the kickstart and Anaconda will create the required partitions.</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">When using the resulting image with the current version of OVMF (edk2.git-ovmf-x64-0-20151103.b1295.ge5cffca)
|
||||
it will not boot automatically because there is a problem with the fallback path.
|
||||
You can boot it by entering the UEFI shell and running EFI/fedora/shim.efi and
|
||||
then using efibootmgr to setup the correct boot entry.</p>
|
||||
<p class="last">The --virt-uefi method is currently only supported on the x86_64 architecture.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="debugging-problems">
|
||||
@ -1110,7 +1129,7 @@ to the terminal and examine it by logging into the VM. eg.:</p>
|
||||
</div>
|
||||
<p>If it does get stuck the best way to cancel is to use kill -9 on the qemu pid,
|
||||
lmc will detect that the process died and cleanup.</p>
|
||||
<p>If lmc didn’t handle the cleanup for some reason you can do this:
|
||||
<p>If lmc didn't handle the cleanup for some reason you can do this:
|
||||
1. <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">umount</span> <span class="pre">/tmp/lmc-XXXX</span></code> to unmount the iso from its mountpoint.
|
||||
2. <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">/tmp/lmc-XXXX</span></code>
|
||||
3. <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">rm</span> <span class="pre">/var/tmp/lmc-disk-XXXXX</span></code> to remove the disk image.</p>
|
||||
@ -1156,7 +1175,7 @@ report bugs against the lorax component.</p>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -1175,27 +1194,27 @@ report bugs against the lorax component.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>lorax-composer — Lorax 29.11 documentation</title>
|
||||
<title>lorax-composer — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -89,6 +88,7 @@
|
||||
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="livemedia-creator.html">livemedia-creator</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">lorax-composer</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#important-things-to-note">Important Things To Note</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#logs">Logs</a></li>
|
||||
@ -104,18 +104,27 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="#packages-and-modules">[[packages]] and [[modules]]</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#groups">[[groups]]</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#customizations">Customizations</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-kernel">[customizations.kernel]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-sshkey">[[customizations.sshkey]]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-user">[[customizations.user]]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-group">[[customizations.group]]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-timezone">[customizations.timezone]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-locale">[customizations.locale]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-firewall">[customizations.firewall]</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#customizations-services">[customizations.services]</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#repos-git">[[repos.git]]</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#adding-output-types">Adding Output Types</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#example-add-partitioned-disk-support">Example: Add partitioned disk support</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#package-sources">Package Sources</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#package-sources">Package Sources</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#dvd-iso-package-source">DVD ISO Package Source</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="composer-cli.html">composer-cli</a></li>
|
||||
@ -197,11 +206,23 @@
|
||||
</table>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> is an API server that allows you to build disk images using
|
||||
<a class="reference internal" href="#blueprints">Blueprints</a> to describe the package versions to be installed into the image.
|
||||
It is compatible with the Weldr project’s bdcs-api REST protocol. More
|
||||
It is compatible with the Weldr project's bdcs-api REST protocol. More
|
||||
information on Weldr can be found <a class="reference external" href="http://www.weldr.io">on the Weldr blog</a>.</p>
|
||||
<p>Behind the scenes it uses <a class="reference external" href="livemedia-creator.html">livemedia-creator</a> and
|
||||
<a class="reference external" href="https://anaconda-installer.readthedocs.io/en/latest/">Anaconda</a> to handle the
|
||||
installation and configuration of the images.</p>
|
||||
<div class="section" id="important-things-to-note">
|
||||
<h2>Important Things To Note<a class="headerlink" href="#important-things-to-note" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li>As of version 30.7 SELinux can be set to Enforcing. The current state is
|
||||
logged for debugging purposes and if there are SELinux denials they should
|
||||
be reported as a bug.</li>
|
||||
<li>All image types lock the root account, except for live-iso. You will need to either
|
||||
use one of the <a class="reference internal" href="#customizations">Customizations</a> methods for setting a ssh key/password, install a
|
||||
package that creates a user, or use something like <cite>cloud-init</cite> to setup access at
|
||||
boot time.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="installation">
|
||||
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The best way to install <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> is to use <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">dnf</span> <span class="pre">install</span>
|
||||
@ -232,7 +253,7 @@ A new directory with correct permissions will be created the first time the serv
|
||||
socket activation at the same time. It is therefore recommended that you run it directly
|
||||
on the command line only for testing or development purposes. For real use or development
|
||||
of other projects that simply use the API, you should stick to socket activation only.</p>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">/path/to/blueprints/</span></code> directory is where the blueprints’ git repo will
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">/path/to/blueprints/</span></code> directory is where the blueprints' git repo will
|
||||
be created, and all the blueprints created with the <code class="docutils literal notranslate"><span class="pre">/api/v0/blueprints/new</span></code>
|
||||
route will be stored. If there are blueprint <code class="docutils literal notranslate"><span class="pre">.toml</span></code> files in the top level
|
||||
of the directory they will be imported into the blueprint git storage when
|
||||
@ -248,7 +269,6 @@ messages as well as extra debugging info and API requests.</p>
|
||||
<p>Some security related issues that you should be aware of before running <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>:</p>
|
||||
<ul class="simple">
|
||||
<li>One of the API server threads needs to retain root privileges in order to run Anaconda.</li>
|
||||
<li>SELinux must be set to Permissive or disabled to allow <code class="docutils literal notranslate"><span class="pre">livemedia-creator</span></code> to run Anaconda.</li>
|
||||
<li>Only allow authorized users access to the <code class="docutils literal notranslate"><span class="pre">weldr</span></code> group and socket.</li>
|
||||
</ul>
|
||||
<p>Since Anaconda kickstarts are used there is the possibility that a user could
|
||||
@ -263,6 +283,7 @@ images using <code class="docutils literal notranslate"><span class="pre">lorax-
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">log</span> <span class="n">LOG</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">mockfiles</span> <span class="n">MOCKFILES</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">sharedir</span> <span class="n">SHAREDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">c</span> <span class="n">CONFIG</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">releasever</span> <span class="n">STRING</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">PROXY</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">repos</span><span class="p">]</span>
|
||||
<span class="n">BLUEPRINTS</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
@ -287,40 +308,40 @@ images using <code class="docutils literal notranslate"><span class="pre">lorax-
|
||||
<tr><td class="option-group">
|
||||
<kbd>--socket</kbd></td>
|
||||
<td><p class="first">Path to the socket file to listen on</p>
|
||||
<p class="last">Default: “/run/weldr/api.socket”</p>
|
||||
<p class="last">Default: "/run/weldr/api.socket"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--user</kbd></td>
|
||||
<td><p class="first">User to use for reduced permissions</p>
|
||||
<p class="last">Default: “weldr”</p>
|
||||
<p class="last">Default: "root"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--group</kbd></td>
|
||||
<td><p class="first">Group to set ownership of the socket to</p>
|
||||
<p class="last">Default: “weldr”</p>
|
||||
<p class="last">Default: "weldr"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--log</kbd></td>
|
||||
<td><p class="first">Path to logfile (/var/log/lorax-composer/composer.log)</p>
|
||||
<p class="last">Default: “/var/log/lorax-composer/composer.log”</p>
|
||||
<p class="last">Default: "/var/log/lorax-composer/composer.log"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--mockfiles</kbd></td>
|
||||
<td><p class="first">Path to JSON files used for /api/mock/ paths (/var/tmp/bdcs-mockfiles/)</p>
|
||||
<p class="last">Default: “/var/tmp/bdcs-mockfiles/”</p>
|
||||
<p class="last">Default: "/var/tmp/bdcs-mockfiles/"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--sharedir</kbd></td>
|
||||
<td>Directory containing all the templates. Overrides config file sharedir</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td><p class="first">show program’s version number and exit</p>
|
||||
<td><p class="first">show program's version number and exit</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-c, --config</kbd></td>
|
||||
<td><p class="first">Path to lorax-composer configuration file.</p>
|
||||
<p class="last">Default: “/etc/lorax/composer.conf”</p>
|
||||
<p class="last">Default: "/etc/lorax/composer.conf"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--releasever</kbd></td>
|
||||
@ -328,11 +349,17 @@ images using <code class="docutils literal notranslate"><span class="pre">lorax-
|
||||
<tr><td class="option-group">
|
||||
<kbd>--tmp</kbd></td>
|
||||
<td><p class="first">Top level temporary directory</p>
|
||||
<p class="last">Default: “/var/tmp”</p>
|
||||
<p class="last">Default: "/var/tmp"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--proxy</kbd></td>
|
||||
<td>Set proxy for DNF, overrides configuration file setting.</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--no-system-repos</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Do not copy over system repos from /etc/yum.repos.d/ at startup</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -345,7 +372,7 @@ are owned by <code class="docutils literal notranslate"><span class="pre">root:w
|
||||
to control <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>.</p>
|
||||
<p>At startup the server will check for the correct permissions and
|
||||
ownership of a pre-existing directory, or it will create a new one if it
|
||||
doesn’t exist. The socket path and group owner’s name can be changed from the
|
||||
doesn't exist. The socket path and group owner's name can be changed from the
|
||||
cmdline by passing it the <code class="docutils literal notranslate"><span class="pre">--socket</span></code> and <code class="docutils literal notranslate"><span class="pre">--group</span></code> arguments.</p>
|
||||
<p>It will then drop root privileges for the API thread and run as the <code class="docutils literal notranslate"><span class="pre">weldr</span></code>
|
||||
user. The queue and compose thread still runs as root because it needs to be
|
||||
@ -379,7 +406,7 @@ when it is written to disk. It should be short and descriptive.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">version</span></code> is a <a class="reference external" href="https://semver.org/">semver compatible</a> version number. If
|
||||
a new blueprint is uploaded with the same <code class="docutils literal notranslate"><span class="pre">version</span></code> the server will
|
||||
automatically bump the PATCH level of the <code class="docutils literal notranslate"><span class="pre">version</span></code>. If the <code class="docutils literal notranslate"><span class="pre">version</span></code>
|
||||
doesn’t match it will be used as is. eg. Uploading a blueprint with <code class="docutils literal notranslate"><span class="pre">version</span></code>
|
||||
doesn't match it will be used as is. eg. Uploading a blueprint with <code class="docutils literal notranslate"><span class="pre">version</span></code>
|
||||
set to <code class="docutils literal notranslate"><span class="pre">0.1.0</span></code> when the existing blueprint <code class="docutils literal notranslate"><span class="pre">version</span></code> is <code class="docutils literal notranslate"><span class="pre">0.0.1</span></code> will
|
||||
result in the new blueprint being stored as <code class="docutils literal notranslate"><span class="pre">version</span> <span class="pre">0.1.0</span></code>.</p>
|
||||
<div class="section" id="packages-and-modules">
|
||||
@ -404,20 +431,35 @@ for selecting optional packages.</p>
|
||||
</div>
|
||||
<div class="section" id="customizations">
|
||||
<h3>Customizations<a class="headerlink" href="#customizations" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">[[customizations]]</span></code> section can be used to configure the hostname of the final image. eg.:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">customizations</span><span class="p">]]</span>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">[customizations]</span></code> section can be used to configure the hostname of the final image. eg.:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="p">]</span>
|
||||
<span class="n">hostname</span> <span class="o">=</span> <span class="s2">"baseimage"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This is optional and may be left out to use the defaults.</p>
|
||||
<div class="section" id="customizations-kernel">
|
||||
<h4>[customizations.kernel]<a class="headerlink" href="#customizations-kernel" title="Permalink to this headline">¶</a></h4>
|
||||
<p>This allows you to append arguments to the bootloader's kernel commandline. This will not have any
|
||||
effect on <code class="docutils literal notranslate"><span class="pre">tar</span></code> or <code class="docutils literal notranslate"><span class="pre">ext4-filesystem</span></code> images since they do not include a bootloader.</p>
|
||||
<p>For example:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">kernel</span><span class="p">]</span>
|
||||
<span class="n">append</span> <span class="o">=</span> <span class="s2">"nosmt=force"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="customizations-sshkey">
|
||||
<h4>[[customizations.sshkey]]<a class="headerlink" href="#customizations-sshkey" title="Permalink to this headline">¶</a></h4>
|
||||
<p>Set an existing user’s ssh key in the final image:</p>
|
||||
<p>Set an existing user's ssh key in the final image:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">customizations</span><span class="o">.</span><span class="n">sshkey</span><span class="p">]]</span>
|
||||
<span class="n">user</span> <span class="o">=</span> <span class="s2">"root"</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"PUBLIC SSH KEY"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The key will be added to the user’s authorized_keys file.</p>
|
||||
<p>The key will be added to the user's authorized_keys file.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last"><code class="docutils literal notranslate"><span class="pre">key</span></code> expects the entire content of <code class="docutils literal notranslate"><span class="pre">~/.ssh/id_rsa.pub</span></code></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="customizations-user">
|
||||
<h4>[[customizations.user]]<a class="headerlink" href="#customizations-user" title="Permalink to this headline">¶</a></h4>
|
||||
@ -437,6 +479,10 @@ All fields for this section are optional except for the <code class="docutils li
|
||||
</div>
|
||||
<p>If the password starts with <code class="docutils literal notranslate"><span class="pre">$6$</span></code>, <code class="docutils literal notranslate"><span class="pre">$5$</span></code>, or <code class="docutils literal notranslate"><span class="pre">$2b$</span></code> it will be stored as
|
||||
an encrypted password. Otherwise it will be treated as a plain text password.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last"><code class="docutils literal notranslate"><span class="pre">key</span></code> expects the entire content of <code class="docutils literal notranslate"><span class="pre">~/.ssh/id_rsa.pub</span></code></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="customizations-group">
|
||||
<h4>[[customizations.group]]<a class="headerlink" href="#customizations-group" title="Permalink to this headline">¶</a></h4>
|
||||
@ -447,6 +493,113 @@ an encrypted password. Otherwise it will be treated as a plain text password.</p
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="customizations-timezone">
|
||||
<h4>[customizations.timezone]<a class="headerlink" href="#customizations-timezone" title="Permalink to this headline">¶</a></h4>
|
||||
<p>Customizing the timezone and the NTP servers to use for the system:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">timezone</span><span class="p">]</span>
|
||||
<span class="n">timezone</span> <span class="o">=</span> <span class="s2">"US/Eastern"</span>
|
||||
<span class="n">ntpservers</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"0.north-america.pool.ntp.org"</span><span class="p">,</span> <span class="s2">"1.north-america.pool.ntp.org"</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The values supported by <code class="docutils literal notranslate"><span class="pre">timezone</span></code> can be listed by running <code class="docutils literal notranslate"><span class="pre">timedatectl</span> <span class="pre">list-timezones</span></code>.</p>
|
||||
<p>If no timezone is setup the system will default to using <cite>UTC</cite>. The ntp servers are also
|
||||
optional and will default to using the distribution defaults which are fine for most uses.</p>
|
||||
<p>In some image types there are already NTP servers setup, eg. Google cloud image, and they
|
||||
cannot be overridden because they are required to boot in the selected environment. But the
|
||||
timezone will be updated to the one selected in the blueprint.</p>
|
||||
</div>
|
||||
<div class="section" id="customizations-locale">
|
||||
<h4>[customizations.locale]<a class="headerlink" href="#customizations-locale" title="Permalink to this headline">¶</a></h4>
|
||||
<p>Customize the locale settings for the system:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">locale</span><span class="p">]</span>
|
||||
<span class="n">languages</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"en_US.UTF-8"</span><span class="p">]</span>
|
||||
<span class="n">keyboard</span> <span class="o">=</span> <span class="s2">"us"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The values supported by <code class="docutils literal notranslate"><span class="pre">languages</span></code> can be listed by running <code class="docutils literal notranslate"><span class="pre">localectl</span> <span class="pre">list-locales</span></code> from
|
||||
the command line.</p>
|
||||
<p>The values supported by <code class="docutils literal notranslate"><span class="pre">keyboard</span></code> can be listed by running <code class="docutils literal notranslate"><span class="pre">localectl</span> <span class="pre">list-keymaps</span></code> from
|
||||
the command line.</p>
|
||||
<p>Multiple languages can be added. The first one becomes the
|
||||
primary, and the others are added as secondary. One or the other of <code class="docutils literal notranslate"><span class="pre">languages</span></code>
|
||||
or <code class="docutils literal notranslate"><span class="pre">keyboard</span></code> must be included (or both) in the section.</p>
|
||||
</div>
|
||||
<div class="section" id="customizations-firewall">
|
||||
<h4>[customizations.firewall]<a class="headerlink" href="#customizations-firewall" title="Permalink to this headline">¶</a></h4>
|
||||
<p>By default the firewall blocks all access except for services that enable their ports explicitly,
|
||||
like <code class="docutils literal notranslate"><span class="pre">sshd</span></code>. This command can be used to open other ports or services. Ports are configured using
|
||||
the port:protocol format:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">firewall</span><span class="p">]</span>
|
||||
<span class="n">ports</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"22:tcp"</span><span class="p">,</span> <span class="s2">"80:tcp"</span><span class="p">,</span> <span class="s2">"imap:tcp"</span><span class="p">,</span> <span class="s2">"53:tcp"</span><span class="p">,</span> <span class="s2">"53:udp"</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Numeric ports, or their names from <code class="docutils literal notranslate"><span class="pre">/etc/services</span></code> can be used in the <code class="docutils literal notranslate"><span class="pre">ports</span></code> enabled/disabled lists.</p>
|
||||
<p>The blueprint settings extend any existing settings in the image templates, so if <code class="docutils literal notranslate"><span class="pre">sshd</span></code> is
|
||||
already enabled it will extend the list of ports with the ones listed by the blueprint.</p>
|
||||
<p>If the distribution uses <code class="docutils literal notranslate"><span class="pre">firewalld</span></code> you can specify services listed by <code class="docutils literal notranslate"><span class="pre">firewall-cmd</span> <span class="pre">--get-services</span></code>
|
||||
in a <code class="docutils literal notranslate"><span class="pre">customizations.firewall.services</span></code> section:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">services</span><span class="p">]</span>
|
||||
<span class="n">enabled</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"ftp"</span><span class="p">,</span> <span class="s2">"ntp"</span><span class="p">,</span> <span class="s2">"dhcp"</span><span class="p">]</span>
|
||||
<span class="n">disabled</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"telnet"</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Remember that the <code class="docutils literal notranslate"><span class="pre">firewall.services</span></code> are different from the names in <code class="docutils literal notranslate"><span class="pre">/etc/services</span></code>.</p>
|
||||
<p>Both are optional, if they are not used leave them out or set them to an empty list <code class="docutils literal notranslate"><span class="pre">[]</span></code>. If you
|
||||
only want the default firewall setup this section can be omitted from the blueprint.</p>
|
||||
<p>NOTE: The <code class="docutils literal notranslate"><span class="pre">Google</span></code> and <code class="docutils literal notranslate"><span class="pre">OpenStack</span></code> templates explicitly disable the firewall for their environment.
|
||||
This cannot be overridden by the blueprint.</p>
|
||||
</div>
|
||||
<div class="section" id="customizations-services">
|
||||
<h4>[customizations.services]<a class="headerlink" href="#customizations-services" title="Permalink to this headline">¶</a></h4>
|
||||
<p>This section can be used to control which services are enabled at boot time.
|
||||
Some image types already have services enabled or disabled in order for the
|
||||
image to work correctly, and cannot be overridden. eg. <code class="docutils literal notranslate"><span class="pre">ami</span></code> requires
|
||||
<code class="docutils literal notranslate"><span class="pre">sshd</span></code>, <code class="docutils literal notranslate"><span class="pre">chronyd</span></code>, and <code class="docutils literal notranslate"><span class="pre">cloud-init</span></code>. Without them the image will not
|
||||
boot. Blueprint services are added to, not replacing, the list already in the
|
||||
templates, if any.</p>
|
||||
<p>The service names are systemd service units. You may specify any systemd unit
|
||||
file accepted by <code class="docutils literal notranslate"><span class="pre">systemctl</span> <span class="pre">enable</span></code> eg. <code class="docutils literal notranslate"><span class="pre">cockpit.socket</span></code>:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">services</span><span class="p">]</span>
|
||||
<span class="n">enabled</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"sshd"</span><span class="p">,</span> <span class="s2">"cockpit.socket"</span><span class="p">,</span> <span class="s2">"httpd"</span><span class="p">]</span>
|
||||
<span class="n">disabled</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"postfix"</span><span class="p">,</span> <span class="s2">"telnetd"</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="repos-git">
|
||||
<h3>[[repos.git]]<a class="headerlink" href="#repos-git" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">[[repos.git]]</span></code> entries are used to add files from a <cite>git repository<https://git-scm.com/></cite>
|
||||
repository to the created image. The repository is cloned, the specified <code class="docutils literal notranslate"><span class="pre">ref</span></code> is checked out
|
||||
and an rpm is created to install the files to a <code class="docutils literal notranslate"><span class="pre">destination</span></code> path. The rpm includes a summary
|
||||
with the details of the repository and reference used to create it. The rpm is also included in the
|
||||
image build metadata.</p>
|
||||
<p>To create an rpm named <code class="docutils literal notranslate"><span class="pre">server-config-1.0-1.noarch.rpm</span></code> you would add this to your blueprint:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">repos</span><span class="o">.</span><span class="n">git</span><span class="p">]]</span>
|
||||
<span class="n">rpmname</span><span class="o">=</span><span class="s2">"server-config"</span>
|
||||
<span class="n">rpmversion</span><span class="o">=</span><span class="s2">"1.0"</span>
|
||||
<span class="n">rpmrelease</span><span class="o">=</span><span class="s2">"1"</span>
|
||||
<span class="n">summary</span><span class="o">=</span><span class="s2">"Setup files for server deployment"</span>
|
||||
<span class="n">repo</span><span class="o">=</span><span class="s2">"PATH OF GIT REPO TO CLONE"</span>
|
||||
<span class="n">ref</span><span class="o">=</span><span class="s2">"v1.0"</span>
|
||||
<span class="n">destination</span><span class="o">=</span><span class="s2">"/opt/server/"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li>rpmname: Name of the rpm to create, also used as the prefix name in the tar archive</li>
|
||||
<li>rpmversion: Version of the rpm, eg. "1.0.0"</li>
|
||||
<li>rpmrelease: Release of the rpm, eg. "1"</li>
|
||||
<li>summary: Summary string for the rpm</li>
|
||||
<li>repo: URL of the get repo to clone and create the archive from</li>
|
||||
<li>ref: Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</li>
|
||||
<li>destination: Path to install the / of the git repo at when installing the rpm</li>
|
||||
</ul>
|
||||
<p>An rpm will be created with the contents of the git repository referenced, with the files
|
||||
being installed under <code class="docutils literal notranslate"><span class="pre">/opt/server/</span></code> in this case.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">ref</span></code> can be any valid git reference for use with <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">archive</span></code>. eg. to use the head
|
||||
of a branch set it to <code class="docutils literal notranslate"><span class="pre">origin/branch-name</span></code>, a tag name, or a commit hash.</p>
|
||||
<p>Note that the repository is cloned in full each time a build is started, so pointing to a
|
||||
repository with a large amount of history may take a while to clone and use a significant
|
||||
amount of disk space. The clone is temporary and is removed once the rpm is created.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="adding-output-types">
|
||||
@ -495,7 +648,7 @@ the contents of the iso as well as the boot.iso itself.</p>
|
||||
</div>
|
||||
<div class="section" id="package-sources">
|
||||
<h2>Package Sources<a class="headerlink" href="#package-sources" title="Permalink to this headline">¶</a></h2>
|
||||
<p>By default lorax-composer uses the host’s configured repositories. It copies
|
||||
<p>By default lorax-composer uses the host's configured repositories. It copies
|
||||
the <code class="docutils literal notranslate"><span class="pre">*.repo</span></code> files from <code class="docutils literal notranslate"><span class="pre">/etc/yum.repos.d/</span></code> into
|
||||
<code class="docutils literal notranslate"><span class="pre">/var/lib/lorax/composer/repos.d/</span></code> at startup, these are immutable system
|
||||
repositories and cannot be deleted or changed. If you want to add additional
|
||||
@ -536,6 +689,41 @@ it returns JSON but it can also return TOML if <code class="docutils literal not
|
||||
<p>The configured sources are used for all blueprint depsolve operations, and for composing images.
|
||||
When adding additional sources you must make sure that the packages in the source do not
|
||||
conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
<div class="section" id="dvd-iso-package-source">
|
||||
<h3>DVD ISO Package Source<a class="headerlink" href="#dvd-iso-package-source" title="Permalink to this headline">¶</a></h3>
|
||||
<p>In some situations the system may want to <em>only</em> use a DVD iso as the package
|
||||
source, not the repos from the network. <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> and <code class="docutils literal notranslate"><span class="pre">anaconda</span></code>
|
||||
understand <code class="docutils literal notranslate"><span class="pre">file://</span></code> URLs so you can mount an iso on the host, and replace the
|
||||
system repo files with a configuration file pointing to the DVD.</p>
|
||||
<ul>
|
||||
<li><p class="first">Stop the <code class="docutils literal notranslate"><span class="pre">lorax-composer.service</span></code> if it is running</p>
|
||||
</li>
|
||||
<li><p class="first">Move the repo files in <code class="docutils literal notranslate"><span class="pre">/etc/yum.repos.d/</span></code> someplace safe</p>
|
||||
</li>
|
||||
<li><p class="first">Create a new <code class="docutils literal notranslate"><span class="pre">iso.repo</span></code> file in <code class="docutils literal notranslate"><span class="pre">/etc/yum.repos.d/</span></code>:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">iso</span><span class="p">]</span>
|
||||
<span class="n">name</span><span class="o">=</span><span class="n">iso</span>
|
||||
<span class="n">baseurl</span><span class="o">=</span><span class="n">file</span><span class="p">:</span><span class="o">///</span><span class="n">mnt</span><span class="o">/</span><span class="n">iso</span><span class="o">/</span>
|
||||
<span class="n">enabled</span><span class="o">=</span><span class="mi">1</span>
|
||||
<span class="n">gpgcheck</span><span class="o">=</span><span class="mi">1</span>
|
||||
<span class="n">gpgkey</span><span class="o">=</span><span class="n">file</span><span class="p">:</span><span class="o">///</span><span class="n">mnt</span><span class="o">/</span><span class="n">iso</span><span class="o">/</span><span class="n">RPM</span><span class="o">-</span><span class="n">GPG</span><span class="o">-</span><span class="n">KEY</span><span class="o">-</span><span class="n">redhat</span><span class="o">-</span><span class="n">release</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><p class="first">Remove all the cached repo files from <code class="docutils literal notranslate"><span class="pre">/var/lib/lorax/composer/repos/</span></code></p>
|
||||
</li>
|
||||
<li><p class="first">Restart the <code class="docutils literal notranslate"><span class="pre">lorax-composer.service</span></code></p>
|
||||
</li>
|
||||
<li><p class="first">Check the output of <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">status</span> <span class="pre">show</span></code> for any output specific depsolve errors.
|
||||
For example, the DVD usually does not include <code class="docutils literal notranslate"><span class="pre">grub2-efi-*-cdboot-*</span></code> so the live-iso image
|
||||
type will not be available.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>If you want to <em>add</em> the DVD source to the existing sources you can do that by
|
||||
mounting the iso and creating a source file to point to it as described in the
|
||||
<a class="reference internal" href="#package-sources">Package Sources</a> documentation. In that case there is no need to remove the other
|
||||
sources from <code class="docutils literal notranslate"><span class="pre">/etc/yum.repos.d/</span></code> or clear the cached repos.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -559,7 +747,7 @@ conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -578,27 +766,27 @@ conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Lorax — Lorax 29.11 documentation</title>
|
||||
<title>Lorax — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -187,7 +186,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>“I am the Lorax. I speak for the trees [and images].”</p>
|
||||
<p>"I am the Lorax. I speak for the trees [and images]."</p>
|
||||
<p>The <a class="reference external" href="https://github.com/rhinstaller/lorax">lorax</a> tool is used to create the
|
||||
<a class="reference external" href="https://github.com/rhinstaller/anaconda">Anaconda</a> installer boot.iso as
|
||||
well as the basic release tree, and .treeinfo metadata file. Its dependencies
|
||||
@ -211,7 +210,7 @@ repositories.</p>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">add</span><span class="o">-</span><span class="n">arch</span><span class="o">-</span><span class="n">template</span><span class="o">-</span><span class="n">var</span> <span class="n">ADD_ARCH_TEMPLATE_VARS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">noverify</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">sharedir</span> <span class="n">SHAREDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">enablerepo</span> <span class="p">[</span><span class="n">repo</span><span class="p">]]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">disablerepo</span> <span class="p">[</span><span class="n">repo</span><span class="p">]]</span> <span class="p">[</span><span class="o">--</span><span class="n">rootfs</span><span class="o">-</span><span class="n">size</span> <span class="n">ROOTFS_SIZE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">noverifyssl</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">dnfplugin</span> <span class="n">DNFPLUGINS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">noverifyssl</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">dnfplugin</span> <span class="n">DNFPLUGINS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">squashfs</span><span class="o">-</span><span class="n">only</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">dracut</span><span class="o">-</span><span class="n">arg</span> <span class="n">DRACUT_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span>
|
||||
<span class="n">OUTPUTDIR</span>
|
||||
</pre></div>
|
||||
@ -236,7 +235,7 @@ repositories.</p>
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td>show program’s version number and exit</td></tr>
|
||||
<td>show program's version number and exit</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -283,12 +282,12 @@ repositories.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-t, --variant</kbd></td>
|
||||
<td><p class="first">variant name</p>
|
||||
<p class="last">Default: “”</p>
|
||||
<p class="last">Default: ""</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-b, --bugurl</kbd></td>
|
||||
<td><p class="first">bug reporting URL for the product</p>
|
||||
<p class="last">Default: “your distribution provided bug reporting tool”</p>
|
||||
<p class="last">Default: "your distribution provided bug reporting tool"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--isfinal</kbd></td>
|
||||
@ -296,7 +295,7 @@ repositories.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-c, --config</kbd></td>
|
||||
<td><p class="first">config file</p>
|
||||
<p class="last">Default: “/etc/lorax/lorax.conf”</p>
|
||||
<p class="last">Default: "/etc/lorax/lorax.conf"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--proxy</kbd></td>
|
||||
@ -336,14 +335,14 @@ repositories.</p>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--tmp</kbd></td>
|
||||
<td><p class="first">Top level temporary directory</p>
|
||||
<p class="last">Default: “/var/tmp”</p>
|
||||
<p class="last">Default: "/var/tmp/lorax"</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--cachedir</kbd></td>
|
||||
<td>DNF cache directory. Default is a temporary dir.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--workdir</kbd></td>
|
||||
<td>Work directory, overrides –tmp. Default is a temporary dir under /var/tmp</td></tr>
|
||||
<td>Work directory, overrides --tmp. Default is a temporary dir under /var/tmp/lorax</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--force</kbd></td>
|
||||
<td><p class="first">Run even when the destination directory exists</p>
|
||||
@ -405,6 +404,12 @@ repositories.</p>
|
||||
<td><p class="first">Enable a DNF plugin by name/glob, or * to enable all of them.</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--squashfs-only</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Use a plain squashfs filesystem for the runtime.</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -476,7 +481,7 @@ unneeded services are disabled, some of which can interfere with the
|
||||
installation. A number of template commands are used here:</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append" title="pylorax.ltmpl.LoraxTemplateRunner.append"><code class="xref py py-func docutils literal notranslate"><span class="pre">append</span></code></a> to add text to a file.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="pylorax.ltmpl.LoraxTemplateRunner.chmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">chmod</span></code></a> changes the file’s mode.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="pylorax.ltmpl.LoraxTemplateRunner.chmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">chmod</span></code></a> changes the file's mode.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install" title="pylorax.ltmpl.LoraxTemplateRunner.install"><code class="xref py py-func docutils literal notranslate"><span class="pre">install</span></code></a> to install a file into the installroot.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="pylorax.ltmpl.LoraxTemplateRunner.mkdir"><code class="xref py py-func docutils literal notranslate"><span class="pre">mkdir</span></code></a> makes a new directory.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move" title="pylorax.ltmpl.LoraxTemplateRunner.move"><code class="xref py py-func docutils literal notranslate"><span class="pre">move</span></code></a> to move a file into the installroot</li>
|
||||
@ -489,14 +494,14 @@ installation. A number of template commands are used here:</p>
|
||||
</div>
|
||||
<div class="section" id="runtime-cleanup-tmpl">
|
||||
<h3>runtime-cleanup.tmpl<a class="headerlink" href="#runtime-cleanup-tmpl" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">runtime-cleanup.tmpl</span></code> template is used to remove files that aren’t strictly needed
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">runtime-cleanup.tmpl</span></code> template is used to remove files that aren't strictly needed
|
||||
by the installation environment. In addition to the <code class="docutils literal notranslate"><span class="pre">remove</span></code> template command it uses:</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="pylorax.ltmpl.LoraxTemplateRunner.removepkg"><code class="xref py py-func docutils literal notranslate"><span class="pre">removepkg</span></code></a>
|
||||
remove all of a specific package’s contents. A package may be pulled in as a dependency, but
|
||||
remove all of a specific package's contents. A package may be pulled in as a dependency, but
|
||||
not really used. eg. sound support.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="pylorax.ltmpl.LoraxTemplateRunner.removefrom"><code class="xref py py-func docutils literal notranslate"><span class="pre">removefrom</span></code></a>
|
||||
Removes some files from a package. A file glob can be used, or the –allbut option to
|
||||
Removes some files from a package. A file glob can be used, or the --allbut option to
|
||||
remove everything except a select few.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="pylorax.ltmpl.LoraxTemplateRunner.removekmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">removekmod</span></code></a>
|
||||
Removes kernel modules</li>
|
||||
@ -506,7 +511,7 @@ Removes kernel modules</li>
|
||||
<h3>The squashfs filesystem<a class="headerlink" href="#the-squashfs-filesystem" title="Permalink to this headline">¶</a></h3>
|
||||
<p>After <code class="docutils literal notranslate"><span class="pre">runtime-*.tmpl</span></code> templates have finished their work lorax creates an
|
||||
empty ext4 filesystem, copies the remaining files to it, and makes a squashfs
|
||||
filesystem of it. This file is the / of the boot.iso’s installer environment
|
||||
filesystem of it. This file is the / of the boot.iso's installer environment
|
||||
and is what is in the LiveOS/squashfs.img file on the iso.</p>
|
||||
</div>
|
||||
<div class="section" id="iso-creation">
|
||||
@ -552,7 +557,7 @@ should) select the specific template directory by passing <code class="docutils
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -571,27 +576,27 @@ should) select the specific template directory by passing <code class="docutils
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>src — Lorax 29.11 documentation</title>
|
||||
<title>src — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -192,6 +191,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html">pylorax.api package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.bisect">pylorax.api.bisect module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose module</a></li>
|
||||
@ -199,6 +199,7 @@
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.crossdomain">pylorax.api.crossdomain module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.dnfbase">pylorax.api.dnfbase module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.gitrpm">pylorax.api.gitrpm module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes module</a></li>
|
||||
@ -219,6 +220,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.creator">pylorax.creator module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.decorators">pylorax.decorators module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.executils">pylorax.executils module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils module</a></li>
|
||||
@ -257,7 +259,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -276,27 +278,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Product and Updates Images — Lorax 29.11 documentation</title>
|
||||
<title>Product and Updates Images — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -168,7 +167,7 @@ runtime. The x86, ppc, ppc64le and aarch64 templates all look for
|
||||
install chroot while creating the final install tree. If there are files in
|
||||
those directories lorax will create images/product.img and/or
|
||||
images/updates.img</p>
|
||||
<p>These archives are just like an anaconda updates image – their contents are
|
||||
<p>These archives are just like an anaconda updates image -- their contents are
|
||||
copied over the top of the filesystem at boot time so that you can drop in
|
||||
files to add to or replace anything on the filesystem.</p>
|
||||
<p>Anaconda has several places that it looks for updates, the one for product.img
|
||||
@ -200,7 +199,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -219,27 +218,27 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Python Module Index — Lorax 29.11 documentation</title>
|
||||
<title>Python Module Index — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -60,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -245,6 +244,11 @@
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api"><code class="xref">pylorax.api</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.bisect"><code class="xref">pylorax.api.bisect</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -280,6 +284,11 @@
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.errors"><code class="xref">pylorax.api.errors</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.gitrpm"><code class="xref">pylorax.api.gitrpm</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -350,6 +359,11 @@
|
||||
<td>   
|
||||
<a href="pylorax.html#module-pylorax.discinfo"><code class="xref">pylorax.discinfo</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.html#module-pylorax.dnfbase"><code class="xref">pylorax.dnfbase</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -418,7 +432,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -437,27 +451,27 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Search — Lorax 29.11 documentation</title>
|
||||
<title>Search — Lorax 29.28 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="#" />
|
||||
@ -57,7 +56,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.11
|
||||
29.28
|
||||
</div>
|
||||
|
||||
|
||||
@ -176,7 +175,7 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
© Copyright 2018, Red Hat, Inc.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
@ -195,28 +194,28 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="_static/searchtools.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.28',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="_static/searchtools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
File diff suppressed because one or more lines are too long
@ -208,10 +208,7 @@ install. There are a couple of things to keep in mind when doing this:
|
||||
running under you may encounter strange bugs if you try to build newer or
|
||||
older releases.
|
||||
|
||||
2. Make sure selinux is set to permissive or disabled. It won't install
|
||||
correctly with selinux set to enforcing yet.
|
||||
|
||||
3. It may totally trash your host. So far I haven't had this happen, but the
|
||||
2. It may totally trash your host. So far I haven't had this happen, but the
|
||||
possibility exists that a bug in Anaconda could result in it operating on
|
||||
real devices. I recommend running it in a virt or on a system that you can
|
||||
afford to lose all data from.
|
||||
@ -229,6 +226,10 @@ Example cmdline:
|
||||
or UEFI). You can create BIOS partitioned disk images on UEFI by using
|
||||
virt.
|
||||
|
||||
.. note::
|
||||
As of version 30.7 SELinux can be set to Enforcing. The current state is
|
||||
logged for debugging purposes and if there are SELinux denials they should
|
||||
be reported as a bug.
|
||||
|
||||
AMI Images
|
||||
----------
|
||||
@ -578,18 +579,10 @@ Creating UEFI disk images with virt
|
||||
|
||||
Partitioned disk images can only be created for the same platform as the host system (BIOS or
|
||||
UEFI). You can use virt to create BIOS images on UEFI systems, and it is also possible
|
||||
to create UEFI images on BIOS systems using OVMF. You first need to setup your system with
|
||||
the OVMF firmware. The details can be `found here linux-kvm OVMF page <http://www.linux-kvm.org/page/OVMF>`_
|
||||
but it amounts to:
|
||||
to create UEFI images on BIOS systems using OVMF firmware and qemu.
|
||||
|
||||
1. Download the firmware.repo from `Gerd Hoffmann <https://www.kraxel.org/repos/>`_ and install it
|
||||
in /etc/yum.repos.d/
|
||||
|
||||
2. Install the edk2.git-ovmf-x64 package
|
||||
|
||||
3. Copy /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd to /usr/share/OVMF/OVMF_CODE.fd
|
||||
|
||||
4. Copy /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd to /usr/share/OVMF/OVMF_VARS.fd
|
||||
Install the lorax-lmc-virt package, this will install qemu and the OVMF
|
||||
firmware files.
|
||||
|
||||
Now you can run livemedia-creator with ``--virt-uefi`` to boot and install using UEFI::
|
||||
|
||||
@ -600,11 +593,10 @@ Make sure that the kickstart you are using creates a /boot/efi partition by incl
|
||||
|
||||
part /boot/efi --fstype="efi" --size=500
|
||||
|
||||
Or use ``reqpart`` in the kickstart and Anaconda will create the required partitions.
|
||||
|
||||
.. note::
|
||||
When using the resulting image with the current version of OVMF (edk2.git-ovmf-x64-0-20151103.b1295.ge5cffca)
|
||||
it will not boot automatically because there is a problem with the fallback path.
|
||||
You can boot it by entering the UEFI shell and running EFI/fedora/shim.efi and
|
||||
then using efibootmgr to setup the correct boot entry.
|
||||
The --virt-uefi method is currently only supported on the x86_64 architecture.
|
||||
|
||||
|
||||
Debugging problems
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user