mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 19:51:08 -03:30
Allow fact scanning hosts with same name in two different inventories
This commit is contained in:
@@ -21,15 +21,14 @@ class TransformField(BaseField):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
class FactHost(Document):
|
class FactHost(Document):
|
||||||
hostname = StringField(max_length=100, required=True, unique=True)
|
hostname = StringField(max_length=100, required=True, unique_with='inventory_id')
|
||||||
inventory_id = IntField(required=True)
|
inventory_id = IntField(required=True, unique_with='hostname')
|
||||||
|
|
||||||
# TODO: Consider using hashed index on hostname. django-mongo may not support this but
|
# TODO: Consider using hashed index on hostname. django-mongo may not support this but
|
||||||
# executing raw js will
|
# executing raw js will
|
||||||
meta = {
|
meta = {
|
||||||
'indexes': [
|
'indexes': [
|
||||||
'hostname',
|
('hostname', 'inventory_id')
|
||||||
'inventory_id'
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user