[PATCH 1/2] catalyst.git: Quote toml paths in custom catalyst.conf

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] catalyst.git: Quote toml paths in custom catalyst.conf

Daniel Cordero
From: Daniel Cordero <[hidden email]>

With the change to catalyst.conf into TOML format, update the
catalyst.git script to quote paths. The / character is not allowed in
TOML values unless quoted.

fixes: 66e78a8d55d (catalyst: Convert catalyst.conf to TOML)

  NOTICE  : Loading configuration file: /tmp/catalyst.conf.3b5seckb
  CRITICAL: Could not find parse configuration file: /tmp/catalyst.conf.3b5seckb: Invalid date or number (line 1 column 1 char 0)
---
 bin/catalyst.git | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/catalyst.git b/bin/catalyst.git
index 9b3deaa1..071bf58b 100755
--- a/bin/catalyst.git
+++ b/bin/catalyst.git
@@ -27,9 +27,9 @@ def main(argv):
  with tempfile.NamedTemporaryFile(prefix='catalyst.conf.') as conf:
  # Set up a config file with paths to the local tree.
  conf.write(
- ('sharedir=%(source_root)s\n'
- 'shdir=%(source_root)s/targets\n'
- 'envscript=%(source_root)s/etc/catalystrc\n'
+ ('sharedir="%(source_root)s"\n'
+ 'shdir="%(source_root)s/targets"\n'
+ 'envscript="%(source_root)s/etc/catalystrc"\n'
  % {'source_root': source_root}).encode('utf8')
  )
  conf.flush()
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] Add shdir to valid config values

Daniel Cordero
From: Daniel Cordero <[hidden email]>

The catalyst.git script specified this configuration option, which would
not pass validation because shdir was not in the list of
valid_config_file_values.

Add shdir to the list of allowed valid_config_file_values.

Remove shdir from the catalyst.git script anyway, as it would match the default.

Fixes: 8443f89f3c5df (catalyst: Verify config options against valid_config_file_values)

  NOTICE  : Loading configuration file: /tmp/catalyst.conf.tyxsgh1l
  CRITICAL: Unknown option 'shdir' in config file /tmp/catalyst.conf.tyxsgh1l
---
 bin/catalyst.git     | 1 -
 catalyst/defaults.py | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/catalyst.git b/bin/catalyst.git
index 071bf58b..29b72c30 100755
--- a/bin/catalyst.git
+++ b/bin/catalyst.git
@@ -28,7 +28,6 @@ def main(argv):
  # Set up a config file with paths to the local tree.
  conf.write(
  ('sharedir="%(source_root)s"\n'
- 'shdir="%(source_root)s/targets"\n'
  'envscript="%(source_root)s/etc/catalystrc"\n'
  % {'source_root': source_root}).encode('utf8')
  )
diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 14f671fe..b5026e95 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -18,6 +18,7 @@ valid_config_file_values = frozenset([
     "repo_name",
     "repos",
     "sharedir",
+    "shdir",
     "storedir",
     "target_distdir",
     "target_pkgdir",
--
2.26.2