Imported Debian patch 4.8.10-2

This commit is contained in:
Timo Aaltonen
2020-11-23 20:48:56 +02:00
committed by Mario Fetka
parent 8bc559c5a1
commit 358acdd85f
917 changed files with 1185414 additions and 1069733 deletions

View File

@@ -3,6 +3,7 @@
#
from ipalib import api, errors
from ipaplatform.constants import constants as platformconstants
from ipapython.dn import DN
import six
@@ -67,11 +68,11 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker):
""" Check for non-empty unicode string for the required attributes
in the init method """
if not (isinstance(givenname, six.string_types) and givenname):
if not (isinstance(givenname, str) and givenname):
raise ValueError(
"Invalid first name provided: {!r}".format(givenname)
)
if not (isinstance(sn, six.string_types) and sn):
if not (isinstance(sn, str) and sn):
raise ValueError("Invalid second name provided: {!r}".format(sn))
super(UserTracker, self).__init__(default_version=None)
@@ -181,7 +182,7 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker):
krbcanonicalname=[u'%s@%s' % (self.uid, self.api.env.realm)],
mail=[u'%s@%s' % (self.uid, self.api.env.domain)],
gecos=[u'%s %s' % (self.givenname, self.sn)],
loginshell=[u'/bin/sh'],
loginshell=[platformconstants.DEFAULT_SHELL],
has_keytab=False,
has_password=False,
mepmanagedentry=[get_group_dn(self.uid)],
@@ -226,7 +227,7 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker):
result = command()
for key, value in updates.items():
if value is None or value is '' or value is u'':
if value is None or value == '':
del self.attrs[key]
elif key == 'rename':
new_principal = u'{0}@{1}'.format(value, self.api.env.realm)
@@ -240,7 +241,7 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker):
else:
self.attrs[key] = [value]
for key, value in expected_updates.items():
if value is None or value is '' or value is u'':
if value is None or value == '':
del self.attrs[key]
else:
self.attrs[key] = value
@@ -514,7 +515,8 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker):
assert_deepequal(dict(
completed=1,
failed=dict(
member=dict(group=tuple(), user=tuple(), service=tuple())
member=dict(group=tuple(), user=tuple(),
service=tuple(), idoverrideuser=tuple())
),
result={
'dn': get_group_dn(admin_group),