mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 20:07:37 -02:30
Implement item copy feature
See acceptance doc for implement details. Signed-off-by: Aaron Tan <jangsutsr@gmail.com>
This commit is contained in:
@@ -48,6 +48,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
|
||||
an inventory source contains lists and hosts.
|
||||
'''
|
||||
|
||||
FIELDS_TO_PRESERVE_AT_COPY = ['hosts', 'groups', 'instance_groups']
|
||||
KIND_CHOICES = [
|
||||
('', _('Hosts have a direct link to this inventory.')),
|
||||
('smart', _('Hosts for inventory generated using the host_filter property.')),
|
||||
@@ -503,6 +504,10 @@ class Host(CommonModelNameNotUnique):
|
||||
A managed node
|
||||
'''
|
||||
|
||||
FIELDS_TO_PRESERVE_AT_COPY = [
|
||||
'name', 'description', 'groups', 'inventory', 'enabled', 'instance_id', 'variables'
|
||||
]
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = (("name", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
|
||||
@@ -690,6 +695,10 @@ class Group(CommonModelNameNotUnique):
|
||||
groups.
|
||||
'''
|
||||
|
||||
FIELDS_TO_PRESERVE_AT_COPY = [
|
||||
'name', 'description', 'inventory', 'children', 'parents', 'hosts', 'variables'
|
||||
]
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = (("name", "inventory"),)
|
||||
|
||||
Reference in New Issue
Block a user