provision_instance should create new uuid if needed

.. instead of default to current system's UUID

related: #10990
This commit is contained in:
Jim Ladd
2021-08-31 16:42:44 -07:00
parent 7bf3ee69ef
commit f02099e8b7
2 changed files with 6 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
import sys
import logging
import os
from uuid import uuid4
from django.db import models
from django.conf import settings
@@ -115,7 +116,7 @@ class InstanceManager(models.Manager):
def register(self, uuid=None, hostname=None, ip_address=None, node_type='hybrid', defaults=None):
if not uuid:
uuid = settings.SYSTEM_UUID
uuid = str(uuid4())
if not hostname:
hostname = settings.CLUSTER_HOST_ID
with advisory_lock('instance_registration_%s' % hostname):