• Kirill Smelkov's avatar
    software/ors-amarisoft: Fix enb.cfg build in standalone mode (cell_list) · 76092aa2
    Kirill Smelkov authored
    In b0c37a4a (software/ors-amarisoft: Start to generalize existing
    lopcomm/multicell into multiRU slowly) I deduplicated cell_list initialization
    and moved it into single place, but overlooked that enb.cfg build became broken
    in standalone mode:
    
        .../software/ors-amarisoft$ ./pythonwitheggs slapos-render-config.py
        Traceback (most recent call last):
          File "/srv/slapgrid/slappart35/srv/project/slapos/software/ors-amarisoft/./pythonwitheggs", line 47, in <module>
            exec(compile(__file__f.read(), __file__, "exec"))
          File "slapos-render-config.py", line 88, in <module>
            do('enb', {"tdd_ul_dl_config": "[Configuration 6] 5ms 5UL 3DL (maximum uplink)"})
          File "slapos-render-config.py", line 86, in do
            j2render(cfg, json_params % locals())
          File "slapos-render-config.py", line 34, in j2render
            f.write(r._render().decode())
          File ".../eggs/slapos.recipe.template-5.1-py3.9.egg/slapos/recipe/template/jinja2_template.py", line 215, in _render
            return template_object.render(**self.context).encode(self.encoding)
          File ".../eggs/Jinja2-2.11.3-py3.9.egg/jinja2/environment.py", line 1090, in render
            self.environment.handle_exception()
          File ".../eggs/Jinja2-2.11.3-py3.9.egg/jinja2/environment.py", line 832, in handle_exception
            reraise(*rewrite_traceback_stack(source=source))
          File ".../eggs/Jinja2-2.11.3-py3.9.egg/jinja2/_compat.py", line 28, in reraise
            raise value.with_traceback(tb)
          File "config/enb.jinja2.cfg", line 1, in top-level template code
            {%- set cell_count = cell_list|length %}
        jinja2.exceptions.UndefinedError: 'cell_list' is undefined
    
    -> Fix it by teaching enb.jinja2.cfg to also load cell list in standalone by itself.
    
    Not touching gnb.jinja2.cfg as currently gnb does not support multicell at all,
    and in the future it will be sole enb.cfg to handle both LTE and NR
    simultaneously.
    
    /cc @jhuge, @lu.xu, @xavier_thompson, @Daetalus
    76092aa2
enb.jinja2.cfg 11.1 KB