[swugenerator][PATCH] Revert "Handle multiple configuration files"

3 views
Skip to first unread message

Stefano Babic

unread,
Sep 18, 2025, 11:31:50 AM (13 days ago) Sep 18
to swup...@googlegroups.com, Stefano Babic, James Hilliard, Ernestas Kulik
This reverts commit af6f21260b85c0c3c5c779d04d0ca5c6bc169c42.

After discussion on ML, this feature can be done in other way by using
the include directive of libconfig.

A config file could be created in this way:

variables : {
@include "file1"
@include "file2"
.....
}

The commit breaks how the paramters are passed making them dependent of
the order in which the command line args are specified.

Signed-off-by: Stefano Babic <stefan...@swupdate.org>
Reported-by: James Hilliard <james.h...@gmail.com>
CC: Ernestas Kulik <ernes...@iconn-networks.com>
---
swugenerator/main.py | 12 ------------
1 file changed, 12 deletions(-)

diff --git a/swugenerator/main.py b/swugenerator/main.py
index ed0c94f..fbc28f4 100644
--- a/swugenerator/main.py
+++ b/swugenerator/main.py
@@ -27,15 +27,6 @@ class InvalidSigningOption(ValueError):
"""Raised when an invalid signing option is passed via command line"""


-class UpdateAction(argparse.Action):
- def __call__(self, parser, namespace, values, option_string=None):
- cfg = getattr(namespace, self.dest, None)
- if cfg is None:
- cfg = {}
- cfg.update(*values)
- setattr(namespace, self.dest, cfg)
-
-
def extract_keys(keyfile: str) -> Tuple[Optional[str], Optional[str]]:
"""Extracts encryption key and initialization vector (IV)

@@ -312,13 +303,10 @@ def parse_args(args: List[str]) -> None:
help="SWU output file",
)

- parser.register("action", "update", UpdateAction)
parser.add_argument(
"-c",
"--config",
default={},
- action="update",
- nargs="*",
type=parse_config_file,
help="configuration file",
)
--
2.43.0

Reply all
Reply to author
Forward
0 new messages