mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge pull request #3018 from shapeblue/fixrouterfilecreation
Prevent error on GroupAnswers on VR creation
This commit is contained in:
commit
f95aec4a84
@ -524,15 +524,16 @@ class CsIP:
|
||||
CsHelper.execute("sudo ip route add throw " + self.config.address().dbag['eth1'][0]['network'] + " table " + tableName + " proto static")
|
||||
|
||||
# add 'defaul via gateway' rule in the device specific routing table
|
||||
if "gateway" in self.address and self.address["gateway"] != "None":
|
||||
if "gateway" in self.address and self.address["gateway"] and self.address["gateway"] != "None":
|
||||
route.add_route(self.dev, self.address["gateway"])
|
||||
if "network" in self.address and self.address["network"]:
|
||||
route.add_network_route(self.dev, str(self.address["network"]))
|
||||
|
||||
if self.get_type() in ["public"]:
|
||||
CsRule(self.dev).addRule("from " + str(self.address["network"]))
|
||||
|
||||
if self.config.is_vpc():
|
||||
if self.get_type() in ["public"] and "gateway" in self.address and self.address["gateway"] != "None":
|
||||
if self.get_type() in ["public"] and "gateway" in self.address and self.address["gateway"] and self.address["gateway"] != "None":
|
||||
route.add_route(self.dev, self.address["gateway"])
|
||||
for inf, addresses in self.config.address().dbag.iteritems():
|
||||
if not inf.startswith("eth"):
|
||||
|
||||
@ -50,9 +50,13 @@ class CsRoute:
|
||||
""" Wrapper method that adds table name and device to route statement """
|
||||
# ip route add dev eth1 table Table_eth1 10.0.2.0/24
|
||||
table = self.get_tablename(dev)
|
||||
|
||||
if not table or not address:
|
||||
empty_param = "table" if not table else "address"
|
||||
logging.info("Empty parameter received %s while trying to add route, skipping" % empty_param)
|
||||
else:
|
||||
logging.info("Adding route: dev " + dev + " table: " +
|
||||
table + " network: " + address + " if not present")
|
||||
cmd = "dev %s table %s %s" % (dev, table, address)
|
||||
cmd = "default via %s table %s proto static" % (address, table)
|
||||
self.set_route(cmd)
|
||||
|
||||
@ -60,6 +64,11 @@ class CsRoute:
|
||||
""" Wrapper method that adds table name and device to route statement """
|
||||
# ip route add dev eth1 table Table_eth1 10.0.2.0/24
|
||||
table = self.get_tablename(dev)
|
||||
|
||||
if not table or not address:
|
||||
empty_param = "table" if not table else "address"
|
||||
logging.info("Empty parameter received %s while trying to add network route, skipping" % empty_param)
|
||||
else:
|
||||
logging.info("Adding route: dev " + dev + " table: " +
|
||||
table + " network: " + address + " if not present")
|
||||
cmd = "throw %s table %s proto static" % (address, table)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user