Skip to content

Commit

Permalink
Correct wrong assumption made about data structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Rasche committed Oct 16, 2014
1 parent 961006d commit 9079c7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pulsar/client/action_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ def __client_to_config(self, client):
config = dict()
config["default_action"] = client.default_file_action
config["files_endpoint"] = client.files_endpoint
config["ssh_key"] = client.ssh_key
if hasattr(client, 'ssh_key'):
config["ssh_key"] = client.ssh_key
return config

def __load_action_config(self, path):
Expand Down Expand Up @@ -217,6 +218,7 @@ def __process_action(self, action, file_type):
action.url = url
elif action.action_type == "remote_rsync_transfer":
action.url = action.path
# Required, so no check for presence
action.ssh_key = self.ssh_key

REQUIRED_ACTION_KWD = object()
Expand Down
4 changes: 3 additions & 1 deletion pulsar/managers/stateful.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def do_preprocess():
try:
staging_config = job_directory.load_metadata("staging_config", {})
# TODO: swap out for a generic "job_extra_params"
if 'ssh_key' in staging_config['action_mapper']:
if 'action_mapper' in staging_config and \
'ssh_key' in staging_config['action_mapper'] and \
'setup' in staging_config:
for action in staging_config['setup']:
action['action'].update(ssh_key=staging_config['action_mapper']['ssh_key'])
preprocess(job_directory, staging_config.get("setup", []), self.__preprocess_action_executor)
Expand Down

0 comments on commit 9079c7d

Please sign in to comment.