summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael E Brown <mebrown@michaels-house.net>2007-12-16 23:17:47 -0600
committerMichael E Brown <mebrown@michaels-house.net>2007-12-16 23:17:47 -0600
commitad0f44c3c74bae3c020bbed280d07fefd621fe2c (patch)
tree10645ce01f50fabf6329d837e77f879f9765c727
parentb03c8e8a1459f01f8f6b583df3af6c6b168f82a5 (diff)
make rootdir private (_rootdir). Use accessor in mock.py as well.
-rwxr-xr-xpy/mock.py6
-rw-r--r--py/mock/backend.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/py/mock.py b/py/mock.py
index 0f25184..1c8a3aa 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -493,7 +493,7 @@ def main(ret):
if config_opts['internal_setarch']:
mock.util.condPersonality(config_opts['target_arch'])
cmd = ' '.join(args)
- status = os.system("PS1='mock-chroot> ' /usr/sbin/chroot %s %s" % (chroot.rootdir, cmd))
+ status = os.system("PS1='mock-chroot> ' /usr/sbin/chroot %s %s" % (chroot.makeChrootPath(), cmd))
ret['exitStatus'] = os.WEXITSTATUS(status)
finally:
@@ -540,7 +540,7 @@ def main(ret):
do_rebuild(config_opts, chroot, args)
elif options.mode == 'orphanskill':
- mock.util.orphansKill(chroot.rootdir)
+ mock.util.orphansKill(chroot.makeChrootPath())
elif options.mode == 'copyin':
chroot.tryLockBuildRoot()
chroot._resetLogging()
@@ -621,7 +621,7 @@ if __name__ == '__main__':
log.exception(exc)
if killOrphans and retParams:
- mock.util.orphansKill(retParams["chroot"].rootdir)
+ mock.util.orphansKill(retParams["chroot"].makeChrootPath())
logging.shutdown()
sys.exit(exitStatus)
diff --git a/py/mock/backend.py b/py/mock/backend.py
index 42f396f..2176a22 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -39,7 +39,7 @@ class Root(object):
self.basedir = os.path.join(config['basedir'], root)
self.target_arch = config['target_arch']
- self.rootdir = os.path.join(self.basedir, 'root')
+ self._rootdir = os.path.join(self.basedir, 'root')
self.homedir = config['chroothome']
self.builddir = os.path.join(self.homedir, 'build')
@@ -143,10 +143,10 @@ class Root(object):
decorate(traceLog())
def makeChrootPath(self, *args):
- '''For safety reasons, self.rootdir should not be used directly. Instead
+ '''For safety reasons, self._rootdir should not be used directly. Instead
use this handy helper function anytime you want to reference a path in
relation to the chroot.'''
- tmp = self.rootdir + "/" + "/".join(args)
+ tmp = self._rootdir + "/" + "/".join(args)
return tmp.replace("//", "/")
decorate(traceLog())