d.addCallback(lambda ign: self.do_cli("manifest", self.rooturi))
def _manifest_failed((rc, out, err)):
self.failIfEqual(rc, 0)
- self.failUnlessIn("ERROR: ", err)
- self.failUnlessIn("UnrecoverableFileError", err)
+ self.failUnlessIn("ERROR: UnrecoverableFileError", err)
# the fatal directory should still show up, as the last line
self.failUnlessIn(" subdir\n", out)
d.addCallback(_manifest_failed)
d.addCallback(lambda ign: self.do_cli("deep-check", self.rooturi))
def _deep_check_failed((rc, out, err)):
self.failIfEqual(rc, 0)
- self.failUnlessIn("ERROR: ", err)
- self.failUnlessIn("UnrecoverableFileError", err)
+ self.failUnlessIn("ERROR: UnrecoverableFileError", err)
# we want to make sure that the error indication is the last
# thing that gets emitted
self.failIf("done:" in out, out)
#def _deep_check_repair_failed((rc, out, err)):
# self.failIfEqual(rc, 0)
# print err
- # self.failUnlessIn("ERROR: ", err)
- # self.failUnlessIn("UnrecoverableFileError", err)
+ # self.failUnlessIn("ERROR: UnrecoverableFileError", err)
# self.failIf("done:" in out, out)
#d.addCallback(_deep_check_repair_failed)
error_line = lines[first_error]
error_msg = lines[first_error+1:]
error_msg_s = "\n".join(error_msg) + "\n"
- # different pythons repr the exception differently, so sometimes
- # we get "ERROR: UnrecoverableFileError", and sometimes we get
- # "ERROR: <allmydata.mutable.common.UnrecoverableFileError
- # instance at 0x...>".
- self.failUnlessIn("ERROR: ", error_line)
- self.failUnlessIn("UnrecoverableFileError", error_line)
- self.failUnlessIn("no recoverable versions", error_line)
+ self.failUnlessIn("ERROR: UnrecoverableFileError(no recoverable versions)",
+ error_line)
self.failUnless(len(error_msg) > 2, error_msg_s) # some traceback
units = [simplejson.loads(line) for line in lines[:first_error]]
self.failUnlessEqual(len(units), 5) # includes subdir
error_line = lines[first_error]
error_msg = lines[first_error+1:]
error_msg_s = "\n".join(error_msg) + "\n"
- self.failUnlessIn("ERROR: ", error_line)
- self.failUnlessIn("UnrecoverableFileError", error_line)
- self.failUnlessIn("no recoverable versions", error_line)
+ self.failUnlessIn("ERROR: UnrecoverableFileError(no recoverable versions)",
+ error_line)
self.failUnless(len(error_msg) > 2, error_msg_s) # some traceback
units = [simplejson.loads(line) for line in lines[:first_error]]
self.failUnlessEqual(len(units), 5) # includes subdir
d.addErrback(_cancelled)
def _error(f):
# signal the error as a non-JSON "ERROR:" line, plus exception
- msg = "ERROR: %s\n" % repr(f.value)
+ msg = "ERROR: %s(%s)\n" % (f.value.__class__.__name__,
+ ", ".join([str(a) for a in f.value.args]))
msg += str(f)
return msg
d.addErrback(_error)
d.addErrback(_cancelled)
def _error(f):
# signal the error as a non-JSON "ERROR:" line, plus exception
- msg = "ERROR: %s\n" % repr(f.value)
+ msg = "ERROR: %s(%s)\n" % (f.value.__class__.__name__,
+ ", ".join([str(a) for a in f.value.args]))
msg += str(f)
return msg
d.addErrback(_error)