Skip to content

Commit

Permalink
Merge pull request #31 from MissionCriticalCloud/fix/vr-improvements-…
Browse files Browse the repository at this point in the history
…acs-backport

Don't wait for arping result
  • Loading branch information
Boris Schrijver authored Jul 11, 2016
2 parents ad8c4df + 6fb72dc commit 83b1ea9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 83b1ea9

Please # to comment.