mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-22 04:18:23 +00:00
Add StorageStatus::renderSynchronously
Related to ticket:3247 test_storage.py wants a `StorageStatus::renderSynchronously()` method and a `StorageStatus::renderHTTP()` method. Let us begin with the goofy first-cut. Both these methods are not only wrong, but they will also not please the test suite. However error messages produced in CI can be shared, and that way I can hopefully get unstuck.
This commit is contained in:
parent
aad3557d2b
commit
75488c4aff
@ -1,7 +1,8 @@
|
||||
|
||||
import time, json
|
||||
from twisted.python.filepath import FilePath
|
||||
from twisted.web.template import tags as T, renderer, Element, renderElement, XMLFile
|
||||
from twisted.web.template import tags as T, \
|
||||
renderer, Element, renderElement, XMLFile
|
||||
from allmydata.web.common import (
|
||||
abbreviate_time,
|
||||
MultiFormatResource
|
||||
@ -303,3 +304,14 @@ class StorageStatus(MultiFormatResource):
|
||||
"lease-checker-progress": self.storage.lease_checker.get_progress(),
|
||||
}
|
||||
return json.dumps(d, indent=1) + "\n"
|
||||
|
||||
def renderSynchronously(self):
|
||||
# to appease the test suite.
|
||||
elem = StorageStatusElement(self.storage, self.nickname)
|
||||
result = []
|
||||
flattenString(None, elem).addCallback(result.append)
|
||||
return result
|
||||
|
||||
def renderHTTP(self, ctx=None):
|
||||
# to appease the test suite.
|
||||
self.renderSynchronously()
|
||||
|
Loading…
Reference in New Issue
Block a user