Add common code for determining active (licensed) hosts with unique names, update licensing code and inventory import to use it. Implements https://trello.com/c/2Q9Mosks

This commit is contained in:
Chris Church
2014-12-03 19:41:01 -05:00
parent 6b91f46082
commit fcf7398ec6
3 changed files with 12 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ from django.core.cache import cache
# AWX
from awx.main.constants import CLOUD_PROVIDERS
from awx.main.fields import AutoOneToOneField
from awx.main.managers import HostManager
from awx.main.models.base import *
from awx.main.models.jobs import Job
from awx.main.models.unified_jobs import *
@@ -387,6 +388,8 @@ class Host(CommonModelNameNotUnique):
help_text=_('Inventory source(s) that created or modified this host.'),
)
objects = HostManager()
def __unicode__(self):
return self.name