parent
a94866a20b
commit
506bd239bd
|
@ -28,28 +28,23 @@ class AbstractReporter(object):
|
||||||
self.skipped = dict([(host, 0) for host in hosts])
|
self.skipped = dict([(host, 0) for host in hosts])
|
||||||
self.passed = dict([(host, 0) for host in hosts])
|
self.passed = dict([(host, 0) for host in hosts])
|
||||||
self.to_rsync = {}
|
self.to_rsync = {}
|
||||||
self.lock = thread.allocate_lock()
|
|
||||||
|
|
||||||
def get_item_name(self, event, colitem):
|
def get_item_name(self, event, colitem):
|
||||||
return "/".join(colitem.listnames())
|
return "/".join(colitem.listnames())
|
||||||
|
|
||||||
def report(self, what):
|
def report(self, what):
|
||||||
|
repfun = getattr(self, "report_" + what.__class__.__name__,
|
||||||
|
self.report_unknown)
|
||||||
try:
|
try:
|
||||||
self.lock.acquire()
|
return repfun(what)
|
||||||
repfun = getattr(self, "report_" + what.__class__.__name__,
|
except (KeyboardInterrupt, SystemExit):
|
||||||
self.report_unknown)
|
raise
|
||||||
try:
|
except:
|
||||||
return repfun(what)
|
print "Internal reporting problem"
|
||||||
except (KeyboardInterrupt, SystemExit):
|
excinfo = py.code.ExceptionInfo()
|
||||||
raise
|
for i in excinfo.traceback:
|
||||||
except:
|
print str(i)[2:-1]
|
||||||
print "Internal reporting problem"
|
print excinfo
|
||||||
excinfo = py.code.ExceptionInfo()
|
|
||||||
for i in excinfo.traceback:
|
|
||||||
print str(i)[2:-1]
|
|
||||||
print excinfo
|
|
||||||
finally:
|
|
||||||
self.lock.release()
|
|
||||||
|
|
||||||
def report_unknown(self, what):
|
def report_unknown(self, what):
|
||||||
if self.config.option.verbose:
|
if self.config.option.verbose:
|
||||||
|
|
Loading…
Reference in New Issue