bts: Recreate resources.conf trx_list with len based on num_trx

We are already doing this for defaults.cfg, but not for resources.conf.
As a result, if we have a trx_list with 2 trx but we have set num_trx=1
(default), parsing will fail later in bsc.cfg.tmpl because
conf_for_bsc_prepare() will pass a trx_list with 2 trx.

Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831
This commit is contained in:
Pau Espin 2018-07-27 16:15:59 +02:00
parent bc1ed88304
commit 698ad4ce50
1 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,7 @@
import os
import pprint
import tempfile
import copy
from abc import ABCMeta, abstractmethod
from . import log, config, util, template, process, schema, pcu_osmo
@ -112,7 +113,12 @@ class Bts(log.Origin, metaclass=ABCMeta):
config.overlay(values, { 'cell_identity': self.cellid })
if self.bvci is not None:
config.overlay(values, { 'bvci': self.bvci })
config.overlay(values, self.conf)
conf = copy.deepcopy(self.conf)
trx_list = conf.get('trx_list')
if trx_list and len(trx_list) != self.num_trx():
conf['trx_list'] = Bts._trx_list_recreate(trx_list, self.num_trx())
config.overlay(values, conf)
sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client()
config.overlay(values, sgsn_conf)