From d1dadbd358e9535172dccda06da7dad6819310a3 Mon Sep 17 00:00:00 2001 From: Louis Royer Date: Thu, 24 Oct 2024 17:38:35 +0200 Subject: [PATCH] Fix lint --- default-config.yaml | 2 +- scripts/config_edit.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/default-config.yaml b/default-config.yaml index 5df6255..dba928b 100644 --- a/default-config.yaml +++ b/default-config.yaml @@ -7,7 +7,7 @@ config: nb_edges: 2 nb_ue: 1 dataplane: # ( nextmn-srv6 | free5gc | nextmn-upf) - - "nextmn-srv6" + - "nextmn-srv6" log_level: "info" full_debug: false diff --git a/scripts/config_edit.py b/scripts/config_edit.py index 294288c..cfe7d80 100755 --- a/scripts/config_edit.py +++ b/scripts/config_edit.py @@ -11,6 +11,11 @@ class ConfigException(Exception): '''Configuration issue''' +class Dumper(yaml.Dumper): #pylint: disable=too-many-ancestors + '''yaml dumper''' + def increase_indent(self, flow=False, indentless=False): + return super().increase_indent(flow, False) + if __name__ == '__main__': parser = argparse.ArgumentParser( prog='config-edit', @@ -58,4 +63,4 @@ class ConfigException(Exception): if args.full_debug is not None: c['config']['topology']['full_debug'] = args.full_debug.lower() == 'true' with open(args.buildconfig, 'w', encoding='utf-8') as f2: - yaml.dump(c, f2) + yaml.dump(c, f2, Dumper, default_flow_style=False)