Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos
Commits
43706e08
Commit
43706e08
authored
Oct 19, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9b1e9ec8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
software/ors-amarisoft/k/krequest-cb5.enb+
software/ors-amarisoft/k/krequest-cb5.enb+
+6
-3
software/ors-amarisoft/k/kslap.py
software/ors-amarisoft/k/kslap.py
+38
-0
No files found.
software/ors-amarisoft/k/krequest-cb5.enb+
View file @
43706e08
...
...
@@ -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},
...
...
software/ors-amarisoft/k/kslap.py
View file @
43706e08
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment