ipaldap: fix conversion from boolean OID to Python
In IPA framework we don't properly convert to Python bool type and just
return a string (TRUE or FALSE). This can be seen with many boolean
attributes, like
Bool('idnsallowdynupdate?',
cli_name='dynamic_update',
label=_('Dynamic update'),
doc=_('Allow dynamic updates.'),
attribute=True,
default=False,
autofill=True
),
in 'ipa dnszone-show':
> > > api.Command.dnszone_show('ipa.test')['result']['idnsallowdynupdate']
['TRUE']
This is because we don't have the reverse (from LDAP to Python) mapping
for the LDAP boolean OID 1.3.6.1.4.1.1466.115.121.1.7.
When Web UI asks for the entry, it gets back JSON output that contains
this 'TRUE' value:
"idnsallowdynupdate": [
"TRUE"
],
Add proper mapping from LDAP to Python bool type. With this, a simple
'checkbox' type can be used in Web UI instead of a complex radio-box
setup.
Note that when IPA API is asked to return raw values, 'TRUE' and 'FALSE'
still returned. These are the actual LDAP boolean attribute values. Care
needs to be done in tests:
- if output is from a command with --raw option, 'TRUE' or 'FALSE'
should be expected
- if output if from a normal (non-raw) command, True or False would be
returned
Fixes: https://pagure.io/freeipa/issue/9171
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
1 parent
d241d7405f
commit
6c5f2bcb30
23 files changed
+209
-212
No files matched your search
@@ -184,12 +184,8 @@ return {
|
||||
measurement_unit: 'seconds'
|
||||
},
|
||||
{
|
||||
$type: 'radio',
|
||||
$type: 'checkbox',
|
||||
name: 'idnsallowdynupdate',
|
||||
options: [
|
||||
{ value: 'TRUE', label: '@i18n:true' },
|
||||
{ value: 'FALSE', label: '@i18n:false' }
|
||||
]
|
||||
},
|
||||
{
|
||||
$type: 'textarea',
|
||||
|
||||
@@ -683,6 +683,7 @@ class LDAPClient:
|
||||
'1.3.6.1.4.1.1466.115.121.1.1' : bytes, # ACI item
|
||||
'1.3.6.1.4.1.1466.115.121.1.4' : bytes, # Audio
|
||||
'1.3.6.1.4.1.1466.115.121.1.5' : bytes, # Binary
|
||||
'1.3.6.1.4.1.1466.115.121.1.7' : bool, # Boolean
|
||||
'1.3.6.1.4.1.1466.115.121.1.8' : bytes, # Certificate
|
||||
'1.3.6.1.4.1.1466.115.121.1.9' : bytes, # Certificate List
|
||||
'1.3.6.1.4.1.1466.115.121.1.10' : bytes, # Certificate Pair
|
||||
@@ -1009,6 +1010,8 @@ class LDAPClient:
|
||||
return val
|
||||
elif target_type is unicode:
|
||||
return val.decode('utf-8')
|
||||
elif target_type is bool:
|
||||
return val.decode('utf-8') == 'TRUE'
|
||||
elif target_type is datetime.datetime:
|
||||
return datetime.datetime.strptime(
|
||||
val.decode('utf-8'), LDAP_GENERALIZED_TIME_FORMAT)
|
||||
|
||||
@@ -2018,7 +2018,7 @@ def import_included_profiles():
|
||||
objectclass=['ipacertprofile'],
|
||||
cn=[profile_id],
|
||||
description=[desc],
|
||||
ipacertprofilestoreissued=['TRUE' if store_issued else 'FALSE'],
|
||||
ipacertprofilestoreissued=[store_issued],
|
||||
)
|
||||
conn.add_entry(entry)
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ class caacl_add(LDAPCreate):
|
||||
|
||||
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
||||
# CA ACLs are enabled by default
|
||||
entry_attrs['ipaenabledflag'] = ['TRUE']
|
||||
entry_attrs['ipaenabledflag'] = [True]
|
||||
return dn
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ class caacl_enable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['TRUE']
|
||||
entry_attrs['ipaenabledflag'] = [True]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
@@ -363,7 +363,7 @@ class caacl_disable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['FALSE']
|
||||
entry_attrs['ipaenabledflag'] = [False]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
|
||||
@@ -957,7 +957,7 @@ class cert_request(Create, BaseCertMethod, VirtualCommand):
|
||||
# Success? Then add it to the principal's entry
|
||||
# (unless the profile tells us not to)
|
||||
profile = api.Command['certprofile_show'](profile_id)
|
||||
store = profile['result']['ipacertprofilestoreissued'][0] == 'TRUE'
|
||||
store = profile['result']['ipacertprofilestoreissued'][0]
|
||||
if store and 'certificate' in result:
|
||||
cert = result.get('certificate')
|
||||
kwargs = dict(addattr=u'usercertificate={}'.format(cert))
|
||||
|
||||
@@ -426,7 +426,7 @@ class certmaprule_enable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['TRUE']
|
||||
entry_attrs['ipaenabledflag'] = [True]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
@@ -455,7 +455,7 @@ class certmaprule_disable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['FALSE']
|
||||
entry_attrs['ipaenabledflag'] = [False]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
|
||||
@@ -2169,7 +2169,7 @@ class DNSZoneBase_add(LDAPCreate):
|
||||
message=_(u'Only one zone type is allowed per zone name')
|
||||
)
|
||||
|
||||
entry_attrs['idnszoneactive'] = 'TRUE'
|
||||
entry_attrs['idnszoneactive'] = True
|
||||
|
||||
if not options['skip_overlap_check']:
|
||||
try:
|
||||
@@ -2272,7 +2272,7 @@ class DNSZoneBase_disable(LDAPQuery):
|
||||
if not _check_entry_objectclass(entry, self.obj.object_class):
|
||||
raise self.obj.handle_not_found(*keys)
|
||||
|
||||
entry['idnszoneactive'] = ['FALSE']
|
||||
entry['idnszoneactive'] = [False]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry)
|
||||
@@ -2297,7 +2297,7 @@ class DNSZoneBase_enable(LDAPQuery):
|
||||
if not _check_entry_objectclass(entry, self.obj.object_class):
|
||||
raise self.obj.handle_not_found(*keys)
|
||||
|
||||
entry['idnszoneactive'] = ['TRUE']
|
||||
entry['idnszoneactive'] = [True]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry)
|
||||
|
||||
@@ -304,7 +304,7 @@ class hbacrule_add(LDAPCreate):
|
||||
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
||||
assert isinstance(dn, DN)
|
||||
# HBAC rules are enabled by default
|
||||
entry_attrs['ipaenabledflag'] = 'TRUE'
|
||||
entry_attrs['ipaenabledflag'] = True
|
||||
return dn
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ class hbacrule_enable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['TRUE']
|
||||
entry_attrs['ipaenabledflag'] = [True]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
@@ -422,7 +422,7 @@ class hbacrule_disable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['FALSE']
|
||||
entry_attrs['ipaenabledflag'] = [False]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
|
||||
@@ -901,7 +901,7 @@ migration process might be incomplete\n''')
|
||||
assert isinstance(ds_base_dn, DN)
|
||||
|
||||
# check if migration mode is enabled
|
||||
if config.get('ipamigrationenabled', ('FALSE', ))[0] == 'FALSE':
|
||||
if not config.get('ipamigrationenabled', (False,))[0]:
|
||||
return dict(result={}, failed={}, enabled=False, compat=True)
|
||||
|
||||
# connect to DS
|
||||
|
||||
@@ -456,7 +456,7 @@ class pwpolicy(LDAPObject):
|
||||
for attr in ['ipapwdmaxrepeat', 'ipapwdmaxsequence',
|
||||
'ipapwddictcheck', 'ipapwdusercheck']:
|
||||
val = get_val(entry, attr)
|
||||
if val not in ('FALSE', '0', 0, None):
|
||||
if val not in (False, 'FALSE', '0', 0, None):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ class selinuxusermap_add(LDAPCreate):
|
||||
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
||||
assert isinstance(dn, DN)
|
||||
# rules are enabled by default
|
||||
entry_attrs['ipaenabledflag'] = 'TRUE'
|
||||
entry_attrs['ipaenabledflag'] = True
|
||||
validate_selinuxuser_inlist(ldap, entry_attrs['ipaselinuxuser'])
|
||||
|
||||
def is_to_be_set(x):
|
||||
@@ -508,7 +508,7 @@ class selinuxusermap_enable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['TRUE']
|
||||
entry_attrs['ipaenabledflag'] = [True]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
@@ -538,7 +538,7 @@ class selinuxusermap_disable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['FALSE']
|
||||
entry_attrs['ipaenabledflag'] = [False]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
|
||||
@@ -397,7 +397,7 @@ class sudorule_add(LDAPCreate):
|
||||
assert isinstance(dn, DN)
|
||||
self.obj.check_order_uniqueness(*keys, **options)
|
||||
# Sudo Rules are enabled by default
|
||||
entry_attrs['ipaenabledflag'] = 'TRUE'
|
||||
entry_attrs['ipaenabledflag'] = True
|
||||
return dn
|
||||
|
||||
msg_summary = _('Added Sudo Rule "%(value)s"')
|
||||
@@ -503,7 +503,7 @@ class sudorule_enable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['TRUE']
|
||||
entry_attrs['ipaenabledflag'] = [True]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
@@ -526,7 +526,7 @@ class sudorule_disable(LDAPQuery):
|
||||
except errors.NotFound:
|
||||
raise self.obj.handle_not_found(cn)
|
||||
|
||||
entry_attrs['ipaenabledflag'] = ['FALSE']
|
||||
entry_attrs['ipaenabledflag'] = [False]
|
||||
|
||||
try:
|
||||
ldap.update_entry(entry_attrs)
|
||||
|
||||
@@ -680,9 +680,9 @@ class user_add(baseuser_add):
|
||||
|
||||
# generate subid
|
||||
default_subid = config.single_value.get(
|
||||
'ipaUserDefaultSubordinateId', 'FALSE'
|
||||
'ipaUserDefaultSubordinateId', False
|
||||
)
|
||||
if default_subid == 'TRUE':
|
||||
if default_subid:
|
||||
result = self.api.Command.subid_generate(
|
||||
ipaowner=entry_attrs.single_value['uid'],
|
||||
version=options['version']
|
||||
|
||||
@@ -819,7 +819,7 @@ class TestIPACommand(IntegrationTest):
|
||||
lines = set(l.strip() for l in result.stdout_text.split('\n'))
|
||||
assert 'User category: all' in lines
|
||||
assert 'Host category: all' in lines
|
||||
assert 'Enabled: TRUE' in lines
|
||||
assert 'Enabled: True' in lines
|
||||
assert 'HBAC Services: systemd-user' in lines
|
||||
assert 'accessruletype: allow' in lines
|
||||
|
||||
@@ -843,7 +843,7 @@ class TestIPACommand(IntegrationTest):
|
||||
lines = set(l.strip() for l in result.stdout_text.split('\n'))
|
||||
assert 'User category: all' in lines
|
||||
assert 'Host category: all' in lines
|
||||
assert 'Enabled: TRUE' in lines
|
||||
assert 'Enabled: True' in lines
|
||||
assert 'HBAC Services: systemd-user' in lines
|
||||
assert 'accessruletype: allow' in lines
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ certmaprule_optional_params = (
|
||||
'ipacertmappriority',
|
||||
)
|
||||
|
||||
certmapconfig_update_params = {u'ipacertmappromptusername': u'TRUE'}
|
||||
certmapconfig_update_params = {u'ipacertmappromptusername': True}
|
||||
|
||||
CREATE_PERM = u'System: Add Certmap Rules'
|
||||
READ_PERM = u'System: Read Certmap Rules'
|
||||
@@ -459,7 +459,7 @@ class TestPermission(XMLRPC_test):
|
||||
api.env.container_certmaprules,
|
||||
api.env.basedn,
|
||||
)
|
||||
expected_ok[u'result'][0][u'ipaenabledflag'] = (u'TRUE',)
|
||||
expected_ok[u'result'][0][u'ipaenabledflag'] = (True,)
|
||||
with self.execute_with_expected(
|
||||
certmap_user_permissions,
|
||||
[
|
||||
|
||||
@@ -160,7 +160,7 @@ class TestProfileCRUD(XMLRPC_test):
|
||||
ipacertprofilestoreissued=False
|
||||
),
|
||||
expected_updates=dict(
|
||||
ipacertprofilestoreissued=[u'FALSE']
|
||||
ipacertprofilestoreissued=[False]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -113,7 +113,7 @@ class test_dns_realmdomains_integration(Declarative):
|
||||
'result': {
|
||||
'dn': dnszone_1_dn,
|
||||
'idnsname': [DNSName(dnszone_1_absolute)],
|
||||
'idnszoneactive': [u'TRUE'],
|
||||
'idnszoneactive': [True],
|
||||
'idnssoamname': [self_server_ns_dnsname],
|
||||
'nsrecord': lambda x: True,
|
||||
'idnssoarname': [DNSName(idnssoarname)],
|
||||
@@ -122,7 +122,7 @@ class test_dns_realmdomains_integration(Declarative):
|
||||
'idnssoaretry': [fuzzy_digits],
|
||||
'idnssoaexpire': [fuzzy_digits],
|
||||
'idnssoaminimum': [fuzzy_digits],
|
||||
'idnsallowdynupdate': [u'FALSE'],
|
||||
'idnsallowdynupdate': [False],
|
||||
'idnsupdatepolicy': [u'grant %(realm)s krb5-self * A; '
|
||||
u'grant %(realm)s krb5-self * AAAA; '
|
||||
u'grant %(realm)s krb5-self * SSHFP;'
|
||||
@@ -179,7 +179,7 @@ class test_dns_realmdomains_integration(Declarative):
|
||||
'result': {
|
||||
'dn': dnszone_2_dn,
|
||||
'idnsname': [DNSName(dnszone_2_absolute)],
|
||||
'idnszoneactive': [u'TRUE'],
|
||||
'idnszoneactive': [True],
|
||||
'idnssoamname': [self_server_ns_dnsname],
|
||||
'idnsforwarders': [u'198.18.19.20'],
|
||||
'idnsforwardpolicy': [u'only'],
|
||||
@@ -190,7 +190,7 @@ class test_dns_realmdomains_integration(Declarative):
|
||||
'idnssoaretry': [fuzzy_digits],
|
||||
'idnssoaexpire': [fuzzy_digits],
|
||||
'idnssoaminimum': [fuzzy_digits],
|
||||
'idnsallowdynupdate': [u'FALSE'],
|
||||
'idnsallowdynupdate': [False],
|
||||
'idnsupdatepolicy': [u'grant %(realm)s krb5-self * A; '
|
||||
u'grant %(realm)s krb5-self * AAAA; '
|
||||
u'grant %(realm)s krb5-self * SSHFP;'
|
||||
|
||||
@@ -64,7 +64,7 @@ class test_hbac(XMLRPC_test):
|
||||
entry = ret['result']
|
||||
assert_attr_equal(entry, 'cn', self.rule_name)
|
||||
assert_attr_equal(entry, 'accessruletype', self.rule_type)
|
||||
assert_attr_equal(entry, 'ipaenabledflag', 'TRUE')
|
||||
assert_attr_equal(entry, 'ipaenabledflag', True)
|
||||
assert_attr_equal(entry, 'description', self.rule_desc)
|
||||
|
||||
def test_1_hbacrule_add(self):
|
||||
@@ -82,7 +82,7 @@ class test_hbac(XMLRPC_test):
|
||||
"""
|
||||
entry = api.Command['hbacrule_show'](self.rule_name)['result']
|
||||
assert_attr_equal(entry, 'cn', self.rule_name)
|
||||
assert_attr_equal(entry, 'ipaenabledflag', 'TRUE')
|
||||
assert_attr_equal(entry, 'ipaenabledflag', True)
|
||||
assert_attr_equal(entry, 'description', self.rule_desc)
|
||||
|
||||
def test_3_hbacrule_mod(self):
|
||||
@@ -327,8 +327,7 @@ class test_hbac(XMLRPC_test):
|
||||
"""
|
||||
assert api.Command['hbacrule_disable'](self.rule_name)['result'] is True
|
||||
entry = api.Command['hbacrule_show'](self.rule_name)['result']
|
||||
# FIXME: Should this be 'disabled' or 'FALSE'?
|
||||
assert_attr_equal(entry, 'ipaenabledflag', 'FALSE')
|
||||
assert_attr_equal(entry, 'ipaenabledflag', False)
|
||||
|
||||
def test_e_hbacrule_enabled(self):
|
||||
"""
|
||||
@@ -337,8 +336,7 @@ class test_hbac(XMLRPC_test):
|
||||
assert api.Command['hbacrule_enable'](self.rule_name)['result'] is True
|
||||
# check it's really enabled
|
||||
entry = api.Command['hbacrule_show'](self.rule_name)['result']
|
||||
# FIXME: Should this be 'enabled' or 'TRUE'?
|
||||
assert_attr_equal(entry, 'ipaenabledflag', 'TRUE')
|
||||
assert_attr_equal(entry, 'ipaenabledflag', True)
|
||||
|
||||
def test_ea_hbacrule_disable_setattr(self):
|
||||
"""
|
||||
@@ -346,9 +344,9 @@ class test_hbac(XMLRPC_test):
|
||||
"""
|
||||
command_result = api.Command['hbacrule_mod'](
|
||||
self.rule_name, setattr=u'ipaenabledflag=false')
|
||||
assert command_result['result']['ipaenabledflag'] == (u'FALSE',)
|
||||
assert command_result['result']['ipaenabledflag'] == (False,)
|
||||
entry = api.Command['hbacrule_show'](self.rule_name)['result']
|
||||
assert_attr_equal(entry, 'ipaenabledflag', 'FALSE')
|
||||
assert_attr_equal(entry, 'ipaenabledflag', False)
|
||||
|
||||
def test_eb_hbacrule_enable_setattr(self):
|
||||
"""
|
||||
@@ -356,10 +354,10 @@ class test_hbac(XMLRPC_test):
|
||||
"""
|
||||
command_result = api.Command['hbacrule_mod'](
|
||||
self.rule_name, setattr=u'ipaenabledflag=1')
|
||||
assert command_result['result']['ipaenabledflag'] == (u'TRUE',)
|
||||
assert command_result['result']['ipaenabledflag'] == (True,)
|
||||
# check it's really enabled
|
||||
entry = api.Command['hbacrule_show'](self.rule_name)['result']
|
||||
assert_attr_equal(entry, 'ipaenabledflag', 'TRUE')
|
||||
assert_attr_equal(entry, 'ipaenabledflag', True)
|
||||
|
||||
def test_f_hbacrule_exclusiveuser(self):
|
||||
"""
|
||||
|
||||
@@ -119,7 +119,7 @@ class test_selinuxusermap(Declarative):
|
||||
ipaselinuxuser=[selinuxuser1],
|
||||
objectclass=objectclasses.selinuxusermap,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
),
|
||||
@@ -146,7 +146,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser1],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
),
|
||||
@@ -163,7 +163,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
),
|
||||
summary=u'Modified SELinux User Map "%s"' % rule1,
|
||||
value=rule1,
|
||||
@@ -179,7 +179,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
summary=None,
|
||||
@@ -197,7 +197,7 @@ class test_selinuxusermap(Declarative):
|
||||
dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
],
|
||||
@@ -311,7 +311,7 @@ class test_selinuxusermap(Declarative):
|
||||
objectclass=objectclasses.hbacrule,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
accessruletype=[u'allow'],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_hbacruledn,
|
||||
),
|
||||
),
|
||||
@@ -331,7 +331,7 @@ class test_selinuxusermap(Declarative):
|
||||
objectclass=objectclasses.hbacrule,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
accessruletype=[u'allow'],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_hbacruledn,
|
||||
),
|
||||
),
|
||||
@@ -349,7 +349,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
memberuser_user=[user1],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
@@ -370,7 +370,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
memberuser_user=[user1],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
@@ -387,7 +387,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
)
|
||||
@@ -408,7 +408,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
)
|
||||
@@ -424,7 +424,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
memberuser_group=[group1],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
@@ -441,7 +441,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
memberhost_host=[host1],
|
||||
memberuser_group=[group1],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
@@ -508,7 +508,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
memberuser_group=[group1],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
@@ -526,7 +526,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
)
|
||||
@@ -552,7 +552,7 @@ class test_selinuxusermap(Declarative):
|
||||
result=dict(
|
||||
cn=[rule1],
|
||||
ipaselinuxuser=[selinuxuser2],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
seealso=hbacrule1,
|
||||
),
|
||||
summary=u'Modified SELinux User Map "%s"' % rule1,
|
||||
@@ -754,7 +754,7 @@ class test_selinuxusermap(Declarative):
|
||||
ipaselinuxuser=[selinuxuser1],
|
||||
objectclass=objectclasses.selinuxusermap,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
seealso=hbacrule1
|
||||
),
|
||||
@@ -825,7 +825,7 @@ class test_selinuxusermap(Declarative):
|
||||
ipaselinuxuser=[selinuxuser1],
|
||||
objectclass=objectclasses.selinuxusermap,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
usercategory=[u'all'],
|
||||
hostcategory=[u'all']
|
||||
@@ -866,7 +866,7 @@ class test_selinuxusermap(Declarative):
|
||||
ipaselinuxuser=[selinuxuser1],
|
||||
objectclass=objectclasses.selinuxusermap,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
),
|
||||
),
|
||||
@@ -911,7 +911,7 @@ class test_selinuxusermap(Declarative):
|
||||
ipaselinuxuser=[selinuxuser1],
|
||||
objectclass=objectclasses.selinuxusermap,
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
ipaenabledflag=[u'TRUE'],
|
||||
ipaenabledflag=[True],
|
||||
dn=fuzzy_selinuxusermapdn,
|
||||
seealso=u'allow_all',
|
||||
),
|
||||
|
||||
@@ -105,7 +105,7 @@ class CAACLTracker(Tracker):
|
||||
ipauniqueid=[fuzzy_uuid],
|
||||
cn=[self.name],
|
||||
objectclass=objectclasses.caacl,
|
||||
ipaenabledflag=[u'TRUE'])
|
||||
ipaenabledflag=[True])
|
||||
|
||||
self.attrs.update(self.create_categories)
|
||||
if self.description:
|
||||
@@ -374,10 +374,10 @@ class CAACLTracker(Tracker):
|
||||
|
||||
def enable(self):
|
||||
command = self.make_command(u'caacl_enable', self.name)
|
||||
self.attrs.update({u'ipaenabledflag': [u'TRUE']})
|
||||
self.attrs.update({u'ipaenabledflag': [True]})
|
||||
command()
|
||||
|
||||
def disable(self):
|
||||
command = self.make_command(u'caacl_disable', self.name)
|
||||
self.attrs.update({u'ipaenabledflag': [u'FALSE']})
|
||||
self.attrs.update({u'ipaenabledflag': [False]})
|
||||
command()
|
||||
@@ -52,7 +52,7 @@ class CertmapruleTracker(Tracker, EnableTracker):
|
||||
self.attrs = {
|
||||
'dn': self.dn,
|
||||
'cn': [self.name],
|
||||
'ipaenabledflag': [u'TRUE'],
|
||||
'ipaenabledflag': [True],
|
||||
'objectclass': objectclasses.certmaprule,
|
||||
}
|
||||
self.attrs.update({
|
||||
|
||||
@@ -86,7 +86,7 @@ class CertprofileTracker(Tracker):
|
||||
dn=unicode(self.dn),
|
||||
cn=[self.name],
|
||||
description=[self.description],
|
||||
ipacertprofilestoreissued=[unicode(self.store).upper()],
|
||||
ipacertprofilestoreissued=[self.store],
|
||||
objectclass=objectclasses.certprofile
|
||||
)
|
||||
self.exists = True
|
||||
|
||||
Reference in new issue
Block a user