preserve the type when renewing HashedLeaseInfo

does this mean immutable lease renewal is untested?  maybe
This commit is contained in:
Jean-Paul Calderone 2021-11-05 14:11:05 -04:00
parent 5d703d9893
commit 3de9c73b0b

View File

@ -287,6 +287,13 @@ class HashedLeaseInfo(proxyForInterface(ILeaseInfo, "_lease_info")): # type: ign
_lease_info = attr.ib()
_hash = attr.ib()
def renew(self, new_expire_time):
# Preserve the HashedLeaseInfo wrapper around the renewed LeaseInfo.
return attr.assoc(
self,
_lease_info=super(HashedLeaseInfo, self).renew(new_expire_time),
)
def is_renew_secret(self, candidate_secret):
# type: (bytes) -> bool
"""