summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-06-04 13:40:02 +0300
committerLars Wirzenius <liw@liw.fi>2017-06-04 13:48:31 +0300
commit2b3565e8e0785099916c5f2dc73dbe05608ab13e (patch)
tree08fb5416842e8ee956cae7590fae287a7cb4b7fe
parentabf63504f7aa89054b0dd6041f0cdcb051c19dea (diff)
downloadvmdb2-2b3565e8e0785099916c5f2dc73dbe05608ab13e.tar.gz
Fix: actually implement "unless:" in .vmdb files
The main program now implements the "unless:" check by calling the skip() method, as previously implemented. The apt and chroot plugins no longer check for rootfs tarball having been unpacked. Yay test suites which found this, after I changed the plugins, because *obviously* that code was no longer needed.
-rw-r--r--vmdb/app.py7
-rw-r--r--vmdb/plugins/apt_plugin.py3
-rw-r--r--vmdb/plugins/debootstrap_plugin.py3
3 files changed, 5 insertions, 8 deletions
diff --git a/vmdb/app.py b/vmdb/app.py
index 0b62364..302e8b7 100644
--- a/vmdb/app.py
+++ b/vmdb/app.py
@@ -86,8 +86,11 @@ class Vmdb2(cliapp.Application):
steps_taken.append(step)
expanded_step = self.expand_step_spec(step, state)
runner = self.step_runners.find(step)
- method = getattr(runner, method_name)
- method(expanded_step, self.settings, state)
+ if runner.skip(step, self.settings, state):
+ logging.info('Skipping as requested')
+ else:
+ method = getattr(runner, method_name)
+ method(expanded_step, self.settings, state)
except Exception as e:
vmdb.error(str(e))
core_meltdown = True
diff --git a/vmdb/plugins/apt_plugin.py b/vmdb/plugins/apt_plugin.py
index 549ba4f..d096084 100644
--- a/vmdb/plugins/apt_plugin.py
+++ b/vmdb/plugins/apt_plugin.py
@@ -37,9 +37,6 @@ class AptStepRunner(vmdb.StepRunnerInterface):
return ['apt', 'fs-tag']
def run(self, step, settings, state):
- if getattr(state, 'rootfs_unpacked', False):
- return
-
package = step['apt']
fstag = step['fs-tag']
mount_point = state.mounts[fstag]
diff --git a/vmdb/plugins/debootstrap_plugin.py b/vmdb/plugins/debootstrap_plugin.py
index 0278cf1..da7f1fc 100644
--- a/vmdb/plugins/debootstrap_plugin.py
+++ b/vmdb/plugins/debootstrap_plugin.py
@@ -37,9 +37,6 @@ class DebootstrapStepRunner(vmdb.StepRunnerInterface):
return ['debootstrap', 'target', 'mirror']
def run(self, step, settings, state):
- if getattr(state, 'rootfs_unpacked', False):
- return
-
suite = step['debootstrap']
tag = step['target']
target = state.mounts[tag]