Fix genman.py to correct PORT part

This commit is contained in:
Miroslav Grepl 2012-07-23 17:13:29 +02:00
parent 9c935861d2
commit 1c38921365

View File

@ -302,6 +302,7 @@ SELinux %(domainname)s policy is very flexible allowing users to setup their %(d
The following port types are defined for %(domainname)s:""" % {'domainname':self.domainname}) The following port types are defined for %(domainname)s:""" % {'domainname':self.domainname})
for p in self.ports: for p in self.ports:
print p
self.fd.write(""" self.fd.write("""
.EX .EX
@ -311,8 +312,9 @@ The following port types are defined for %(domainname)s:""" % {'domainname':self
.EE .EE
""" % p) """ % p)
once = True once = True
for p in ( "tcp", "udp" ): for prot in ( "tcp", "udp" ):
if (f,p) in portrecs: if (p,prot) in portrecs:
print (p,prot)
if once: if once:
self.fd.write(""" self.fd.write("""
@ -320,7 +322,7 @@ Default Defined Ports:""")
once = False once = False
self.fd.write(r""" self.fd.write(r"""
%s %s %s %s
.EE""" % (p, ",".join(portrecs[(f,p)]))) .EE""" % (prot, ",".join(portrecs[(p,prot)])))
def file_context(self): def file_context(self):
self.fd.write(r""" self.fd.write(r"""