Skip to content

Commit

Permalink
Merge pull request #127 from vreuter/0.6-rc1
Browse files Browse the repository at this point in the history
0.6 rc1
  • Loading branch information
vreuter committed Jun 12, 2017
2 parents d9cdad0 + 697aa44 commit e0ced3c
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions looper/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,13 @@ def make_project_dirs(self):
folder_path = self.metadata[folder_name]
_LOGGER.debug("Ensuring project dir exists: '%s'", folder_path)
if not _os.path.exists(folder_path):
_LOGGER.debug("Creating: '%s'", folder_path)
_os.makedirs(folder_path)
_LOGGER.debug("Attempting to create project folder: '%s'",
folder_path)
try:
_os.makedirs(folder_path)
except OSError as e:
_LOGGER.warn("Could not create project folder: '%s'",
str(e))


def set_project_permissions(self):
Expand All @@ -772,11 +777,8 @@ def set_compute(self, setting):
:return bool: success flag for attempt to establish compute settings
"""

success = False

try:
# Hope that environment & environment compute are present.
if setting and self.environment and "compute" in self.environment:
# Hope that environment & environment compute are present.
if setting and self.environment and "compute" in self.environment:

# Augment compute, creating it if needed
if self.compute is None:
Expand All @@ -787,23 +789,24 @@ def set_compute(self, setting):

# Ensure submission template is absolute.
if not _os.path.isabs(self.compute.submission_template):
self.compute.submission_template = _os.path.join(
_os.path.dirname(self.environment_file),
self.compute.submission_template)
# Compute settings have been established.
success = True
try:
self.compute.submission_template = _os.path.join(
_os.path.dirname(self.environment_file),
self.compute.submission_template)
except AttributeError as e:
# Environment and environment compute should at least have been
# set as null-valued attributes, so execution here is an error.
_LOGGER.error(str(e))
# Compute settings have been established.
else:
return True
else:
# Scenario in which environment and environment compute are
# both present but don't evaluate to True is fairly
# innocuous, even common if outside of the looper context.
_LOGGER.debug("Environment = {}".format(self.environment))

else:
# Scenario in which environment and environment compute are
# both present but don't evaluate to True is fairly
# innocuous, even common if outside of the looper context.
_LOGGER.debug("Environment = {}".format(self.environment))
except AttributeError as e:
# Environment and environment compute should at least have been
# set as null-valued attributes, so execution here is an error.
_LOGGER.error(str(e))

return success
return False


def get_arg_string(self, pipeline_name):
Expand Down

0 comments on commit e0ced3c

Please sign in to comment.