diff --git a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py index 1a64efcfa1..4703211b51 100755 --- a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py +++ b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py @@ -563,9 +563,11 @@ def hasIP(self, ip): return ip in self.address.values() def arpPing(self): + if not self.address['gateway'] or self.address['gateway'] == 'None': + return cmd = "arping -c 1 -I %s -A -U -s %s %s" % ( self.dev, self.address['public_ip'], self.address['gateway']) - CsHelper.execute(cmd) + CsHelper.execute(cmd, wait=False) # Delete any ips that are configured but not in the bag def compare(self, bag): diff --git a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py index dc9b1a8842..0f19cc531b 100755 --- a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py +++ b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py @@ -166,12 +166,12 @@ def get_hostname(): return line.strip() -def execute(command): +def execute(command, wait=True): """ Execute command """ logging.debug("Executing: %s" % command) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - result = p.communicate()[0] - return result.splitlines() + if wait: + return p.communicate()[0].splitlines() def save_iptables(command, iptables_file): diff --git a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/merge.py b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/merge.py index 4bc9f55fe2..88399ce639 100755 --- a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/merge.py +++ b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/merge.py @@ -199,7 +199,7 @@ def processCLItem(self, num, nw_type): if ('localgw' in self.qFile.data['cmd_line']): dp['gateway'] = self.qFile.data['cmd_line']['localgw'] else: - dp['gateway'] = 'None' + dp['gateway'] = self.qFile.data['cmd_line'].get('gateway', 'None') dp['nic_dev_id'] = num dp['nw_type'] = nw_type qf = QueueFile()