Commit b4faf71d authored by Joanne Hugé's avatar Joanne Hugé

simpleran/instance-ors: cleanup amarisoft section

parent 40e80171
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = aa7feb77723afc25bb9403179d6a3f0f md5sum = fc545fa11ca2da5cff420c72e72ae8e9
[template-ors] [template-ors]
filename = instance-ors.cfg filename = instance-ors.cfg
md5sum = 1bcf1d10fdcc7f77172b93bf2c50241f md5sum = 307e38207945a9adcfea0263cba9d3a6
[slaplte.jinja2] [slaplte.jinja2]
_update_hash_filename_ = slaplte.jinja2 _update_hash_filename_ = slaplte.jinja2
......
...@@ -167,14 +167,14 @@ init = ...@@ -167,14 +167,14 @@ init =
} }
def get_sdr_info(cmd): def get_sdr_info(cmd):
if options['configuration'].get('testing', False): if options['configuration'].get('testing', False):
return {'t': 'TDD', 'b': 'B39', 'v': '4.2', 's': 'B53'}[cmd].encode() return {'t': 'TDD', 'b': 'B39', 'v': '4.2', 's': 'B53'}[cmd]
return subprocess.check_output( return subprocess.check_output(
["sudo", "-n", options['sdr-dir'] + "/get-sdr-info", "-" + cmd] ["sudo", "-n", options['sdr-dir'] + "/get-sdr-info", "-" + cmd]
) ).decode()
version = get_sdr_info('v').decode() version = get_sdr_info('v')
options['version'] = float(version) if version != 'UNKNOWN' else 0 options['version'] = float(version) if version != 'UNKNOWN' else 0
options['band'] = get_sdr_info('b').decode() options['band'] = get_sdr_info('b')
options['tdd'] = get_sdr_info('t').decode() options['tdd'] = get_sdr_info('t')
options['one-watt'] = bool(options['version'] >= 4) options['one-watt'] = bool(options['version'] >= 4)
options['ors-version'] = "{} {} {}".format( options['ors-version'] = "{} {} {}".format(
options['tdd'], options['tdd'],
......
...@@ -82,9 +82,9 @@ init = ...@@ -82,9 +82,9 @@ init =
[sdr] [sdr]
recipe = slapos.recipe.build recipe = slapos.recipe.build
dir = /opt/sdr
init = init =
pass # Set SDR directory
options['dir'] = options['configuration'].get('sdr_dir', '/opt/sdr')
[amarisoft] [amarisoft]
recipe = slapos.recipe.build recipe = slapos.recipe.build
...@@ -104,7 +104,7 @@ init = ...@@ -104,7 +104,7 @@ init =
else: else:
options['version'] = options['fixed_version'] options['version'] = options['fixed_version']
# Set Binaries and license directories # Set Binaries and license directories
binary_dir = options['dir'] + "/v" + options['version']. binary_dir = options['dir'] + "/v" + options['version']
options['license_dir'] = options['dir'] + '/.amarisoft' options['license_dir'] = options['dir'] + '/.amarisoft'
options['sdr_dir'] = options['binary_dir'] + '/trx_sdr' options['sdr_dir'] = options['binary_dir'] + '/trx_sdr'
options['enb_dir'] = options['binary_dir'] + '/enb' options['enb_dir'] = options['binary_dir'] + '/enb'
......
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