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:
Matthew Jones 2014-05-12 14:42:57 -04:00
parent a19f388e2d
commit e2d33522d2
4 changed files with 10 additions and 5 deletions

View File

@ -210,9 +210,9 @@ def rebuild_graph(message):
graph.add_node(wait_task)
for dependency in node_dependencies:
graph.add_edge(wait_task, dependency)
#if settings.DEBUG:
print("Graph Edges: %s" % str(graph.edges))
graph.generate_graphviz_plot()
if settings.DEBUG:
graph.generate_graphviz_plot()
return graph
def process_graph(graph, task_capacity):

View File

@ -50,16 +50,16 @@ logger = logging.getLogger('awx.main.tasks')
@task(bind=True)
def tower_periodic_scheduler(self):
def get_last_run():
if not os.path.exists('/tmp/.tower_cycle'):
if not os.path.exists(settings.SCHEDULE_METADATA_LOCATION):
return None
fd = open('/tmp/.tower_cycle')
fd = open(settings.SCHEDULE_METADATA_LOCATION)
try:
last_run = dateutil.parser.parse(fd.read())
return last_run
except Exception, e:
return None
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.close()

View File

@ -90,6 +90,9 @@ PROJECTS_ROOT = os.path.join(BASE_DIR, 'projects')
# directory should not be web-accessible
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
# Make this unique, and don't share it with anybody.

View File

@ -40,6 +40,8 @@ INTERNAL_API_URL = 'http://127.0.0.1:80'
# This directory should not be web-accessible
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'] = {
'level': 'WARNING',