Commit 468b1dc2 authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: pep8 test corrections

parent 97ac9598
......@@ -429,7 +429,7 @@ class SlaprunnerTestCase(unittest.TestCase):
# Test that the new call to isSoftwareReleaseReady
# doesn't overwrite the previous installed one
completed_path = os.path.join(self.app.config['runner_workdir'],
'softwareLink', 'slaprunner-test', '.completed')
'softwareLink', 'slaprunner-test', '.completed')
completed_text = ".completed file: test"
completed = open(completed_path, "w")
completed.write(completed_text)
......
......@@ -820,13 +820,13 @@ def isSoftwareReleaseReady(config):
project = os.path.join(config['etc_dir'], '.project')
if not os.path.exists(project):
return "0"
path = open(project, 'r').readline().strip()
path = open(project, 'r').readline().strip()
software_name = path
if software_name[-1] == '/':
software_name = software_name[:-1]
software_name = software_name.split('/')[-1]
config_SR_folder(config)
if os.path.exists(os.path.join(config['runner_workdir'],
if os.path.exists(os.path.join(config['runner_workdir'],
'softwareLink', software_name, '.completed')):
return "1"
else:
......@@ -843,7 +843,7 @@ def isSoftwareReleaseReady(config):
def cloneDefaultGit(config):
"""Test if the default git has been downloaded yet
If not, download it in read-only mode"""
default_git = os.path.join(config['runner_workdir'],
default_git = os.path.join(config['runner_workdir'],
'project', 'default_repo')
if not os.path.exists(default_git):
data = {'path': default_git,
......
......@@ -43,6 +43,7 @@ logger = logging.getLogger('werkzeug')
def login_redirect(*args, **kwargs):
return redirect(url_for('login'))
@app.before_request
def before_request():
if request.path.startswith('/static') \
......@@ -57,6 +58,7 @@ def before_request():
if request.path != "/setAccount" and request.path != "/configAccount":
return redirect(url_for('setAccount'))
# general views
def home():
return render_template('index.html')
......@@ -644,9 +646,11 @@ def editFile():
def shell():
return render_template('shell.html')
def isSRReady():
return isSoftwareReleaseReady(app.config)
#Setup List of URLs
app.add_url_rule('/', 'home', home)
app.add_url_rule('/browseWorkspace', 'browseWorkspace', browseWorkspace)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment