Change the VolumeManager Factory to be a context manager.
All code using VolumeManager was updated to the following
with statement:
with VolumeManager(...).new as volume_manager:
volume_manager.some_member()
This is related to Issue #2412
Setting sys.argv and global variables impacts tests such that
they cannot run in parallel. The little footprint of excluding
the --config global args test from the coverage is beneficial
to allow parallel test runs
Specifying a repository as part of the image description
allows for credentials via the username and password attributes.
Howver, repositories can also be specified on the commandline
via the --set-repo / --add-repo options. The options on the
commandline did not allow to specify credentials so far.
This commit adds the commandline options --set-repo-credentials
and --add-repo-credentials to support them
Like with --logfile this commit adds support for using
an existing Unix Domain Socket for logging. It's required
that there is a listener on the given socket otherwise
kiwi exits with an appropriate error message from the
socket layer. A simple listener could look like the
following:
```python
sock_file = '/tmp/log_socket'
buffer = 1024
if os.path.exists(sock_file):
os.unlink(sock_file)
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.bind(sock_file)
sock.listen(1)
while True:
connection, client_address = sock.accept()
try:
while True:
data = connection.recv(buffer)
if not data:
break
print(data.decode())
finally:
connection.close()
```
With the listener in place kiwi can be called as follows:
kiwi-ng --logsocket /tmp/log_socket ...
The modifications in this commit allows the unit tests
to run on both, pytest 6.x (nose test layout) and the new
pytest 7.x (xunit test layout). This Fixes#2072 in a
much nicer way. Thanks much to @smarlowucf
When building with kiwi a search on the kiwi main config
file is made inside of the given --description directory.
The search looks up for the file config.xml or *.kiwi.
So far there was no opportunity to specify another name.
This commit adds an option in the global area named:
--kiwi-file name
which will make kiwi to lookup this file inside of the
given --description directory and fail if it does not
exist. This Fixes#1973
Moving use of mkdtemp, NamedTemporaryFile and TemporaryDirectory
into its own class called Temporary: By default all temporary
data is created below /var/tmp but can be changed via the
global commandline option --temp-dir. This Fixes#1870
The option --target-arch allows to set the architecture
used to build the image. By default this is the host
architecture. Please note, if the specified architecture
name does not match the host architecture and is therefore
requesting a cross architecture image build, it's important
to understand that for this process to work a preparatory
step to support the image architecture and binary format
on the building host is required and is not considered a
responsibility of kiwi. There will be a followup effort
on providing a plugin for kiwi which should be used to
manage the needed binfmt settings for cross arch image
builds
when using kiwi as API the program fails with a usage message
from the Cli class. The kiwi.cli module should not be imported
except for kiwi comandline tasks. It has turned out that the
RuntimeConfig class which is used in several places in different
API classes imports Cli and creates an instance of it to check
for a global option. This causes major issues for all programs
which uses the kiwi API but not the command line interface because
the docopt call in Cli() expects a valid docstring which only
exists in kiwi's cli.py. This commit fixes the inconsistency
and allows people to use the kiwi API independent of any
command line interface. Fixes#1755
The optional kiwi runtime config file (kiwi.yml) could
only be read from ~/.config/kiwi/config.yml or /etc/kiwi.yml
This commits adds the global option --config which allows
to specify a custom runtime configuration as well.
The vmx type is auto converted into an oem type with rootfs
resize disabled such that all disk images can be handled
under one disk type. However people who run kiwi on the
commandline and have selected --type vmx before now end
with an error message saying that there is no vmx type
because it was converted into an oem type. To handle this
more gracefully this commit changes the commandline
option --type vmx into --type oem if provided and prints
a warning message.
A vmx image is the same disk as an oem just without the dracut
repart/resize feature. This difference is better handled with
an oemconfig parameter <oem-resize> which allows to switch resize
on or off. The extra image type vmx will be dropped and an XSLT
stylesheet automatically transforms a vmx description to be a
oem image with the resize feature switched off.
This Fixes#1425
Set kiwi.tasks to be the plugin entry point and register
existing task plugins in setup.py. Change the code in
cli.py to auto register plugins using the iter_entry_points
method from the pkg_resources class. This allows for easier
writing of external kiwi plugins.
Use raises as context manager instead of a method decorator.
This clearly identifies which code part is expected to raise
an exception. Related to Issue #1128
In addition to the 'kiwi --compat -- ...' style we also support calling
the kiwi compat mode as a service via 'kiwi compat ...' The preferred
way of calling kiwi with legacy options is via the new compat service.
Thus the documentation also changed to no longer mention the --compat
option but it still exists for compatibility reasons. Fixes#407
The meaning of the --ignore-repos option has changed back
to ignore all configured repositories. A new option
named --ignore-repos-used-for-build has been added which
allows to ignore all except imageonly repositories. The
command manual pages has been changed to document the
options. This Fixes#410
This commit adds --signing-key option which sets a key file to import
into the package manager trusted keys database. This commit adds this
flag support only for zypper.
Fixes#342
The system prepare and build commands now provides the
option --clear-cache which deletes all cache data
associated with the repositories to build the image.
This Fixes#341
nose is no longer maintained, thus we have to move to another
testing system. This commit updates the tox setup and all tests
to use pytest instead of nose.
The --compat call will trigger the call of the kiwicompat
tool written to support legacy kiwi commandlines. An example
could look like the following call:
sudo kiwi --compat -- --build /my/description --type vmx -d /my/dest
Please be aware the -- is required to tell docopt to treat all
options as parameters