Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cylc/rose/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,7 @@ def record_cylc_install_options(
rose_orig_host = get_host()
for section in list(SECTIONS) + ['env']:
if section in cli_config:
cli_config[section].set(
['ROSE_ORIG_HOST'],
f'"{rose_orig_host}"'
if section in SECTIONS else rose_orig_host
)
cli_config[section].set(['ROSE_ORIG_HOST'], rose_orig_host)
cli_config[section]['ROSE_ORIG_HOST'].comments = [
ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING
]
Expand Down
12 changes: 6 additions & 6 deletions tests/functional/test_post_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_rose_fileinstall_uses_rose_template_vars(tmp_path):
'opts=\n[env]\nFOO=1'
f'\n[template variables]\nX=Y\n'
f'#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n'
f'ROSE_ORIG_HOST="{HOST}"\n'
f'ROSE_ORIG_HOST={HOST}\n'
f'\n[env]\n'
f'#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n'
f'ROSE_ORIG_HOST={HOST}\n'
Expand All @@ -139,16 +139,16 @@ def test_rose_fileinstall_uses_rose_template_vars(tmp_path):
'test/opt/rose-suite-bar.conf': '',
'test/opt/rose-suite-baz.conf': '',
'test/opt/rose-suite-cylc-install.conf': (
'!opts=bar\n[env]\nBAR=1\nROSE_ORIG_HOST="abc123"\n'
'\n[template variables]\nROSE_ORIG_HOST="abc123"\n'
'!opts=bar\n[env]\nBAR=1\nROSE_ORIG_HOST=abc123\n'
'\n[template variables]\nROSE_ORIG_HOST=abc123\n'
),
'ref/opt/rose-suite-cylc-install.conf':
f'!opts=bar baz\n[env]\nBAR=2\n'
f'#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n'
f'ROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n'
f'#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n'
f'ROSE_ORIG_HOST="{HOST}"\n',
f'ROSE_ORIG_HOST={HOST}\n',
'ref/rose-suite.conf': '!opts=foo bar baz (cylc-install)',
'ref/opt/rose-suite-foo.conf': '',
'ref/opt/rose-suite-bar.conf': '',
Expand Down Expand Up @@ -177,7 +177,7 @@ def test_rose_fileinstall_uses_rose_template_vars(tmp_path):
f'ROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n'
f'#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n'
f'ROSE_ORIG_HOST="{HOST}"\n'
f'ROSE_ORIG_HOST={HOST}\n'
),
'ref/rose-suite.conf': '!opts=a b c (cylc-install)',
'ref/opt/rose-suite-a.conf': '',
Expand Down Expand Up @@ -207,7 +207,7 @@ def test_rose_fileinstall_uses_rose_template_vars(tmp_path):
f'ROSE_ORIG_HOST={HOST}\n'
f'[jinja2:suite.rc]\na="b"\n'
f'#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n'
f'ROSE_ORIG_HOST="{HOST}"\n'
f'ROSE_ORIG_HOST={HOST}\n'
),
'ref/rose-suite.conf': (
'!opts=foo bar (cylc-install)\n[jinja2:suite.rc]\ny="base"'
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/test_reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async def test_cylc_validate(fixture_provide_flow, cylc_validate_cli):
'# This file records CLI Options.{version_info}\n'
'!opts=b c\n'
f'\n[env]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST="{HOST}"\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
)
)
]
Expand All @@ -152,7 +152,7 @@ def test_cylc_install_files(fixture_install_flow, file_, expect, version_info):
'# This file records CLI Options.{version_info}\n'
'!opts=b c d\n'
f'\n[env]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST="{HOST}"\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
)
)
]
Expand Down Expand Up @@ -195,7 +195,7 @@ async def test_cylc_reinstall_files(
'# This file records CLI Options.{version_info}\n'
'!opts=b c d\n'
f'\n[env]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST="{HOST}"\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
)
)
]
Expand Down
6 changes: 2 additions & 4 deletions tests/functional/test_reinstall_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ async def fixture_install_flow(
'[env]\n'
f'FOO=1\n#{ROHIOS}\n'
f'ROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n#{ROHIOS}'
f'\nROSE_ORIG_HOST="{HOST}"\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
)
),
]
Expand All @@ -132,8 +131,7 @@ def test_cylc_install_files(fixture_install_flow, file_, expect, version_info):
'[env]\n'
f'BAR=2\n#{ROHIOS}\n'
f'ROSE_ORIG_HOST={HOST}\n'
f'\n[template variables]\n#{ROHIOS}'
f'\nROSE_ORIG_HOST="{HOST}"\n'
f'\n[template variables]\n#{ROHIOS}\nROSE_ORIG_HOST={HOST}\n'
)
)
]
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_fileinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def test_rose_fileinstall_rose_suite_cylc_install_conf(
"[env]\n"
"FOO=42\n"
f"#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n"
f'ROSE_ORIG_HOST={host}\n\n'
f"ROSE_ORIG_HOST={host}\n\n"
"[jinja2:suite.rc]\n"
"BAR=84\n"
"CORNETTO=120\n"
"FLAKE=99\n"
f"#{ROSE_ORIG_HOST_INSTALLED_OVERRIDE_STRING}\n"
f'ROSE_ORIG_HOST="{host}"\n'
f"ROSE_ORIG_HOST={host}\n"
)