Github user remibergsma commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1346#discussion_r50251651
  
    --- 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 --
    
    Instead of removing one entry, everything gets deleted and then the ones 
needed are added again later on.


---
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.
---

Reply via email to