mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-23 01:08:53 +00:00
CheckResults: start hiding .data, first step to clean it up
The goal is to make CheckResults more strongly typed, and remove the ambiguous ".data" field in favor of a bunch of specific counters and sharelists, so I can changes .sharemap and .servermap to use IServer instances instead of string serverids. By cleaning this up first, I hope to get that task done with less debugging.
This commit is contained in:
@ -12,9 +12,9 @@ class CheckResults:
|
||||
self.uri = uri
|
||||
self.storage_index = storage_index
|
||||
self.problems = []
|
||||
self.data = {"count-corrupt-shares": 0,
|
||||
"list-corrupt-shares": [],
|
||||
}
|
||||
self._data = {"count-corrupt-shares": 0,
|
||||
"list-corrupt-shares": [],
|
||||
}
|
||||
self.summary = ""
|
||||
self.report = []
|
||||
|
||||
@ -34,7 +34,7 @@ class CheckResults:
|
||||
def set_needs_rebalancing(self, needs_rebalancing):
|
||||
self.needs_rebalancing_p = bool(needs_rebalancing)
|
||||
def set_data(self, data):
|
||||
self.data.update(data)
|
||||
self._data.update(data)
|
||||
def set_summary(self, summary):
|
||||
assert isinstance(summary, str) # should be a single string
|
||||
self.summary = summary
|
||||
@ -62,7 +62,7 @@ class CheckResults:
|
||||
def needs_rebalancing(self):
|
||||
return self.needs_rebalancing_p
|
||||
def get_data(self):
|
||||
return self.data
|
||||
return self._data
|
||||
|
||||
def get_summary(self):
|
||||
return self.summary
|
||||
|
Reference in New Issue
Block a user