python/sepolicy: Initialize policy.ports as a dict in generate.py

in class policy, ports is usually initialized with the result of
get_all_ports(), which is a dict. If this function failed, the error was
not fatal but ports was left initialized as a list, which would trigger
other errors when accessing it.

Initialize ports as an empty dict in order to fix this issue.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2018-02-14 22:16:24 +01:00 committed by stephensmalley
parent 8059ad7ad1
commit df135b07a7