Fixed password server respawning issue

Some changes to isolated network acl generation
This commit is contained in:
Ian Southam 2015-03-05 11:48:27 +01:00 committed by wilderrodrigues
parent 5ddf87b2fd
commit 6fc680be71
3 changed files with 7 additions and 7 deletions

View File

@ -307,10 +307,10 @@ class CsIP:
if self.get_type() in ["public"]:
self.fw.append(["mangle", "front",
"-A PREROUTING " +
"-d %s -j VPN_%s" % (self.address['network'], self.address['public_ip'])])
"-d %s/32 -j VPN_%s" % (self.address['public_ip'], self.address['public_ip'])])
self.fw.append(["mangle", "front",
"-A PREROUTING " +
"-d %s -j FIREWALL_%s" % (self.address['network'], self.address['public_ip'])])
"-d %s/32 -j FIREWALL_%s" % (self.address['public_ip'], self.address['public_ip'])])
self.fw.append(["mangle", "front",
"-A FIREWALL_%s " % self.address['public_ip'] +
"-m state --state RELATED,ESTABLISHED -j ACCEPT"])

View File

@ -69,7 +69,7 @@ class CsPasswdSvc():
def start(self):
proc = CsProcess(["dummy"])
if proc.grep("passwd_service %s" % self.ip) == -1:
if proc.grep("passwd_server_ip %s" % self.ip) == -1:
proc.start("/opt/cloud/bin/passwd_server_ip %s >> /var/log/cloud.log 2>&1" % self.ip, "&")
def stop(self):

View File

@ -18,15 +18,15 @@
from pprint import pprint
import copy
def merge(dbag, data):
dbagc = copy.deepcopy(dbag)
if "rules" not in data:
return dbagc
return dbagc
for rule in data['rules']:
id = str(rule['id'])
if rule['revoked']:
del(dbagc[id])
if id not in dbagc.keys():
if id in dbagc.keys():
del(dbagc[id])
elif id not in dbagc.keys():
dbagc[id] = rule
return dbagc