mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-04 20:02:25 +00:00
libsemanage: improve semanage_migrate_store import failure
The selinux/semanage python module import error in semanage_migrate_store was misleading. Before, it would report that the selinux/semanage modules were not installed even though they were on the system. Now the import failure is only reported if the modules are not installed. Otherwise, a stack trace is printed for all other errors in the selinux/semanage python modules. Signed-off-by: Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com>
This commit is contained in:
parent
385ef2cdc6
commit
c7fa63150e
@ -15,7 +15,7 @@ sepol = ctypes.cdll.LoadLibrary('libsepol.so.1')
|
|||||||
try:
|
try:
|
||||||
import selinux
|
import selinux
|
||||||
import semanage
|
import semanage
|
||||||
except:
|
except ImportError:
|
||||||
print("You must install libselinux-python and libsemanage-python before running this tool", file=sys.stderr)
|
print("You must install libselinux-python and libsemanage-python before running this tool", file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user