Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python/semanage: move valid_types initialisations to class constructors
Based on idea from Nicolas Iooss <nicolas.iooss@m4x.org> Fixes: $ sudo semanage Traceback (most recent call last): File "/usr/sbin/semanage", line 28, in <module> import seobject File "/usr/lib/python3.7/site-packages/seobject.py", line 1045, in <module> class portRecords(semanageRecords): File "/usr/lib/python3.7/site-packages/seobject.py", line 1047, in portRecords valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, "port_type"))[0]["types"]) File "/usr/lib/python3.7/site-packages/sepolicy/__init__.py", line 203, in <genexpr> return ({ File "/usr/lib64/python3.7/site-packages/setools/typeattrquery.py", line 65, in results for attr in self.policy.typeattributes(): AttributeError: 'NoneType' object has no attribute 'typeattributes' #81 Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
- Loading branch information
1 parent
691231e
commit a73b0bb
Showing
1 changed file
with
34 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters