Bit more input validation.

This commit is contained in:
Itamar Turner-Trauring 2021-08-27 11:12:34 -04:00
parent 4c750cf88d
commit c0d07e1894

View File

@ -283,6 +283,7 @@ class _GridManager(object):
storage provider (e.g. from the contents of node.pubkey
for the client)
"""
assert isinstance(name, str) # must be unicode
if name in self._storage_servers:
raise KeyError(
"Already have a storage server called '{}'".format(name)
@ -295,6 +296,7 @@ class _GridManager(object):
"""
:param name: a user-meaningful name for the server
"""
assert isinstance(name, str) # must be unicode
try:
del self._storage_servers[name]
except KeyError: