Commit 8536ddb2 authored by Céline Noirot's avatar Céline Noirot
Browse files

Add ###USER### placeholder in storage section.

parent a0b8de25
......@@ -47,6 +47,7 @@ from_password =
#message =
[storage]
# In this section, ###USER### (if it's used) is replaced by $USER environment variable.
# where should be written the log file
log_file = <path>/jflow.log
# Where should the pipelines write results, should be accessible
......
......@@ -219,8 +219,13 @@
<section id="storage" class="group">
<h1 class="page-header">Storage <small>section</small></h1>
<p>
This section configure the paths used by all workflows.
This section configure the paths used by all workflows.
</p>
<p>
On a multi-user computer or cluster you can use placeholder <code>###USER###</code>.
<code>###USER###</code> will be replace by the environment variable <code>$USER</code>.
</p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
......
......@@ -37,12 +37,12 @@ class JFlowConfigReader(object):
self.reader.read(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), self.CONFIG_FILE_PATH))
def get_tmp_directory(self):
if not os.path.isdir(self.reader.get("storage", "tmp_directory")):
os.makedirs(self.reader.get("storage", "tmp_directory"), 0o751)
return self.reader.get("storage", "tmp_directory")
if not os.path.isdir(self.reader.get("storage", "tmp_directory").replace("###USER###",os.getenv("USER"))):
os.makedirs(self.reader.get("storage", "tmp_directory").replace("###USER###",os.getenv("USER")), 0o751)
return self.reader.get("storage", "tmp_directory").replace("###USER###",os.getenv("USER"))
def get_work_directory(self):
return self.reader.get("storage", "work_directory")
return self.reader.get("storage", "work_directory").replace("###USER###",os.getenv("USER"))
def get_exec(self, software):
try:
......@@ -59,7 +59,7 @@ class JFlowConfigReader(object):
@return: the path to the log file
"""
try:
return self.reader.get('storage', 'log_file')
return self.reader.get('storage', 'log_file').replace("###USER###",os.getenv("USER"))
except :
raise NoOptionError("Failed when parsing the config file, no section logging found!")
......
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