stdout.write(" corrupt shares:\n")
for (serverid, storage_index, sharenum) in corrupt:
stdout.write(" %s\n" % _quote_serverid_index_share(serverid, storage_index, sharenum))
-
+
return 0;
def check(options):
return 0
for location in options.locations:
errno = check_location(options, location)
- if errno != 0:
+ if errno != 0:
return errno
return 0
if not self.options["raw"]:
output.done()
return 0
-
def run(self, options):
if len(options.locations) == 0:
for location in options.locations:
errno = self.deepcheck_location(options, location)
if errno != 0:
- return errno
+ return errno
return self.rc
def deepcheck(options):
c0 = self.g.clients[0]
d = c0.create_dirnode()
def _stash_uri(n):
- self.uriList.append(n.get_uri())
+ self.uriList.append(n.get_uri())
d.addCallback(_stash_uri)
d = c0.create_dirnode()
d.addCallback(_stash_uri)
-
+
d.addCallback(lambda ign: self.do_cli("check", self.uriList[0], self.uriList[1]))
def _check((rc, out, err)):
self.failUnlessReallyEqual(rc, 0)
self.failUnlessIn("Healthy", out[:len(out)/2])
self.failUnlessIn("Healthy", out[len(out)/2:])
d.addCallback(_check)
-
+
d.addCallback(lambda ign: self.do_cli("check", self.uriList[0], "nonexistent:"))
def _check2((rc, out, err)):
self.failUnlessReallyEqual(rc, 1)
self.failUnlessIn("error:", err)
self.failUnlessIn("nonexistent", err)
d.addCallback(_check2)
-
return d