mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-20 17:52:50 +00:00
IServer.get_name(): remove v0- prefix from displayed server names
Don't remove the prefix if it isn't there: that avoids the need to fix tests which use a bogus key (usually all-zeros).
This commit is contained in:
parent
cef646c4a7
commit
890449801e
@ -190,9 +190,16 @@ class NativeStorageServer:
|
||||
ps = base32.a2b(str(ann["permutation-seed-base32"]))
|
||||
self._permutation_seed = ps
|
||||
|
||||
name = key_s or tubid_s
|
||||
self._long_description = name
|
||||
self._short_description = name[:8] # TODO: decide who adds []
|
||||
if key_s:
|
||||
self._long_description = key_s
|
||||
if key_s.startswith("v0-"):
|
||||
# remove v0- prefix from abbreviated name
|
||||
self._short_description = key_s[3:3+8]
|
||||
else:
|
||||
self._short_description = key_s[:8]
|
||||
else:
|
||||
self._long_description = tubid_s
|
||||
self._short_description = tubid_s[:8]
|
||||
|
||||
self.announcement_time = time.time()
|
||||
self.last_connect_time = None
|
||||
@ -213,6 +220,8 @@ class NativeStorageServer:
|
||||
return self.rref.version
|
||||
return None
|
||||
def get_name(self): # keep methodname short
|
||||
# TODO: decide who adds [] in the short description. It should
|
||||
# probably be the output side, not here.
|
||||
return self._short_description
|
||||
def get_longname(self):
|
||||
return self._long_description
|
||||
|
Loading…
x
Reference in New Issue
Block a user