3 from micng.pluginbase.imager_plugin import ImagerPlugin
4 from micng.imager.fs import *
5 import micng.configmgr as configmgr
9 import micng.utils.argparse
11 class FsPlugin(ImagerPlugin):
15 def do_options(self, parser):
16 parser.add_argument('ksfile', nargs='?', help='kickstart file')
17 parser.add_argument('--release', help='fs options test')
20 def do_create(self, args):
22 print "fs option release: ", args.release
24 print "please specify a kickstart file"
26 # print "ksfile", args.ksfile
27 self.configmgr = configmgr.getConfigMgr()
28 self.configmgr.setProperty('ksfile', args.ksfile)
29 # print "ksfile", self.configmgr.getProperty('ksfile')
30 self.ks = self.configmgr.getProperty('kickstart')
31 self.name = self.configmgr.getProperty('name')
32 fs = FsImageCreator(self.ks, self.name)
34 fs.outdir = self.configmgr.getProperty('outdir')
35 fs.mount(None, self.configmgr.cache)
37 fs.configure(self.configmgr.repometadata)
39 fs.package(self.configmgr.outdir)
42 print "failed to create image: %s" % e
47 mic_plugin = ["fs", FsPlugin]