Commit dd502ce4 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: slapos-render-config: Diverge enb.cfg and ue.cfg generation

The procedures to generate those are currently very similar, and that's why we
employ a shared `do` function to render them. But enb and ue rendering will
become different from each other in the next step.

-> Prepare to that by pushing necessary bits of do into do_enb and do_ue insides.

No change in rendered files.
parent b461c283
......@@ -43,7 +43,8 @@ def j2render(src, out, jcfg):
f.write(r._render().decode())
def do(src, out, slapparameter_dict):
def do_enb():
def do(src, out, slapparameter_dict):
defaults = {
"com_ws_port": 9001,
"com_addr": "127.0.1.2",
......@@ -75,16 +76,11 @@ def do(src, out, slapparameter_dict):
"etc": "etc",
"var": "var"
},
"pub_info": {
"rue_bind_addr": "::1",
"com_addr": "[::1]:9002"
},
"slapparameter_dict": %(jslapparameter_dict)s
}"""
j2render(src, out, json_params % locals())
def do_enb():
peer_lte = {
'cell_type': 'lte',
'e_cell_id': '0x12345',
......@@ -158,6 +154,25 @@ def do_enb():
def do_ue():
def do(src, out, slapparameter_dict):
jslapparameter_dict = json.dumps(slapparameter_dict)
json_params = """{
"slap_configuration": {
"tap-name": "slaptap9"
},
"directory": {
"log": "log",
"etc": "etc",
"var": "var"
},
"pub_info": {
"rue_bind_addr": "::1",
"com_addr": "[::1]:9002"
},
"slapparameter_dict": %(jslapparameter_dict)s
}"""
j2render(src, out, json_params % locals())
do('ue.jinja2.cfg', 'ue-lte.cfg', {'ue_type': 'lte', 'rue_addr': 'host1'})
do('ue.jinja2.cfg', 'ue-nr.cfg', {'ue_type': 'nr', 'rue_addr': 'host2'})
......
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