1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

guess_clone_name fix. should check hostname, not fqdn.

guess_clone_name calls guess_mac_address in instance view
This commit is contained in:
Ing. Jan KRCMAR 2016-06-08 13:37:26 +02:00
parent 14e8418472
commit 08cc19900c
2 changed files with 3 additions and 1 deletions

View file

@ -790,7 +790,8 @@ def guess_clone_name(request):
for line in f:
line = line.strip()
if "host %s" % prefix in line:
hostname = line.split(' ')[1]
fqdn = line.split(' ')[1]
hostname = fqdn.split('.')[0]
if hostname.startswith(prefix) and hostname not in instance_names:
return HttpResponse(json.dumps({'name': hostname}))
return HttpResponse(json.dumps({}));