Merge pull request #6242 from chrismeyersfsu/implement-6203

associate insights machine id w/ host on fact scan
This commit is contained in:
Chris Meyers
2017-05-16 10:27:45 -04:00
committed by GitHub
6 changed files with 98 additions and 3 deletions

View File

@@ -353,7 +353,7 @@ class Host(CommonModelNameNotUnique):
class Meta:
app_label = 'main'
unique_together = (("name", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
unique_together = (("name", "inventory"), ("insights_system_id", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
ordering = ('name',)
inventory = models.ForeignKey(
@@ -414,6 +414,13 @@ class Host(CommonModelNameNotUnique):
default={},
help_text=_('Arbitrary JSON structure of most recent ansible_facts, per-host.'),
)
insights_system_id = models.TextField(
blank=True,
default=None,
null=True,
db_index=True,
help_text=_('Red Hat Insights host unique identifier.'),
)
objects = HostManager()