Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
a1d6805a
Commit
a1d6805a
authored
May 22, 2008
by
David Johnson
Browse files
Add slice attributes based on plab_attributes db config.
parent
9ffd8db7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/plab/mod_PLC4.py.in
View file @
a1d6805a
...
...
@@ -731,7 +731,29 @@ class mod_PLC4:
%
slice
.
slicename
raise
pass
# Allow slice attributes to be set "generically" via the db
sas
=
self
.
plc
.
getAttrVal
(
"slice_attributes"
,
required
=
False
)
if
sas
:
try
:
kvpairs
=
sas
.
split
(
','
)
for
kvp
in
kvpairs
:
(
k
,
v
)
=
kvp
.
split
(
':'
,
1
)
res
=
tryXmlrpcCmd
(
agent
.
SliceAddAttribute
,(
k
,
v
),
OKstrs
=
[
'Slice attribute already exists'
])
if
debug
:
print
"SliceAddAttribute(%s,%s) result: %s"
\
%
(
str
(
k
),
str
(
v
),
res
)
pass
pass
pass
except
:
print
"Failed to set slice attribute %s=%s on slice %s"
\
%
(
str
(
k
),
str
(
v
),
slice
.
slicename
)
raise
pass
try
:
userlist
=
slice
.
getSliceUsers
()
# XXX: we might not always want to add emulabman
...
...
@@ -1013,6 +1035,11 @@ class mod_PLC4:
def
createNode
(
self
,
node
):
plcagent
=
self
.
__getAgent
(
node
.
slice
.
slicename
)
if
debug
:
print
"createNode for node %s (%s/%s) starting"
\
%
(
str
(
node
.
nodeid
),
str
(
node
.
hostname
),
str
(
node
.
IP
))
pass
ticketdata
=
cPickle
.
loads
(
node
.
slice
.
slicemeta
)
node
.
nmagent
=
NM4agent
(
node
.
IP
,
node
.
nodeid
,
self
.
nmuid
,
self
.
nmkey
)
...
...
Write
Preview
Supports
Markdown
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