• Kirill Smelkov's avatar
    software/ors-amarisoft: enb+ue: Query slapparameter_dict from master only once · 5bf02857
    Kirill Smelkov authored
    We are currently querying it in instance.cfg and later, once again, in e.g. instance-enb.jinja2.cfg .
    
    However ORS mode will need to adjust slapparameter_dict with ORS defaults
    and pass it further to generic enb. So it won't work if we use
    slapparameter_dict obtained the second time because the second query will
    return unadjusted original slapparameter_dict.
    
    In this patch we are only doing preparatory step - redo the code not query the
    master from instance-{enb,ue}.jinja2.cfg and work with slapparameter_dict and
    slap_configuration already queried by instance.cfg
    
    For UE the change is trivial.
    
    For eNB instance-enb.jinja2.cfg used to set the defaults for com, mme, amf and
    gtp in the same section used for the second query. We rework those defaults to
    be applied to slapparameter_dict via jinja2 - via the same way we are going to
    later use in ORS mode.
    
    Handling defaults for everything besides gtp_addr is straightforward. For
    gtp_addr it has the semantic difference when explicitly given, and given only
    implicitly. In the latter case the intent of original code is to autodetect
    whether to use an address on loopback, or externally-visible address.
    
    Original code used the check for emptiness of mme_list/amf_list as the
    condition for "use loopback". Since now those lists, after applying their
    defaults, are never empty we rework the code to see if core address is on the
    loopback or not, and use auto-GTP-on-loopback only if core is also on loopback.
    This should, hopefully, be more convenient as it also works ok out of the box
    if core is on loopback, but its address was explicitly specified. Previously
    for such cases gtp_addr was also needed to be specified, and now it should work
    without that.
    
    No change to rendered enb.cfg and gnb.cfg besides whitespace.
    
    Adjust ipv6-random usage in core-network for consistency with enb as well.
    5bf02857
libinstance.jinja2.cfg 9.51 KB