Skip to content

Commit

Permalink
Fix: Script generation for pyflow resource
Browse files Browse the repository at this point in the history
  • Loading branch information
tbkr committed May 28, 2024
1 parent 7ab51b7 commit 2e98378
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pyflow/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,8 @@ def deploy_suite(self, target=FileSystem, **options):

target = target(self, **options)
for t in self.all_tasks:
script, includes = t.generate_script()
target.deploy_task(t.deploy_path, script, includes)
script, includes = t.generate_script()
target.deploy_task(t.deploy_path, script, includes)
for f in self.all_families:
manual = self.generate_stub(f.manual)
if manual:
Expand Down
20 changes: 11 additions & 9 deletions pyflow/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_resource(self, filename):

return []

def install_file_stub(self, target):
def set_server_filename(self, files_install_path=None):
"""
Installs any data associated with the resource object that is going to be deployed from the **ecFlow** server.
Expand All @@ -95,15 +95,17 @@ def install_file_stub(self, target):
assert self.fullname.count("/") > 1
subpath = self.fullname[self.fullname.find("/", 1) + 1 :]

self._server_filename = os.path.join(
target.files_install_path(), subpath, self.name
)

super().install_file_stub(target)
if files_install_path is None:
self._server_filename = os.path.join(
subpath, self.name
)
else:
self._server_filename = os.path.join(
files_install_path, self.fullname
)

self.save_data(target, self._server_filename)

def build_script(self):
def generate_script(self):
"""
Returns the installer script for the data resource.
Expand All @@ -128,7 +130,7 @@ def build_script(self):
for h in self._hosts:
lines += h.copy_file_to(self._server_filename, self.location()).split("\n")

return lines
return lines, []

def location(self):
"""
Expand Down

0 comments on commit 2e98378

Please sign in to comment.