Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
{ip: hosts} syntax goes wrong if ip contains 1::
Needs to anchore regexp
  • Loading branch information
Ian Southam
Ian Southam committed Feb 9, 2015
commit 9ade49e0e44fe97da107cec65aa39250cb695c21
4 changes: 2 additions & 2 deletions systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def preseed(self):
def write_hosts(self):
file = CsFile("/etc/hosts")
for ip in self.hosts:
file.search("%s" % ip, "%s\t%s" % (ip, self.hosts[ip]))
file.search("^%s" % ip, "%s\t%s" % (ip, self.hosts[ip]))
file.commit()
if file.is_changed():
logging.info("Updated hosts file")
Expand All @@ -155,4 +155,4 @@ def add(self, entry):
v['gateway'] = entry['default_gateway']

def add_host(self, ip, hosts):
self.hosts.update({ip: hosts})
self.hosts[ip] = hosts