[
https://issues.apache.org/jira/browse/CLOUDSTACK-10168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16298097#comment-16298097
]
ASF GitHub Bot commented on CLOUDSTACK-10168:
---------------------------------------------
rhtyd commented on a change in pull request #2366: CLOUDSTACK-10168 - VR
duplicate entries in /etc/hosts when reusing VM name
URL: https://github.com/apache/cloudstack/pull/2366#discussion_r157964380
##########
File path: systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py
##########
@@ -18,17 +18,22 @@
from pprint import pprint
from netaddr import *
-
def merge(dbag, data):
-
# A duplicate ip address wil clobber the old value
# This seems desirable ....
- if "add" in data and data['add'] is False and \
- "ipv4_adress" in data:
- if data['ipv4_adress'] in dbag:
- del(dbag[data['ipv4_adress']])
- return dbag
+ if "add" in data and data['add'] is False and "ipv4_address" in data:
+ if data['ipv4_address'] in dbag:
+ del(dbag[data['ipv4_address']])
else:
- dbag[data['ipv4_adress']] = data
- return dbag
+ remove_key = None
+ for key, entry in dbag.iteritems():
+ if key <> 'id' and entry['host_name'] == data['host_name']:
Review comment:
`<>` is deprecated and removed in Python 3.x, please use `!=` instead.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> VR duplicate entries in /etc/hosts when reusing VM name
> -------------------------------------------------------
>
> Key: CLOUDSTACK-10168
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10168
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.10.0.0, 4.9.2.0, 4.9.1.0, 4.9.0.1, 4.9.3.0
> Environment: * ACS4.9.0.1 + ACS4.9.1 + ACS4.9.2 + ACS4.9.3 +
> ACS4.10.0 / CentOS7
> * KVM / ACS 4.9.1-4.9.2-4.9.3+4.10.0 / CentOS7
> * Isolated networks
> Reporter: Dag Sonstebo
> Assignee: Rohit Yadav
>
> Steps to recreate:
> * Create VM on isolated network.
> * Delete the VM
> * Create a new VM with same name.
> * Repeat this multiple times.
> Result:
> * DNS entries are not housekept, allowing for multiples.
> * DNSmasq name resolution also returns multiple entries.
> * /etc/hosts:
> {code}
> root@r-15-VM:~# cat /etc/hosts
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> 10.1.1.230 R4VM1
> 10.1.1.208 R4VM2
> ::1 localhost ip6-localhost ip6-loopback
> 10.1.1.166 R4VM2
> 10.1.1.1 r-15-VM data-server
> 10.1.1.24 R4VM2
> 10.1.1.221 R4VM2
> 127.0.0.1 localhost r-15-VM
> {code}
> * Name resolving the R4VM2 name:
> {code}
> [root@R4VM1 ~]# nslookup r4vm2
> Server: 10.1.1.1
> Address: 10.1.1.1#53
>
> Name: r4vm2.cs2cloud.internal
> Address: 10.1.1.221
> Name: r4vm2.cs2cloud.internal
> Address: 10.1.1.208
> Name: r4vm2.cs2cloud.internal
> Address: 10.1.1.166
> Name: r4vm2.cs2cloud.internal
> Address: 10.1.1.24
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)