1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Allow fact scanning hosts with same name in two different inventories

This commit is contained in:
Chris Meyers 2015-06-19 10:29:00 -04:00
parent bda5a46729
commit 7e6dbd616d

View File

@ -21,15 +21,14 @@ class TransformField(BaseField):
return value
class FactHost(Document):
hostname = StringField(max_length=100, required=True, unique=True)
inventory_id = IntField(required=True)
hostname = StringField(max_length=100, required=True, unique_with='inventory_id')
inventory_id = IntField(required=True, unique_with='hostname')
# TODO: Consider using hashed index on hostname. django-mongo may not support this but
# executing raw js will
meta = {
'indexes': [
'hostname',
'inventory_id'
('hostname', 'inventory_id')
]
}