tests/dbusmock-templates/colord: Support usernames with dash chars

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3016>
This commit is contained in:
Marco Trevisan (Treviño) 2023-05-23 18:55:28 +02:00 committed by Marge Bot
parent 69cc65d15f
commit 7d95a41ec2

View File

@ -67,7 +67,7 @@ def CreateDevice(self, device_id, scope, props):
username = get_username(uid)
device_path = PATH_PREFIX + '/devices/' + \
escape_unit_name(device_id) + \
'_' + username + '_' + str(uid)
'_' + escape_unit_name(username) + '_' + str(uid)
self.devices[device_id] = device_path
self.AddObject(device_path,
DEVICE_IFACE,
@ -100,7 +100,7 @@ def CreateProfileWithFd(self, profile_id, scope, handle, props):
username = get_username(uid)
profile_path = PATH_PREFIX + '/profiles/' + \
escape_unit_name(profile_id) + \
'_' + username + '_' + str(uid)
'_' + escape_unit_name(username) + '_' + str(uid)
if profile_id in self.profiles:
raise ColordAlreadyExistsException()