Github user wilderrodrigues commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1346#discussion_r50252187 --- Diff: systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py --- @@ -96,29 +96,8 @@ def configure_server(self): self.conf.search(sline, line) def delete_leases(self): - changed = [] - leases = [] try: - for line in open(LEASES): - bits = line.strip().split(' ') - to = {"device": bits[0], - "mac": bits[1], - "ip": bits[2], - "host": bits[3:], - "del": False - } - changed.append(to) - - for v in changed: - if v['mac'] == to['mac'] or v['ip'] == to['ip'] or v['host'] == to['host']: - to['del'] = True - leases.append(to) - - for o in leases: - if o['del']: - cmd = "dhcp_release eth%s %s %s" % (o['device'], o['ip'], o['mac']) - logging.info(cmd) - CsHelper.execute(cmd) + open(LEASES, 'w').close() --- End diff -- Hi @pdube From an static analysis point of view, I understand your concerns. However, when we tested this in the lab, we found out that it was always trying to execute the dhcp_lease command against eth0, only eth0. The result of given command was actually nothing! What is being done now takes care of getting rid of the leases in the file, because they have already been deleted. @borisroman, please add more if I forgot something. Cheers, Wilder
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---