Commit f9a065da authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: slapos-render-config: Prepare to render both enb and gnd

Currently which config to render is hardcoded in this program and only of the
is rendered - currently gnb.  This leads to situation where it is easy to miss
breakage of unselected config.

-> Factor one config rendering into common routine as the preparatory step to
render both enb.cfg and gnb.cfg

/cc @jhuge, @lu.xu, @xavier_thompson, @Daetalus
parent 23581dc2
......@@ -34,17 +34,17 @@ def j2render(cfg, jcfg):
f.write(r._render().decode())
config = "gnb"
json_params_empty = """{
def do(cfg, slapparameter_dict):
jslapparameter_dict = json.dumps(slapparameter_dict)
json_params_empty = """{
"rf_mode": 'fdd',
"slap_configuration": {
},
"directory": {
},
"slapparameter_dict": {
}
}"""
json_params = """{
"slapparameter_dict": %(jslapparameter_dict)s
}"""
json_params = """{
"rf_mode": "tdd",
"trx": "sdr",
"bbu": "ors",
......@@ -80,9 +80,9 @@ json_params = """{
"etc": "etc",
"var": "var"
},
"slapparameter_dict": {
"tdd_ul_dl_config": "5ms 8UL 1DL 2/10 (maximum uplink)"
}
}"""
"slapparameter_dict": %(jslapparameter_dict)s
}"""
j2render(config, json_params)
j2render(cfg, json_params % locals())
do('gnb', {"tdd_ul_dl_config": "5ms 8UL 1DL 2/10 (maximum uplink)"})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment