Commit 43706e08 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9b1e9ec8
......@@ -17,7 +17,7 @@ CB5 = "COMP-4020"
supply(kamari, computer_guid=CB5)
icore = request(kamari,
icore = kslap.request(kamari,
software_type="core-network",
partition_reference="CB5-CORE",
filter_kw={"computer_guid": CB5},
......@@ -25,13 +25,16 @@ icore = request(kamari,
'core_network_plmn': '31415',
})})
print(icore)
#iicore = slap.registerComputerPartition(icore.slap_computer_id, icore.slap_computer_partition_id)
#print(iicore)
print()
isim1 = kslap.iSIM(icore, 1)
print(icore)
print(isim1)
sys.exit(1)
ienb = request(kamari,
ienb = kslap.request(kamari,
software_type="enb",
partition_reference="CB5-ENB",
filter_kw={"computer_guid": CB5},
......
# Module kslap provides utility routines for dealing with SlapOS.
import json
# after importing users should do kslap.init(slap)
slap = None
def init(slap_):
global slap
slap = slap_
# XXX
def request(software_release, **kw):
i = slap.registerOpenOrder().request(software_release, **kw)
ref = kw['partition_reference']
#assert i.instance_title == ref, (ref, i.instance_title)
# request does not always initialize .instance_title
i._kkk_ref = ref
# request does not initialize ._software_release_url
sr_attr = '_software_release_document'
if not hasattr(i, sr_attr):
setattr(i, sr_attr, software_release)
return i
# ref_of_instance returns reference an instance was requested with.
def ref_of_instance(inst):
return inst._kkk_ref
return inst.instance_title # XXX ok? (master seems to be putting reference to title)
print('\n\n\n', dir(inst), '\n\n\n')
print('id:', inst.getId())
print('guid:', inst.getInstanceGuid())
print('part_id:', inst._partition_id)
print('instance_title:', inst.instance_title)
print('root_short_title:', inst.root_instance_short_title)
print('root_title:', inst.root_instance_title)
print('slave_list:', inst.slave_instance_list)
print('\n\n\n')
i_comp_id = inst.slap_computer_id
i_part_id = inst.slap_computer_partition_id
for x in slap.getOpenOrderDict().values(): # XXX linear search
"""
# XXX slave instances don't have ._computer_reference / ._reference
# e.g. Wendelin.Kirr.Development.Frontend
if not (hasattr(x, '_computer_reference') and hasattr(x, '_reference')):
print('skip %s %s' % (x._title, x._software_release_url))
continue
"""
print()
print(x, x._title, x._software_release_url)
print(dir(x))
continue
if x._computer_reference == i_comp_id and \
x._reference == i_part_id:
return x._partition_reference
......
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