Bug 1460818 - python3 type change from selinux.security_get_boolean_names
python3 type change from selinux.security_get_boolean_names
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: libselinux (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Lautrbach
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-12 16:58 EDT by Dusty Mabe
Modified: 2017-06-13 08:41 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-13 08:41:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dusty Mabe 2017-06-12 16:58:14 EDT
Description of problem:

In Fedora 25 the return type of the items in the list returned by the python3 selinux.security_get_boolean_names() was 'bytes'. In Fedora 26 this is 'str'.

This causes the ansible seboolean module to blow up here: https://github.com/ansible/ansible/blob/025b52938eb449b48e6ac57254161ad4673ab79c/lib/ansible/modules/system/seboolean.py#L76-L85


Output from f25:
```
[root@vanilla-f25atomic ~]# rpm -q libselinux-python libselinux-python3
libselinux-python-2.5-13.fc25.x86_64
libselinux-python3-2.5-13.fc25.x86_64
[root@vanilla-f25atomic ~]# python3 -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<class 'bytes'>
[root@vanilla-f25atomic ~]# 
[root@vanilla-f25atomic ~]# python -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<type 'str'>
```

Output from f26:
```
[root@f1 ~]# rpm -q libselinux-python libselinux-python3 
libselinux-python-2.6-6.fc26.x86_64
libselinux-python3-2.6-6.fc26.x86_64
[root@f1 ~]# python3 -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<class 'str'>
[root@f1 ~]# python -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<type 'str'>
```
Comment 1 Dusty Mabe 2017-06-12 17:00:27 EDT
We are trying to find out if this change was intentional or not.
Comment 2 Petr Lautrbach 2017-06-13 04:54:25 EDT
This change was intentional. The previous version was causing issues
with string manipulation functions like split()

https://github.com/SELinuxProject/selinux/commit/b8711e2eaf4f83bf943ac8ad28c35cb1db9c001f
Comment 3 Dusty Mabe 2017-06-13 08:41:17 EDT
Thanks for the update - I opened a bug upstream against ansible: https://github.com/ansible/ansible/issues/25651

Note You need to log in before you can comment on or make changes to this bug.