returning True was translated to an error and the process would not
exit with 0.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #401
Approved by: rhatdan
GI raises `ValueError` apparently, not `ImportError`. So rework
things to be nested and handle the cases of:
- No GI
- GI but no OSTree
- OSTree
Closes: #400
Approved by: giuseppe
I don't feel comfortable with running test_storage.sh on my
development machine, so enable it only with ENABLE_DESTRUCTIVE=1.
Tests are marked to be destructive with an inline tag ":destructive-test".
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #392
Approved by: jlebon
When you run atomic images, we now indicate which images
have been used by a container. The indicator is the
'>' character and it preceeds the image name in the listing.
Also improved some output problems with long repository names.
Updated atomic images man page to reflect this change.
Closes: #394
Approved by: rhatdan
Convert /ostree -> /sysroot/ostree as runc doesn't like symlinks in
the path to the bundle
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #396
Approved by: rhatdan
Previously, with the understanding we would be shipping a single
generic scanner configuration file, would 1) install the config
file and we had preset a default scanner in atomic.conf.
With the realization that the scanner could be variable based
on the distribution, the generic file is not longer installed
by default. Therefore, we should probably not set a default.
The prior code failed if a default was not defined in
/etc/atomic.conf. That code check has been altered and we now
adhere to the following rules:
* If no default is defined AND there is only one configured
scanner, we assume the single scanner IS the default.
* If no default is defined AND there are multiple scanners, we
error out and ask the user to define one.
* If there is a default defined, good to go!
Closes: #383
Approved by: rhatdan
Change it to work more similarly to Docker images, so that the same
code paths can be used to print the list.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #390
Approved by: baude
Introduce a new "manifest.json" file where it is possible to store
more information related to the system container.
A first need of this file is to store default values when
--set=NAME=VALUE is not provided.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #389
Approved by: rhatdan
atomic modify can be used to add devices to the storage backend.
It can also be used to switch the backend storage driver.
Closes: #385
Approved by: rhatdan
Use an xattr to store what drivers is used to manage the mountpoint.
This is important because OSTree containers are simply bind mount to
the rootfs of the container already checked out on the file system,
while images are checked out and must be "rm -rf" when unmounted.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #377
Approved by: jlebon
If not storage is specified, ostree is assumed.
Also fix an error message.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #384
Approved by: rhatdan
Eventually we will not ship any default scanner configurations. Previous
code relied on there always being one (default) defined so improved
error messages and a conditional check was in order.
Closes: #380
Approved by: rhatdan
https://bugzilla.redhat.com/show_bug.cgi?id=1323165#c2 suggests
that atomic install does not deal with non-ascii input very
well. I believe this addresses the concerns with the proper
UTF-8 encode and decode operations.
Closes: #374
Approved by: rhatdan
https://github.com/projectatomic/atomic/issues/378 points out that
when an rpm diff is done with --names-only, the output messaging was
not clear enough. Reworked the man page, --help, and output message
to clarify that when --names-only is used, it only compares RPMs
based on names and NOT versions.
Nice find by Micah.
Closes: #381
Approved by: rhatdan
Currently we do not catch all exceptions, since we setup the Atomic
class before the try block. This patch moves all of the parser
creation into its own function. And wraps all calls in a try block.
Closes: #376
Approved by: rhatdan
Also moved atomic migrate to atomic storage.
Currently we support
atomic storage export
atomic storage import
atomic storage reset
Closes: #365
Approved by: rhatdan
Add the ability for atomic scan to deal with chroots on the host's
filesystem. You can now pass a list of chroots to --rootfs and your
scanner will process them as if they were containers or images. This
works with VMs too.
$ sudo virt-filesystems -d rhel7
/dev/sda1
/dev/sdb1
/dev/sdb2
/dev/rhel/home
/dev/rhel/root
$ sudo guestmount -d rhel7 -m /dev/rhel/root --ro /tmp/rhel
$ sudo ./atomic scan --rootfs /tmp/rhel
...
Updated the man pages for atomic scan as well as it had fallen out of
date.
Small update that makes sure the host's os.environ is passed into
scanning container.
Closes: #371
Approved by: rhatdan
The Python default is to keep all FDs open, which is how Unix
traditionally worked. This default behavior is particularly
problematic for the atomic command, which e.g. may
hold a reference to the Docker socket, and we don't
necessarily want to give that reference to all
child processes.
This patch changes most calls to subprocess to be through
util package. And the util subprocess calls all close_fds=True.
Closes: #370
Approved by: cgwalters