aboutsummaryrefslogtreecommitdiff
path: root/grs
diff options
context:
space:
mode:
Diffstat (limited to 'grs')
-rw-r--r--grs/Constants.py44
-rw-r--r--grs/Daemon.py2
-rw-r--r--grs/Execute.py3
-rw-r--r--grs/ISOIt.py31
-rw-r--r--grs/Interpret.py25
-rw-r--r--grs/Kernel.py13
-rw-r--r--grs/Log.py6
-rw-r--r--grs/MountDirectories.py8
-rw-r--r--grs/PivotChroot.py3
-rw-r--r--grs/Populate.py9
-rw-r--r--grs/Rotator.py6
-rw-r--r--grs/RunScript.py3
-rw-r--r--grs/Seed.py3
-rw-r--r--grs/Synchronize.py2
-rw-r--r--grs/TarIt.py4
-rw-r--r--grs/WorldConf.py2
16 files changed, 77 insertions, 87 deletions
diff --git a/grs/Constants.py b/grs/Constants.py
index 0025eb4..669f086 100644
--- a/grs/Constants.py
+++ b/grs/Constants.py
@@ -57,21 +57,21 @@ class Constants():
a GRS namespace.
"""
- def __init__(self, configfile = '/etc/grs/systems.conf'):
+ def __init__(self, configfile='/etc/grs/systems.conf'):
# If there's no config file, we're dead in the water.
if not os.path.isfile(configfile):
raise Exception('Configuration file %s not found\n' % configfile)
- self.config = configparser.ConfigParser(delimiters = ':', comment_prefixes = '#')
+ self.config = configparser.ConfigParser(delimiters=':', comment_prefixes='#')
self.config.read(configfile)
# These values will probably fail in the future, but that's okay
# because they really should never be used. They live outside of
# any GRS namespace and are just 'defaults'.
- server = 'http://distfiles.gentoo.org/'
- stagedir = 'releases/amd64/autobuilds/current-stage3-amd64-uclibc-hardened/'
+ server = 'http://distfiles.gentoo.org/'
+ stagedir = 'releases/amd64/autobuilds/current-stage3-amd64-uclibc-hardened/'
stagefile = 'stage3-amd64-uclibc-hardened-20150510.tar.bz2'
- default_stage_uri = server + stagedir + stagefile
+ default_stage_uri = server + stagedir + stagefile
# This is the space of all possible constants for any given GRS namespace
space = {
@@ -129,7 +129,7 @@ class Constants():
# Don't retrieve the original else you can overwrite it,
# rather deep copy it.
- def __getattr__(self, key, value = None):
+ def __getattr__(self, key, value=None):
if key in self.__dict__:
return deepcopy(self.__dict__[key])
@@ -143,26 +143,26 @@ class Constants():
CONST = Constants()
# Constants outside any GRS namespace.
-CONST.PACKAGE_NAME = "Gentoo Reference System"
-CONST.PACKAGE_VERSION = 0.0
+CONST.PACKAGE_NAME = "Gentoo Reference System"
+CONST.PACKAGE_VERSION = 0.0
CONST.PACKAGE_DESCRIPTION = "Update a GRS by cloning a predefined system."
-CONST.BUG_REPORTS = 'http://bugs.gentoo.org'
+CONST.BUG_REPORTS = 'http://bugs.gentoo.org'
# The are defaults in case objects of other classes which depend on values
# of libdir, logfile, etc. are instantiated outside of any namespaces.
# They should not be needed under normal working condidtions.
-CONST.LIBDIR = '/var/lib/grs'
-CONST.LOGFILE = '/var/log/grs.log'
-CONST.TMPDIR = '/var/tmp/grs'
-CONST.WORKDIR = '/var/tmp/grs/work'
-CONST.PACKAGE = '/var/tmp/grs/package'
-CONST.KERNELROOT = '/var/tmp/grs/kernel'
-CONST.PORTAGE_CONFIGROOT = '/var/tmp/grs/system'
-CONST.PIDFILE = '/run/grs.pid'
+CONST.LIBDIR = '/var/lib/grs'
+CONST.LOGFILE = '/var/log/grs.log'
+CONST.TMPDIR = '/var/tmp/grs'
+CONST.WORKDIR = '/var/tmp/grs/work'
+CONST.PACKAGE = '/var/tmp/grs/package'
+CONST.KERNELROOT = '/var/tmp/grs/kernel'
+CONST.PORTAGE_CONFIGROOT = '/var/tmp/grs/system'
+CONST.PIDFILE = '/run/grs.pid'
# These are used by grsup and are hard coded values.
-CONST.PORTAGE_CONFIGDIR = '/etc/portage'
-CONST.PORTAGE_DIRTYFILE = '/etc/portage/.grs_dirty'
-CONST.WORLD_CONFIG = '/etc/grs/world.conf'
-CONST.GRS_CGROUP = 'grs'
-CONST.GRS_CGROUPDIR = '/sys/fs/cgroup/grs'
+CONST.PORTAGE_CONFIGDIR = '/etc/portage'
+CONST.PORTAGE_DIRTYFILE = '/etc/portage/.grs_dirty'
+CONST.WORLD_CONFIG = '/etc/grs/world.conf'
+CONST.GRS_CGROUP = 'grs'
+CONST.GRS_CGROUPDIR = '/sys/fs/cgroup/grs'
diff --git a/grs/Daemon.py b/grs/Daemon.py
index 58927f8..79aaa42 100644
--- a/grs/Daemon.py
+++ b/grs/Daemon.py
@@ -84,7 +84,7 @@ class Daemon:
# No matter where the exit is initiated, eg from Execute.py
# we are sure that atexit() will run and delete the pidfile.
atexit.register(self.delpid)
- with open(self.pidfile,'w') as pf:
+ with open(self.pidfile, 'w') as pf:
pf.write('%d\n' % os.getpid())
diff --git a/grs/Execute.py b/grs/Execute.py
index 355fbe8..1220a53 100644
--- a/grs/Execute.py
+++ b/grs/Execute.py
@@ -27,8 +27,7 @@ from grs.Constants import CONST
class Execute():
""" Execute a shell command """
- def __init__(self, cmd, timeout = 1, extra_env = {}, failok = False, shell = False, \
- logfile = CONST.LOGFILE):
+ def __init__(self, cmd, timeout=1, extra_env={}, failok=False, shell=False, logfile=CONST.LOGFILE):
""" Execute a shell command.
cmd - Simple string of the command to be execute as a
diff --git a/grs/ISOIt.py b/grs/ISOIt.py
index a8973c6..d5a410c 100644
--- a/grs/ISOIt.py
+++ b/grs/ISOIt.py
@@ -26,8 +26,7 @@ from grs.HashIt import HashIt
class ISOIt(HashIt):
""" Create a bootable ISO of the system. """
- def __init__(self, name, libdir = CONST.LIBDIR, tmpdir = CONST.TMPDIR, \
- portage_configroot = CONST.PORTAGE_CONFIGROOT, logfile = CONST.LOGFILE):
+ def __init__(self, name, libdir=CONST.LIBDIR, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
self.libdir = libdir
self.tmpdir = tmpdir
self.portage_configroot = portage_configroot
@@ -43,12 +42,12 @@ class ISOIt(HashIt):
def initramfs(self, isoboot_dir):
""" TODO """
# Paths to where we'll build busybox and the initramfs.
- busybox_root = os.path.join(self.tmpdir, 'busybox')
- busybox_path = os.path.join(busybox_root, 'bin/busybox')
+ busybox_root = os.path.join(self.tmpdir, 'busybox')
+ busybox_path = os.path.join(busybox_root, 'bin/busybox')
makeprofile_path = os.path.join(busybox_root, 'etc/portage/make.profile')
- savedconfig_dir = os.path.join(busybox_root, 'etc/portage/savedconfig/sys-apps')
+ savedconfig_dir = os.path.join(busybox_root, 'etc/portage/savedconfig/sys-apps')
savedconfig_path = os.path.join(savedconfig_dir, 'busybox')
- busybox_config = os.path.join(self.libdir, 'scripts/busybox-config')
+ busybox_config = os.path.join(self.libdir, 'scripts/busybox-config')
# Remove any old busybox build directory and prepare new one.
shutil.rmtree(busybox_root, ignore_errors=True)
@@ -58,15 +57,13 @@ class ISOIt(HashIt):
# Emerge busybox.
os.symlink('/usr/portage/profiles/hardened/linux/amd64', makeprofile_path)
cmd = 'emerge --nodeps -1q busybox'
- emerge_env = { 'USE' : '-* savedconfig', 'ROOT' : busybox_root,
- 'PORTAGE_CONFIGROOT' : busybox_root }
+ emerge_env = {'USE' : '-* savedconfig', 'ROOT' : busybox_root, 'PORTAGE_CONFIGROOT' : busybox_root}
Execute(cmd, timeout=600, extra_env=emerge_env, logfile=self.logfile)
# Remove any old initramfs root and prepare a new one.
initramfs_root = os.path.join(self.tmpdir, 'initramfs')
shutil.rmtree(initramfs_root, ignore_errors=True)
- root_paths = ['bin', 'dev', 'etc', 'mnt/cdrom', 'mnt/squashfs', 'mnt/tmpfs',
- 'proc', 'sbin', 'sys', 'tmp', 'usr/bin', 'usr/sbin', 'var', 'var/run']
+ root_paths = ['bin', 'dev', 'etc', 'mnt/cdrom', 'mnt/squashfs', 'mnt/tmpfs', 'proc', 'sbin', 'sys', 'tmp', 'usr/bin', 'usr/sbin', 'var', 'var/run']
for p in root_paths:
d = os.path.join(initramfs_root, p)
os.makedirs(d, mode=0o755, exist_ok=True)
@@ -98,12 +95,12 @@ class ISOIt(HashIt):
os.chdir(cwd)
- def isoit(self, alt_name = None):
+ def isoit(self, alt_name=None):
# Create the ISO with the default name unless an alt_name is given.
if alt_name:
self.medium_name = '%s-%s%s%s.iso' % (alt_name, self.year, self.month, self.day)
self.digest_name = '%s.DIGESTS' % self.medium_name
- iso_dir = os.path.join(self.tmpdir, 'iso')
+ iso_dir = os.path.join(self.tmpdir, 'iso')
isoboot_dir = os.path.join(iso_dir, 'boot')
isogrub_dir = os.path.join(isoboot_dir, 'grub')
shutil.rmtree(iso_dir, ignore_errors=True)
@@ -114,7 +111,7 @@ class ISOIt(HashIt):
# 2. Move the kernel image into the iso/boot directory.
# TODO: we are assuming a static kernel
- kernelimage_dir = os.path.join(self.portage_configroot, 'boot')
+ kernelimage_dir = os.path.join(self.portage_configroot, 'boot')
kernelimage_path = os.path.join(kernelimage_dir, 'kernel')
shutil.copy(kernelimage_path, isoboot_dir)
# If this fails, we'll have to rebuild the kernel!
@@ -127,17 +124,17 @@ class ISOIt(HashIt):
Execute(cmd, timeout=None, logfile=self.logfile)
# 4. Emerge grub:0 to grab stage2_eltorito
- grub_root = os.path.join(self.tmpdir, 'grub')
+ grub_root = os.path.join(self.tmpdir, 'grub')
eltorito_path = os.path.join(grub_root, 'boot/grub/stage2_eltorito')
- menulst_path = os.path.join(self.libdir, 'scripts/menu.lst')
+ menulst_path = os.path.join(self.libdir, 'scripts/menu.lst')
cmd = 'emerge --nodeps -1q grub:0'
- emerge_env = { 'USE' : '-* savedconfig', 'ROOT' : grub_root }
+ emerge_env = {'USE' : '-* savedconfig', 'ROOT' : grub_root}
Execute(cmd, timeout=600, extra_env=emerge_env, logfile=self.logfile)
shutil.copy(eltorito_path, isogrub_dir)
shutil.copy(menulst_path, isogrub_dir)
# 5. Create the iso image. This can take a long time.
- args = '-R ' # Rock Ridge protocol
+ args = '-R ' # Rock Ridge protocol
args += '-b boot/grub/stage2_eltorito ' # El Torito boot image
args += '-no-emul-boot ' # No disk emulation for El Torito
args += '-boot-load-size 4 ' # 4x512-bit sectors for no-emulation mode
diff --git a/grs/Interpret.py b/grs/Interpret.py
index b99fd35..fd36650 100644
--- a/grs/Interpret.py
+++ b/grs/Interpret.py
@@ -79,7 +79,7 @@ class Interpret(Daemon):
sys.exit(signum + 128)
- def smartlog(l, obj, has_obj = True):
+ def smartlog(l, obj, has_obj=True):
""" This logs whether or not we have a grammatically incorrect
directive, or we are doing a mock run, and returns whether
or not we should execute the directive:
@@ -103,20 +103,19 @@ class Interpret(Daemon):
# Register the signals to terminate the entire process cgroup
- signal.signal(signal.SIGINT, handler)
+ signal.signal(signal.SIGINT, handler)
signal.signal(signal.SIGTERM, handler)
# Grab all the GRS namespace variables
- repo_uri = CONST.repo_uris[self.run_number]
- stage_uri = CONST.stage_uris[self.run_number]
-
- name = CONST.names[self.run_number]
- libdir = CONST.libdirs[self.run_number]
- logfile = CONST.logfiles[self.run_number]
- tmpdir = CONST.tmpdirs[self.run_number]
- workdir = CONST.workdirs[self.run_number]
- package = CONST.packages[self.run_number]
- kernelroot = CONST.kernelroots[self.run_number]
+ repo_uri = CONST.repo_uris[self.run_number]
+ stage_uri = CONST.stage_uris[self.run_number]
+ name = CONST.names[self.run_number]
+ libdir = CONST.libdirs[self.run_number]
+ logfile = CONST.logfiles[self.run_number]
+ tmpdir = CONST.tmpdirs[self.run_number]
+ workdir = CONST.workdirs[self.run_number]
+ package = CONST.packages[self.run_number]
+ kernelroot = CONST.kernelroots[self.run_number]
portage_configroot = CONST.portage_configroots[self.run_number]
# Initialize all the classes that will run the directives from
@@ -190,7 +189,7 @@ class Interpret(Daemon):
try:
m = re.search('(\S+)\s+(\S+)', l)
verb = m.group(1)
- obj = m.group(2)
+ obj = m.group(2)
except AttributeError:
verb = l.strip()
obj = None
diff --git a/grs/Kernel.py b/grs/Kernel.py
index 7ec5615..559aa57 100644
--- a/grs/Kernel.py
+++ b/grs/Kernel.py
@@ -27,8 +27,7 @@ from grs.Execute import Execute
class Kernel():
""" Build a linux-image pkg and install when building a system. """
- def __init__(self, libdir = CONST.LIBDIR, portage_configroot = CONST.PORTAGE_CONFIGROOT, \
- kernelroot = CONST.KERNELROOT, package = CONST.PACKAGE, logfile = CONST.LOGFILE):
+ def __init__(self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, kernelroot=CONST.KERNELROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE):
self.libdir = libdir
self.portage_configroot = portage_configroot
self.kernelroot = kernelroot
@@ -80,10 +79,10 @@ class Kernel():
# Prepare the paths to where we'll emerge and build the kernel,
# as well as paths for genkernel.
kernel_source = os.path.join(self.kernelroot, 'usr/src/linux')
- image_dir = os.path.join(self.kernelroot, gentoo_version)
- boot_dir = os.path.join(image_dir, 'boot')
- modprobe_dir = os.path.join(image_dir, 'etc/modprobe.d')
- modules_dir = os.path.join(image_dir, 'lib/modules')
+ image_dir = os.path.join(self.kernelroot, gentoo_version)
+ boot_dir = os.path.join(image_dir, 'boot')
+ modprobe_dir = os.path.join(image_dir, 'etc/modprobe.d')
+ modules_dir = os.path.join(image_dir, 'lib/modules')
# Prepare tarball filename and path. If the tarball already exists,
# don't rebuild/reinstall it. Note: It should have been installed to
# the system's portage configroot when it was first built, so no need
@@ -101,7 +100,7 @@ class Kernel():
# emerge the kernel source.
cmd = 'emerge --nodeps -1n %s' % pkg_name
- emerge_env = { 'USE' : 'symlink', 'ROOT' : self.kernelroot, 'ACCEPT_KEYWORDS' : '**' }
+ emerge_env = {'USE' : 'symlink', 'ROOT' : self.kernelroot, 'ACCEPT_KEYWORDS' : '**'}
Execute(cmd, timeout=600, extra_env=emerge_env, logfile=self.logfile)
# Build and install the image outside the portage configroot so
diff --git a/grs/Log.py b/grs/Log.py
index 7bca4f4..aa49b12 100644
--- a/grs/Log.py
+++ b/grs/Log.py
@@ -12,13 +12,13 @@ from grs.Rotator import Rotator
class Log(Rotator):
""" Initilize logs, log messages, or rotate logs. """
- def __init__(self, logfile = CONST.LOGFILE):
+ def __init__(self, logfile=CONST.LOGFILE):
self.logfile = logfile
# Make sure the log directory exists
os.makedirs(os.path.dirname(self.logfile), exist_ok=True)
open(self.logfile, 'a').close()
- def log(self, msg, stamped = True):
+ def log(self, msg, stamped=True):
# If requested, stamp a log message with the unix time.
if stamped:
current_time = datetime.datetime.now(datetime.timezone.utc)
@@ -28,7 +28,7 @@ class Log(Rotator):
f.write('%s\n' % msg)
- def rotate_logs(self, upper_limit = 20):
+ def rotate_logs(self, upper_limit=20):
# Rotate all the previous logs
self.full_rotate(self.logfile, upper_limit=upper_limit)
open(self.logfile, 'a').close()
diff --git a/grs/MountDirectories.py b/grs/MountDirectories.py
index 37d0f5e..692c320 100644
--- a/grs/MountDirectories.py
+++ b/grs/MountDirectories.py
@@ -26,17 +26,17 @@ class MountDirectories():
portage configroot.
"""
- def __init__(self, portage_configroot = CONST.PORTAGE_CONFIGROOT, \
- package = CONST.PACKAGE, logfile = CONST.LOGFILE):
+ def __init__(self, portage_configroot=CONST.PORTAGE_CONFIGROOT, \
+ package=CONST.PACKAGE, logfile=CONST.LOGFILE):
# The order is respected. Note that 'dev' needs to be mounted beore 'dev/pts'.
self.directories = [
'dev',
'dev/pts',
- { 'dev/shm' : ( 'tmpfs', 'shm' ) },
+ {'dev/shm' : ('tmpfs', 'shm')},
'proc',
'sys',
'usr/portage',
- [ package, 'usr/portage/packages' ]
+ [package, 'usr/portage/packages']
]
# Once initiated, we only work with one portage_configroot
self.portage_configroot = portage_configroot
diff --git a/grs/PivotChroot.py b/grs/PivotChroot.py
index 962f8fa..6324b6e 100644
--- a/grs/PivotChroot.py
+++ b/grs/PivotChroot.py
@@ -29,8 +29,7 @@ from grs.Rotator import Rotator
class PivotChroot(Rotator):
""" Move an inner chroot out to the new system portage configroot. """
- def __init__(self, tmpdir = CONST.TMPDIR, portage_configroot = CONST.PORTAGE_CONFIGROOT, \
- logfile = CONST.LOGFILE):
+ def __init__(self, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
self.tmpdir = tmpdir
self.portage_configroot = portage_configroot
self.logfile = logfile
diff --git a/grs/Populate.py b/grs/Populate.py
index fc7e799..a1822ee 100644
--- a/grs/Populate.py
+++ b/grs/Populate.py
@@ -27,29 +27,28 @@ class Populate():
for a particular cycle number.
"""
- def __init__(self, libdir = CONST.LIBDIR, workdir = CONST.WORKDIR, \
- portage_configroot = CONST.PORTAGE_CONFIGROOT, logfile = CONST.LOGFILE):
+ def __init__(self, libdir=CONST.LIBDIR, workdir=CONST.WORKDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
self.libdir = libdir
self.workdir = workdir
self.portage_configroot = portage_configroot
self.logfile = logfile
- def populate(self, cycle = True):
+ def populate(self, cycle=True):
""" Copy the core files from the GRS repo, to a local workdir and
then to the system's portage configroot, selecting for a paricular
cycle number.
"""
# rsync from the GRS repo to the workdir, removing the .git directory
cmd = 'rsync -av --delete --exclude=\'.git*\' %s/core/ %s' % (self.libdir, self.workdir)
- Execute(cmd, timeout=60, logfile = self.logfile)
+ Execute(cmd, timeout=60, logfile=self.logfile)
# Select the cycle
if cycle: self.select_cycle(cycle)
# Copy from the workdir to the system's portage configroot.
cmd = 'rsync -av %s/ %s' % (self.workdir, self.portage_configroot)
- Execute(cmd, timeout=60, logfile = self. logfile)
+ Execute(cmd, timeout=60, logfile=self.logfile)
def select_cycle(self, cycle):
diff --git a/grs/Rotator.py b/grs/Rotator.py
index faa49aa..a1282b2 100644
--- a/grs/Rotator.py
+++ b/grs/Rotator.py
@@ -24,7 +24,7 @@ import shutil
class Rotator():
""" Super class for rotating files or directories. """
- def rotate(self, obj, upper_limit = 20):
+ def rotate(self, obj, upper_limit=20):
""" Does the work of rotating objects fitting the pattern obj.(d+).
obj -> The absolute path to the objects to be rotated. The
@@ -63,8 +63,8 @@ class Rotator():
shutil.move(current_obj, next_obj)
- def full_rotate(self, obj, upper_limit = 20):
+ def full_rotate(self, obj, upper_limit=20):
""" Rotate both obj and obj.(d+). """
- self.rotate(obj, upper_limit = upper_limit)
+ self.rotate(obj, upper_limit=upper_limit)
if os.path.exists(obj):
shutil.move(obj, '%s.0' % obj)
diff --git a/grs/RunScript.py b/grs/RunScript.py
index bd8d4f9..3818fa1 100644
--- a/grs/RunScript.py
+++ b/grs/RunScript.py
@@ -24,8 +24,7 @@ from grs.Execute import Execute
class RunScript():
""" Run a script within the chroot. """
- def __init__(self, libdir = CONST.LIBDIR, portage_configroot = CONST.PORTAGE_CONFIGROOT,
- logfile = CONST.LOGFILE):
+ def __init__(self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
self.libdir = libdir
self.portage_configroot = portage_configroot
self.logfile = logfile
diff --git a/grs/Seed.py b/grs/Seed.py
index ec6fb77..7978d12 100644
--- a/grs/Seed.py
+++ b/grs/Seed.py
@@ -30,8 +30,7 @@ from grs.Rotator import Rotator
class Seed(Rotator):
""" Download a stage tarball and unpack it into an empty system portage configroot. """
- def __init__(self, stage_uri, tmpdir = CONST.TMPDIR, portage_configroot = \
- CONST.PORTAGE_CONFIGROOT, package = CONST.PACKAGE, logfile = CONST.LOGFILE):
+ def __init__(self, stage_uri, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE):
self.stage_uri = stage_uri
self.portage_configroot = portage_configroot
self.package = package
diff --git a/grs/Synchronize.py b/grs/Synchronize.py
index 3890196..3ce7d5c 100644
--- a/grs/Synchronize.py
+++ b/grs/Synchronize.py
@@ -23,7 +23,7 @@ from grs.Execute import Execute
class Synchronize():
""" Either clone or pull a remote git repository for a GRS system. """
- def __init__(self, remote_repo, branch, libdir = CONST.LIBDIR, logfile = CONST.LOGFILE):
+ def __init__(self, remote_repo, branch, libdir=CONST.LIBDIR, logfile=CONST.LOGFILE):
self.remote_repo = remote_repo
self.branch = branch
self.local_repo = libdir
diff --git a/grs/TarIt.py b/grs/TarIt.py
index d421cf2..b3d3b32 100644
--- a/grs/TarIt.py
+++ b/grs/TarIt.py
@@ -25,7 +25,7 @@ from grs.HashIt import HashIt
class TarIt(HashIt):
""" Create a tarball of the system. """
- def __init__(self, name, portage_configroot = CONST.PORTAGE_CONFIGROOT, logfile = CONST.LOGFILE):
+ def __init__(self, name, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
self.portage_configroot = portage_configroot
self.logfile = logfile
# Prepare a year, month and day for a tarball name timestamp.
@@ -36,7 +36,7 @@ class TarIt(HashIt):
self.digest_name = '%s.DIGESTS' % self.medium_name
- def tarit(self, alt_name = None):
+ def tarit(self, alt_name=None):
# Create the tarball with the default name unless an alt_name is given.
if alt_name:
self.medium_name = '%s-%s%s%s.tar.xz' % (alt_name, self.year, self.month, self.day)
diff --git a/grs/WorldConf.py b/grs/WorldConf.py
index 5930d19..c5882bf 100644
--- a/grs/WorldConf.py
+++ b/grs/WorldConf.py
@@ -68,7 +68,7 @@ class WorldConf():
"""
# We need to look at all portage provide pkgs and all installed pkgs.
portdb = portage.db[portage.root]["porttree"].dbapi
- vardb = portage.db[portage.root]["vartree"].dbapi
+ vardb = portage.db[portage.root]["vartree"].dbapi
# Remove all installed pkgs from the set of all portage packages.
uninstalled = portdb.cp_all()