Add check scratch mode for performing cl-image

master
Mike Hiretsky 14 years ago
parent bc52b031b8
commit d89de1ad20

@ -49,6 +49,14 @@ class image_cmd(share_cmd):
# "k", "e","dmraid","c","ebuild",
# "symlink"]
def isScratch(self):
"""Detect scartch system"""
if self.logicObj.clVars.Get('os_scratch') == 'on':
return True
else:
self.printERROR(_("You should load system in the builder mode."))
return False
def checkOpts(self, values, args):
"""Check values all specified options."""
if len(args) > 1:

@ -49,6 +49,8 @@ if __name__ == "__main__":
# check root
if not image.isRoot():
sys.exit(1)
if not image.isScratch():
sys.exit(1)
if not image.performActionByCommand(options,args):
sys.exit(1)
sys.exit(0)

Loading…
Cancel
Save