Loading installsystems/image.py +7 −1 Original line number Diff line number Diff line Loading @@ -223,8 +223,14 @@ class Image(object): # we need installsystems.printer to conserve arrow level sysmodules["installsystems.printer"] = installsystems.printer exec bytecode in global_dict except SystemExit as e: # skip a script which call exit(0) or exit() if e.code is None or e.code == 0: return else: raise ISError(u"Script %s exits with status" % path, e) except Exception as e: raise ISError(u"Unable to execute script %s" % path, e) raise ISError(u"Fail to execute script %s" % path, e) finally: sysmodules.clear() sysmodules.update(sysmodules_backup) Loading installsystems/template.py +4 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ parser = """# -*- python -*- # global image object is a reference to current image # global parser object is your installsystems subparser (argparse) # you can use exit() to break the execution of the script import os import argparse from installsystems.printer import arrow Loading @@ -72,6 +74,8 @@ setup = u"""# -*- python -*- # global image object is a reference to current image # namespace object is the persistant, it can be used to store data accross scripts # you can use exit() to break the execution of the script from installsystems.printer import arrow arrow(u"hostname: %s" % namespace.hostname) Loading Loading
installsystems/image.py +7 −1 Original line number Diff line number Diff line Loading @@ -223,8 +223,14 @@ class Image(object): # we need installsystems.printer to conserve arrow level sysmodules["installsystems.printer"] = installsystems.printer exec bytecode in global_dict except SystemExit as e: # skip a script which call exit(0) or exit() if e.code is None or e.code == 0: return else: raise ISError(u"Script %s exits with status" % path, e) except Exception as e: raise ISError(u"Unable to execute script %s" % path, e) raise ISError(u"Fail to execute script %s" % path, e) finally: sysmodules.clear() sysmodules.update(sysmodules_backup) Loading
installsystems/template.py +4 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ parser = """# -*- python -*- # global image object is a reference to current image # global parser object is your installsystems subparser (argparse) # you can use exit() to break the execution of the script import os import argparse from installsystems.printer import arrow Loading @@ -72,6 +74,8 @@ setup = u"""# -*- python -*- # global image object is a reference to current image # namespace object is the persistant, it can be used to store data accross scripts # you can use exit() to break the execution of the script from installsystems.printer import arrow arrow(u"hostname: %s" % namespace.hostname) Loading