Skip to content

Commit

Permalink
#312 Convert bytes to string for proper workflow config comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Blanton authored and Chris Blanton committed Jan 7, 2025
1 parent d4a4f4e commit 80fa721
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fre/pp/install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ def install_subtool(experiment, platform, target):
source_dir = Path(os.path.expanduser("~/cylc-src"), name)
install_dir = Path(os.path.expanduser("~/cylc-run"), name)
if os.path.isdir(install_dir):
installed_def = subprocess.run(["cylc", "config", name],capture_output=True).stdout
# must convert from bytes to string for proper comparison
installed_def = subprocess.run(["cylc", "config", name],capture_output=True).stdout.decode('utf-8')
go_back_here = os.getcwd()
os.chdir(source_dir)
source_def = subprocess.run(['cylc', 'config', '.'], capture_output=True).stdout
source_def = subprocess.run(['cylc', 'config', '.'], capture_output=True).stdout.decode('utf-8')
if installed_def == source_def:
print(f"NOTE: Workflow '{install_dir}' already installed, and the definition is unchanged")
else:
Expand Down

0 comments on commit 80fa721

Please sign in to comment.