if the user provides a uuid and it exists, allow that to tie to the instance, which allows the user to update the instance based on the UUID (includeding updating the hostname) should they choose to do so.

This commit is contained in:
Rebeccah
2021-09-13 12:16:21 -04:00
parent b41f90e7d4
commit 55f2125a51
2 changed files with 17 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ from solo.models import SingletonModel
from awx import __version__ as awx_application_version
from awx.api.versioning import reverse
from awx.main.managers import InstanceManager, InstanceGroupManager
from awx.main.managers import InstanceManager, InstanceGroupManager, UUID_DEFAULT
from awx.main.fields import JSONField
from awx.main.models.base import BaseModel, HasEditsMixin, prevent_search
from awx.main.models.unified_jobs import UnifiedJob
@@ -59,7 +59,7 @@ class Instance(HasPolicyEditsMixin, BaseModel):
objects = InstanceManager()
# Fields set in instance registration
uuid = models.CharField(max_length=40, default='00000000-0000-0000-0000-000000000000')
uuid = models.CharField(max_length=40, default=UUID_DEFAULT)
hostname = models.CharField(max_length=250, unique=True)
ip_address = models.CharField(
blank=True,