From f840013ed9987f5e079fa4b415b509fd81834a40 Mon Sep 17 00:00:00 2001 From: Tamer Ahmed Date: Tue, 18 Aug 2020 18:24:36 -0700 Subject: [PATCH] [cfggen] Allow Write To Redis DB With Template/Batch Mode (#5203) Argument to write to config-db is not allowed when using template. This PR allows cfggen to write to redis db when using template mode. signed-off-by: Tamer Ahmed --- src/sonic-config-engine/sonic-cfggen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 307c127bf908..0143be2ad04f 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -266,10 +266,10 @@ def main(): parser.add_argument("-T", "--template_dir", help="search base for the template files", action='store') group.add_argument("-v", "--var", help="print the value of a variable, support jinja2 expression") group.add_argument("--var-json", help="print the value of a variable, in json format") - group.add_argument("-w", "--write-to-db", help="write config into configdb", action='store_true') group.add_argument("--preset", help="generate sample configuration from a preset template", choices=get_available_config()) group = parser.add_mutually_exclusive_group() group.add_argument("--print-data", help="print all data", action='store_true') + group.add_argument("-w", "--write-to-db", help="write config into configdb", action='store_true') group.add_argument("-K", "--key", help="Lookup for a specific key") args = parser.parse_args()