mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
Fix issue #AC-1269
- Only enable graphviz task graph generation in debug mode - Define an appropriate place for the tower cycle file Conflicts: awx/settings/production.py
This commit is contained in:
@@ -210,9 +210,9 @@ def rebuild_graph(message):
|
|||||||
graph.add_node(wait_task)
|
graph.add_node(wait_task)
|
||||||
for dependency in node_dependencies:
|
for dependency in node_dependencies:
|
||||||
graph.add_edge(wait_task, dependency)
|
graph.add_edge(wait_task, dependency)
|
||||||
#if settings.DEBUG:
|
|
||||||
print("Graph Edges: %s" % str(graph.edges))
|
print("Graph Edges: %s" % str(graph.edges))
|
||||||
graph.generate_graphviz_plot()
|
if settings.DEBUG:
|
||||||
|
graph.generate_graphviz_plot()
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
def process_graph(graph, task_capacity):
|
def process_graph(graph, task_capacity):
|
||||||
|
|||||||
@@ -50,16 +50,16 @@ logger = logging.getLogger('awx.main.tasks')
|
|||||||
@task(bind=True)
|
@task(bind=True)
|
||||||
def tower_periodic_scheduler(self):
|
def tower_periodic_scheduler(self):
|
||||||
def get_last_run():
|
def get_last_run():
|
||||||
if not os.path.exists('/tmp/.tower_cycle'):
|
if not os.path.exists(settings.SCHEDULE_METADATA_LOCATION):
|
||||||
return None
|
return None
|
||||||
fd = open('/tmp/.tower_cycle')
|
fd = open(settings.SCHEDULE_METADATA_LOCATION)
|
||||||
try:
|
try:
|
||||||
last_run = dateutil.parser.parse(fd.read())
|
last_run = dateutil.parser.parse(fd.read())
|
||||||
return last_run
|
return last_run
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
return None
|
return None
|
||||||
def write_last_run(last_run):
|
def write_last_run(last_run):
|
||||||
fd = open('/tmp/.tower_cycle', 'w')
|
fd = open(settings.SCHEDULE_METADATA_LOCATION, 'w')
|
||||||
fd.write(last_run.isoformat())
|
fd.write(last_run.isoformat())
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ PROJECTS_ROOT = os.path.join(BASE_DIR, 'projects')
|
|||||||
# directory should not be web-accessible
|
# directory should not be web-accessible
|
||||||
JOBOUTPUT_ROOT = os.path.join(BASE_DIR, 'job_output')
|
JOBOUTPUT_ROOT = os.path.join(BASE_DIR, 'job_output')
|
||||||
|
|
||||||
|
# The heartbeat file for the tower scheduler
|
||||||
|
SCHEDULE_METADATA_LOCATION = os.path.join(BASE_DIR, '.tower_cycle')
|
||||||
|
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
|
||||||
# Make this unique, and don't share it with anybody.
|
# Make this unique, and don't share it with anybody.
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ INTERNAL_API_URL = 'http://127.0.0.1:80'
|
|||||||
# This directory should not be web-accessible
|
# This directory should not be web-accessible
|
||||||
JOBOUTPUT_ROOT = '/var/lib/awx/job_status/'
|
JOBOUTPUT_ROOT = '/var/lib/awx/job_status/'
|
||||||
|
|
||||||
|
The heartbeat file for the tower scheduler
|
||||||
|
SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle'
|
||||||
|
|
||||||
LOGGING['handlers']['rotating_file'] = {
|
LOGGING['handlers']['rotating_file'] = {
|
||||||
'level': 'WARNING',
|
'level': 'WARNING',
|
||||||
|
|||||||
Reference in New Issue
Block a user