mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Py3: Replace six.text_type with str
On Python 3, six.text_type (singular) is an alias for str. See: https://pagure.io/freeipa/issue/7715 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
@@ -173,12 +173,12 @@ def _acl_make_request(principal_type, principal, ca_id, profile_id):
|
||||
groups = []
|
||||
if principal_type == 'user':
|
||||
user_obj = api.Command.user_show(
|
||||
six.text_type(principal.username))['result']
|
||||
str(principal.username))['result']
|
||||
groups = user_obj.get('memberof_group', [])
|
||||
groups += user_obj.get('memberofindirect_group', [])
|
||||
elif principal_type == 'host':
|
||||
host_obj = api.Command.host_show(
|
||||
six.text_type(principal.hostname))['result']
|
||||
str(principal.hostname))['result']
|
||||
groups = host_obj.get('memberof_hostgroup', [])
|
||||
groups += host_obj.get('memberofindirect_hostgroup', [])
|
||||
req.user.groups = sorted(set(groups))
|
||||
@@ -957,7 +957,7 @@ class cert_request(Create, BaseCertMethod, VirtualCommand):
|
||||
if add:
|
||||
if principal.is_service and not principal.is_host:
|
||||
self.api.Command.service_add(
|
||||
six.text_type(principal), all=True, force=True)
|
||||
str(principal), all=True, force=True)
|
||||
return self.lookup_principal(principal) # we want an LDAPEntry
|
||||
else:
|
||||
if principal.is_user:
|
||||
|
||||
Reference in New Issue
Block a user