diff options
Diffstat (limited to 'vmdb/plugins/mount_plugin.py')
-rw-r--r-- | vmdb/plugins/mount_plugin.py | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/vmdb/plugins/mount_plugin.py b/vmdb/plugins/mount_plugin.py index da038ad..0b06401 100644 --- a/vmdb/plugins/mount_plugin.py +++ b/vmdb/plugins/mount_plugin.py @@ -17,7 +17,6 @@ -import logging import os import tempfile @@ -34,25 +33,13 @@ class MountPlugin(cliapp.Plugin): class MountStepRunner(vmdb.StepRunnerInterface): - virtuals = [ - ['none', '/proc', 'proc'], - ['none', '/dev', 'devtmpfs'], - ['none', '/dev/pts', 'devpts'], - ['none', '/dev/shm', 'tmpfs'], - ['none', '/run', 'tmpfs'], - ['none', '/run/lock', 'tmpfs'], - ['none', '/sys', 'sysfs'], - ] - def get_required_keys(self): return ['mount', 'fs-tag'] def run(self, step, settings, state): - rootfs = self.mount_rootfs(step, settings, state) - self.mount_virtuals(rootfs, state) + self.mount_rootfs(step, settings, state) def teardown(self, step, settings, state): - self.unmount_virtuals(state) self.unmount_rootfs(step, settings, state) def mount_rootfs(self, step, settings, state): @@ -78,23 +65,3 @@ class MountStepRunner(vmdb.StepRunnerInterface): vmdb.runcmd(['umount', mount_point]) os.rmdir(mount_point) - - def mount_virtuals(self, rootfs, state): - if not hasattr(state, 'virtuals'): - state.virtuals = [] - - for device, mount_point, fstype in self.virtuals: - path = os.path.join(rootfs, './' + mount_point) - if not os.path.exists(path): - os.mkdir(path) - vmdb.runcmd(['mount', '-t', fstype, device, path]) - state.virtuals.append(path) - logging.debug('mounted virtuals: %r', state.virtuals) - - def unmount_virtuals(self, state): - logging.debug('unmounting virtuals: %r', state.virtuals) - for mount_point in reversed(state.virtuals): - try: - vmdb.runcmd(['umount', mount_point]) - except cliapp.AppException: - vmdb.error('Something went wrong while unmounting. Ignoring.') |