def get_modules_dir(self):
        modules_dir = os.path.join(self.base.conf.installroot,
                                   self.base.conf.modulesdir.lstrip("/"))

        ensure_dir(modules_dir)

        return modules_dir
Пример #2
0
 def prep_mounts(self):
     # What filesystems hold the packages we're gonna use?
     mountinfo = libmount.Table('/proc/self/mountinfo')
     pkg_dirs = set(dirname(p) for p in self.cli.state.read_packagelist())
     pkg_mounts = set(mountinfo.find_mountpoint(path) for path in pkg_dirs)
     # Write mount units for everything the upgrade will need.
     # (it's OK if they're redundant - systemd will sort it out.)
     ensure_dir(MOUNT_UNIT_DIR)
     for mnt in pkg_mounts:
         write_mount_unit(mnt)
Пример #3
0
 def prep_mounts(self):
     # What filesystems hold the packages we're gonna use?
     mountinfo = libmount.Table('/proc/self/mountinfo')
     pkg_dirs = set(dirname(p) for p in self.cli.state.read_packagelist())
     pkg_mounts = set(mountinfo.find_mountpoint(path) for path in pkg_dirs)
     # Write mount units for everything the upgrade will need.
     # (it's OK if they're redundant - systemd will sort it out.)
     ensure_dir(MOUNT_UNIT_DIR)
     for mnt in pkg_mounts:
         write_mount_unit(mnt)
Пример #4
0
 def write(self):
     ensure_dir(os.path.dirname(self.statefile))
     with open(self.statefile, 'w') as outf:
         self._conf.write(outf)