diff --git a/puppet/zulip_ops/files/zulip-ec2-configure-interfaces b/puppet/zulip_ops/files/zulip-ec2-configure-interfaces index 5e868e195f..f63f3566ed 100755 --- a/puppet/zulip_ops/files/zulip-ec2-configure-interfaces +++ b/puppet/zulip_ops/files/zulip-ec2-configure-interfaces @@ -105,7 +105,9 @@ for device in macs.values(): # HACK: It appears on Xenial device_number in the data set is 0 but in reality it is 3 device_number += 3 - if address_of(device_number) is None: + address = address_of(device_number) + + if address is None: # If the device was not autoconfigured, do so now. log.info("Device ens%i not configured, starting dhcpd" % (device_number,)) subprocess.check_call(['/sbin/dhcpcd', 'ens%i' % device_number]) @@ -127,7 +129,7 @@ for device in macs.values(): ['/sbin/iptables', '-t', 'mangle', '-A', 'OUTPUT', '-m', 'conntrack', '--ctorigdst', address, '-j', 'MARK', '--set-mark', dev_num]) - to_configure.remove(address_of(device_number)) + to_configure.remove(address) for (count, ip) in enumerate(to_configure): # Configure the IP via a virtual interface