From d20e640e563fc212d289edcc55dccacc1da0d74b Mon Sep 17 00:00:00 2001 From: vsoch Date: Wed, 12 Jun 2024 05:48:29 -0600 Subject: [PATCH] attributes are under task Signed-off-by: vsoch --- jobspec/transformer/flux/steps.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jobspec/transformer/flux/steps.py b/jobspec/transformer/flux/steps.py index ffbe1ce..b405fc3 100644 --- a/jobspec/transformer/flux/steps.py +++ b/jobspec/transformer/flux/steps.py @@ -83,10 +83,8 @@ def prepare(self, command=None, waitable=False): # We can get the resources from options resources = self.options.get("resources") - - # These aren't used yet - they need to go into flux - attributes = self.options.get("attributes") or {} task = self.options.get("task") or {} + attributes = task.get("attributes") or {} # This flattens to be what we ask flux for slot = resources.flatten_slot() @@ -101,9 +99,10 @@ def prepare(self, command=None, waitable=False): watch = attributes.get("watch") # Environment - for key, value in attributes.get("environment") or {}: + for key, value in attributes.get("environment", {}).items(): cmd += [f"--env={key}={value}"] + print(cmd) # Note that you need to install our frobnicator plugin # for this to work. See the examples/depends_on directory for depends_on in task.get("depends_on") or []: @@ -270,7 +269,8 @@ def run(self, *args, **kwargs): cmd = self.generate_command() # Are we watching? - attributes = self.options.get("attributes") or {} + task = self.options.get("task") or {} + attributes = task.get("attributes") or {} watch = attributes.get("watch") res = utils.run_command(cmd, check_output=True, stream=watch)