Example #1
0
 def MountImage(self, image, mountpoint, options, live, shared):
     mount = Mount()
     mount.image = image
     mount.mountpoint = mountpoint
     args = self.Args()
     args.options = options
     args.live = live
     args.shared = shared
     self.atomic.set_args(args)
     return mount.mount()
Example #2
0
 def generate_validation_manifest(self):
     """
     Generates a gomtree validation manifest for a non-system image and stores it in
     ATOMIC_VAR_LIB
     :param:
     :return: None
     """
     _images = self.get_images(get_all=True)
     for image in _images:
         atomic_var_lib = util.ATOMIC_VAR_LIB
         if not image["RepoTags"]:
             continue
         iid = image["RepoTags"][0]
         if image["ImageType"] == "system":
             continue
         if iid == "<none>:<none>" or iid == "<none>":
             continue
         if os.path.exists(os.path.join(atomic_var_lib, "gomtree-manifests/%s.mtree" % iid)):
             continue
         manifestname = os.path.join(atomic_var_lib, "gomtree-manifests/%s.mtree" % iid)
         dname = os.path.dirname(manifestname)
         if not os.path.exists(dname):
             os.makedirs(dname)
         tmpdir = tempfile.mkdtemp()
         m = Mount()
         m.args = []
         m.image = iid
         m.mountpoint = tmpdir
         m.storage = self.args.storage
         m.mount()
         r = util.generate_validation_manifest(img_rootfs=tmpdir, keywords="type,uid,gid,mode,size,sha256digest")
         m.unmount()
         with open(manifestname,"w",0) as f:
             f.write(r.stdout)
         shutil.rmtree(tmpdir)
Example #3
0
 def UnmountImage(self, mountpoint):
     mount = Mount()
     mount.mountpoint = mountpoint
     return mount.unmount()