From f978d80d138a916b2287cb5b42cf7f72a182f775 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 19 Jun 2012 15:34:55 +0100 Subject: app: rename setup_proc to setup_mounts This change is purely cosmetic, but reflects the fact that we need to mount more than just proc sometimes. --- morphlib/builder2.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'morphlib/builder2.py') diff --git a/morphlib/builder2.py b/morphlib/builder2.py index e534168d..f9c2e894 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -136,7 +136,7 @@ class BuilderBase(object): def __init__(self, app, staging_area, local_artifact_cache, remote_artifact_cache, artifact, repo_cache, - build_env, max_jobs, setup_proc): + build_env, max_jobs, setup_mounts): self.app = app self.staging_area = staging_area self.local_artifact_cache = local_artifact_cache @@ -146,7 +146,7 @@ class BuilderBase(object): self.build_env = build_env self.max_jobs = max_jobs self.build_watch = morphlib.stopwatch.Stopwatch() - self.setup_proc = setup_proc + self.setup_mounts = setup_mounts def save_build_times(self): '''Write the times captured by the stopwatch''' @@ -262,7 +262,7 @@ class ChunkBuilder(BuilderBase): def mount_proc(self): # pragma: no cover logging.debug('Mounting /proc in staging area') path = os.path.join(self.staging_area.dirname, 'proc') - if os.path.exists(path) and self.setup_proc: + if os.path.exists(path) and self.setup_mounts: self.app.runcmd(['mount', '-t', 'proc', 'none', path]) return path else: @@ -271,7 +271,7 @@ class ChunkBuilder(BuilderBase): return None def umount_proc(self, mounted): # pragma: no cover - if (mounted and self.setup_proc and mounted and + if (mounted and self.setup_mounts and mounted and os.path.exists(os.path.join(mounted, 'self'))): logging.error('Unmounting /proc in staging area: %s' % mounted) morphlib.fsutils.unmount(self.app.runcmd, mounted) @@ -645,7 +645,7 @@ class Builder(object): # pragma: no cover def __init__(self, app, staging_area, local_artifact_cache, remote_artifact_cache, repo_cache, build_env, max_jobs, - setup_proc): + setup_mounts): self.app = app self.staging_area = staging_area self.local_artifact_cache = local_artifact_cache @@ -653,7 +653,7 @@ class Builder(object): # pragma: no cover self.repo_cache = repo_cache self.build_env = build_env self.max_jobs = max_jobs - self.setup_proc = setup_proc + self.setup_mounts = setup_mounts def build_and_cache(self, artifact): kind = artifact.source.morphology['kind'] @@ -661,7 +661,7 @@ class Builder(object): # pragma: no cover self.local_artifact_cache, self.remote_artifact_cache, artifact, self.repo_cache, self.build_env, - self.max_jobs, self.setup_proc) + self.max_jobs, self.setup_mounts) logging.debug('Builder.build: artifact %s with %s' % (artifact.name, repr(o))) built_artifacts = o.build_and_cache() -- cgit v1.2.1