self.image.g.write('/etc/shadow', "\n".join(shadow) + '\n')
+ # Remove backup file for /etc/shadow
+ self.image.g.rm_rf('/etc/shadow-')
+
@sysprep('Fixing acpid powerdown action')
def fix_acpid(self):
"""Replace acpid powerdown action scripts to immediately shutdown the
self.out.warn("Acpid action file: %s does not exist" %
action)
return
- self.image.g.copy_file_to_file(action,
- "%s.orig.snf-image-creator-%d" %
- (action, time.time()))
+ self.image.g.copy_file_to_file(
+ action, "%s.orig.snf-image-creator-%d" %
+ (action, time.time()))
self.image.g.write(action, powerbtn_action)
return
else:
return orig, dev, mpoint
+ def _do_inspect(self):
+ """Run various diagnostics to check if media is supported"""
+
+ self.out.output(
+ 'Checking if the media contains logical volumes (LVM)...', False)
+
+ has_lvm = True if len(self.image.g.lvs()) else False
+
+ if has_lvm:
+ self.out.output()
+ self.image.set_unsupported('The media contains logical volumes')
+ else:
+ self.out.success('no')
+
def _do_collect_metadata(self):
"""Collect metadata about the OS"""
super(Linux, self)._do_collect_metadata()