mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 12:27:37 -02:30
modularization of inventory_import command
This separates file parsing logic that was mixed in with other important code inside of the inventory import command. The logic around MemObject data structures was moved to utils, and the file parsing was moved to a legacy module. As of this commit, that module can operate within the Tower environment but it will be removed. Also refactor the loggers to fix old bug and work inside of the different contexts - the Loader classes, mem objects, and hopefully the inventory modules eventually.
This commit is contained in:
@@ -733,6 +733,13 @@ class InventorySourceOptions(BaseModel):
|
||||
('custom', _('Custom Script')),
|
||||
]
|
||||
|
||||
# From the options of the Django management base command
|
||||
INVENTORY_UPDATE_VERBOSITY_CHOICES = [
|
||||
(0, '0 (WARNING)'),
|
||||
(1, '1 (INFO)'),
|
||||
(2, '2 (DEBUG)'),
|
||||
]
|
||||
|
||||
# Use tools/scripts/get_ec2_filter_names.py to build this list.
|
||||
INSTANCE_FILTER_NAMES = [
|
||||
"architecture",
|
||||
@@ -879,6 +886,11 @@ class InventorySourceOptions(BaseModel):
|
||||
blank=True,
|
||||
default=0,
|
||||
)
|
||||
verbosity = models.PositiveIntegerField(
|
||||
choices=INVENTORY_UPDATE_VERBOSITY_CHOICES,
|
||||
blank=True,
|
||||
default=1,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_ec2_region_choices(cls):
|
||||
@@ -1116,7 +1128,7 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions):
|
||||
def _get_unified_job_field_names(cls):
|
||||
return ['name', 'description', 'source', 'source_path', 'source_script', 'source_vars', 'schedule',
|
||||
'credential', 'source_regions', 'instance_filters', 'group_by', 'overwrite', 'overwrite_vars',
|
||||
'timeout', 'launch_type', 'scm_project_update',]
|
||||
'timeout', 'verbosity', 'launch_type', 'scm_project_update',]
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# If update_fields has been specified, add our field names to it,
|
||||
|
||||
Reference in New Issue
Block a user