sepolicy/interface: Use relative python 3 imports
Fixes: Verify sepolicy interface -c -i works ... Traceback (most recent call last): File "/usr/bin/sepolicy", line 699, in <module> args.func(args) File "/usr/bin/sepolicy", line 508, in interface print_interfaces(args.interfaces, args) File "/usr/bin/sepolicy", line 492, in print_interfaces interface_compile_test(i) File "/usr/lib/python3.6/site-packages/sepolicy/interface.py", line 226, in interface_compile_test fd.write(generate_compile_te(interface, idict)) File "/usr/lib/python3.6/site-packages/sepolicy/interface.py", line 184, in generate_compile_te from templates import test_module ModuleNotFoundError: No module named 'templates' Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
parent
0be11881d1
commit
acc43466f5
|
@ -171,7 +171,7 @@ def get_interface_format_text(interface, path="/usr/share/selinux/devel/policy.x
|
|||
|
||||
|
||||
def get_interface_compile_format_text(interfaces_dict, interface):
|
||||
from templates import test_module
|
||||
from .templates import test_module
|
||||
param_tmp = []
|
||||
for i in interfaces_dict[interface][0]:
|
||||
param_tmp.append(test_module.dict_values[i])
|
||||
|
@ -181,7 +181,7 @@ def get_interface_compile_format_text(interfaces_dict, interface):
|
|||
|
||||
|
||||
def generate_compile_te(interface, idict, name="compiletest"):
|
||||
from templates import test_module
|
||||
from .templates import test_module
|
||||
te = ""
|
||||
te += re.sub("TEMPLATETYPE", name, test_module.te_test_module)
|
||||
te += get_interface_compile_format_text(idict, interface)
|
||||
|
|
Loading…
Reference in New Issue