client.py: throw error when reserved_space= is unparseable. Closes #1812.

This should now fail quickly (during "tahoe start"). Previously this
would silently treat an unparseable size as "0", and the only way to
discover that it had had a problem would be to look at the foolscap log,
or examine the storage-service web page for the unexpected "Reserved
Size" number.
This commit is contained in:
Brian Warner
2013-03-20 15:25:10 -07:00
committed by David-Sarah Hopwood
parent 0a89b738bc
commit b084396bdd
2 changed files with 2 additions and 3 deletions

View File

@ -257,12 +257,12 @@ class Client(node.Node, pollmixin.PollMixin):
storedir = os.path.join(self.basedir, self.STOREDIR)
data = self.get_config("storage", "reserved_space", None)
reserved = None
try:
reserved = parse_abbreviated_size(data)
except ValueError:
log.msg("[storage]reserved_space= contains unparseable value %s"
% data)
raise
if reserved is None:
reserved = 0
discard = self.get_config("storage", "debug_discard", False,