Merge "Ensure consistent encoding of strings for ID"
This commit is contained in:
commit
fa152a1606
@ -160,10 +160,10 @@ class Etcd3Driver(coordination.CoordinationDriverCachedRunWatchers,
|
||||
GROUP_PREFIX = b"tooz/groups/"
|
||||
|
||||
def _encode_group_id(self, group_id):
|
||||
return self.GROUP_PREFIX + group_id + b"/"
|
||||
return self.GROUP_PREFIX + utils.to_binary(group_id) + b"/"
|
||||
|
||||
def _encode_group_member_id(self, group_id, member_id):
|
||||
return self._encode_group_id(group_id) + member_id
|
||||
return self._encode_group_id(group_id) + utils.to_binary(member_id)
|
||||
|
||||
def create_group(self, group_id):
|
||||
encoded_group = self._encode_group_id(group_id)
|
||||
|
@ -285,13 +285,13 @@ class MemcachedDriver(coordination.CoordinationDriverCachedRunWatchers,
|
||||
self.client.close()
|
||||
|
||||
def _encode_group_id(self, group_id):
|
||||
return self.GROUP_PREFIX + group_id
|
||||
return self.GROUP_PREFIX + utils.to_binary(group_id)
|
||||
|
||||
def _encode_member_id(self, member_id):
|
||||
return self.MEMBER_PREFIX + member_id
|
||||
return self.MEMBER_PREFIX + utils.to_binary(member_id)
|
||||
|
||||
def _encode_group_leader(self, group_id):
|
||||
return self.GROUP_LEADER_PREFIX + group_id
|
||||
return self.GROUP_LEADER_PREFIX + utils.to_binary(group_id)
|
||||
|
||||
@_retry.retry()
|
||||
def _add_group_to_group_list(self, group_id):
|
||||
|
Loading…
Reference in New Issue
Block a user