rewrite emulator to class based approach for better logging

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-15 02:31:40 +02:00
commit e002710c4c
2 changed files with 116 additions and 82 deletions

View file

@ -145,6 +145,10 @@ def configinstall(args, mode):
log.info("Total processing time for %s host(s): %s", len(args.host),
(time_end - time_start))
def emulator():
"""Prepare and run emulator"""
emulator = cdist.emulator.Emulator(sys.argv)
emulator.run()
if __name__ == "__main__":
try:
@ -152,7 +156,8 @@ if __name__ == "__main__":
if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])):
import cdist.emulator
cdist.emulator.run(sys.argv)
emulator()
else:
import cdist.banner
import cdist.config