mirror of
https://github.com/projectatomic/atomic.git
synced 2026-02-06 12:45:57 +01:00
syscontainers: drop support for OSTree < 2016.8
Assume OSTree is new enough that `checkout_at` is present. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #979 Approved by: rhatdan
This commit is contained in:
committed by
Atomic Bot
parent
b80d73124a
commit
2f136bbe47
@@ -94,32 +94,13 @@ class SystemContainers(object):
|
||||
return OSTREE_PRESENT
|
||||
|
||||
def _checkout_layer(self, repo, rootfs_fd, rootfs, rev):
|
||||
# ostree 2016.8 has a glib introspection safe API for checkout, use it
|
||||
# when available.
|
||||
if hasattr(repo, "checkout_at"):
|
||||
options = OSTree.RepoCheckoutAtOptions() # pylint: disable=no-member
|
||||
options.overwrite_mode = OSTree.RepoCheckoutOverwriteMode.UNION_FILES
|
||||
options.process_whiteouts = True
|
||||
options.disable_fsync = True
|
||||
if self.user:
|
||||
options.mode = OSTree.RepoCheckoutMode.USER
|
||||
repo.checkout_at(options, rootfs_fd, rootfs, rev)
|
||||
else:
|
||||
if self.user:
|
||||
user = ["--user-mode"]
|
||||
else:
|
||||
user = []
|
||||
util.check_call(["ostree", "--repo=%s" % self.get_ostree_repo_location(),
|
||||
"checkout",
|
||||
"--union"] +
|
||||
user +
|
||||
["--whiteouts",
|
||||
"--fsync=no",
|
||||
rev,
|
||||
rootfs],
|
||||
stdin=DEVNULL,
|
||||
stdout=DEVNULL,
|
||||
stderr=DEVNULL)
|
||||
options = OSTree.RepoCheckoutAtOptions() # pylint: disable=no-member
|
||||
options.overwrite_mode = OSTree.RepoCheckoutOverwriteMode.UNION_FILES
|
||||
options.process_whiteouts = True
|
||||
options.disable_fsync = True
|
||||
if self.user:
|
||||
options.mode = OSTree.RepoCheckoutMode.USER
|
||||
repo.checkout_at(options, rootfs_fd, rootfs, rev)
|
||||
|
||||
def set_args(self, args):
|
||||
self.args = args
|
||||
|
||||
Reference in New Issue
Block a user