Use the public ipv4 if it exists; otherwise use the ipv6 to do a

cdist cdist ssh configure
This commit is contained in:
PCoder 2018-06-27 00:01:50 +02:00
commit 6c2eabbe6a
2 changed files with 59 additions and 2 deletions

View file

@ -190,7 +190,7 @@ def create_vm_task(self, vm_template_id, user, specs, template,
# try to see if we have the IP and that if the ssh keys can
# be configured
new_host = manager.get_primary_ipv4(vm_id)
new_host = manager.get_primary_ip(vm_id)
logger.debug("New VM ID is {vm_id}".format(vm_id=vm_id))
if new_host is not None:
custom_user = CustomUser.objects.get(email=user.get('email'))