mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
only import the redbaron library on-demand
redbaron is a library we use to facilitate parsing local settings files; at _import_ time it generates a parse tree and caches it to disk at `/tmp`; this process is _really time consuming, and only necessary if we're actually *using* the library right now, we're importing this library and paying the penalty _every_ time we load the awx application
This commit is contained in:
@@ -6,9 +6,6 @@ import glob
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
# RedBaron
|
|
||||||
from redbaron import RedBaron, indent
|
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.conf.registry import settings_registry
|
from awx.conf.registry import settings_registry
|
||||||
|
|
||||||
@@ -33,6 +30,8 @@ def comment_assignments(patterns, assignment_names, dry_run=True, backup_suffix=
|
|||||||
|
|
||||||
|
|
||||||
def comment_assignments_in_file(filename, assignment_names, dry_run=True, backup_filename=None):
|
def comment_assignments_in_file(filename, assignment_names, dry_run=True, backup_filename=None):
|
||||||
|
from redbaron import RedBaron, indent
|
||||||
|
|
||||||
if isinstance(assignment_names, basestring):
|
if isinstance(assignment_names, basestring):
|
||||||
assignment_names = [assignment_names]
|
assignment_names = [assignment_names]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user