Bug 1414078

Summary: sepolicy gui tracebacks: NameError: global name 'compare' is not defined
Product: [Fedora] Fedora Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dwalsh, mgrepl, plautrba, pmoore, vmojzis
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1420482 (view as bug list) Environment:
Last Closed: 2017-01-24 15:40:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milos Malik 2017-01-17 17:08:06 UTC
Description of problem:
* happens when sepolicy gui is executed in SSH terminal

NVRs:
checkpolicy-2.6-0.1.fc25.x86_64
libselinux-2.6-0.1.fc25.x86_64
libselinux-devel-2.6-0.1.fc25.x86_64
libselinux-python-2.6-0.1.fc25.x86_64
libselinux-python3-2.6-0.1.fc25.x86_64
libselinux-utils-2.6-0.1.fc25.x86_64
libsemanage-2.6-0.2.fc25.x86_64
libsemanage-devel-2.6-0.2.fc25.x86_64
libsemanage-python-2.6-0.2.fc25.x86_64
libsemanage-python3-2.6-0.2.fc25.x86_64
libsepol-2.6-0.1.fc25.x86_64
libsepol-devel-2.6-0.1.fc25.x86_64
libsepol-static-2.6-0.1.fc25.x86_64
policycoreutils-2.6-0.2.fc25.x86_64
policycoreutils-devel-2.6-0.2.fc25.x86_64
policycoreutils-gui-2.6-0.2.fc25.x86_64
policycoreutils-python-2.6-0.2.fc25.x86_64
policycoreutils-python3-2.6-0.2.fc25.x86_64
policycoreutils-python-utils-2.6-0.2.fc25.x86_64
policycoreutils-sandbox-2.6-0.2.fc25.x86_64
python-2.7.12-7.fc25.x86_64
python3-3.5.2-4.fc25.x86_64
selinux-policy-3.13.1-225.6.fc25.noarch
selinux-policy-devel-3.13.1-225.6.fc25.noarch
selinux-policy-sandbox-3.13.1-225.6.fc25.noarch
selinux-policy-targeted-3.13.1-225.6.fc25.noarch
setools-console-4.0.1-0.2.fc25.x86_64
setools-python3-4.0.1-0.2.fc25.x86_64
setools-python-4.0.1-0.2.fc25.x86_64

Steps to Reproduce:
# sepolicy gui
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
/usr/lib/python2.7/site-packages/sepolicy/gui.py:29: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 700, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 326, in gui_run
    sepolicy.gui.SELinuxGui(args.domain, args.test)
  File "/usr/lib/python2.7/site-packages/sepolicy/gui.py", line 119, in __init__
    sepolicy_domains.sort(compare)
NameError: global name 'compare' is not defined
#

Expected results:
* no tracebacks

Comment 1 Petr Lautrbach 2017-01-24 15:40:42 UTC
Fixed in policycoreutils-2.6-0.5