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
b0fde63d
Commit
b0fde63d
authored
May 29, 2008
by
David Johnson
Browse files
Change some slice attributes stuff.
parent
3ad1910a
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/plab/mod_PLC4.py.in
View file @
b0fde63d
...
...
@@ -370,12 +370,17 @@ class PLCagent:
def
AuthCheck
(
self
):
return
self
.
__server
.
AuthCheck
(
self
.
auth
)
def
SliceAddAttribute
(
self
,
attrname
,
attrvalue
):
def
SliceAddAttribute
(
self
,
attrname
,
attrvalue
,
node
=
None
):
if
attrname
==
None
or
attrvalue
==
None
\
or
attrname
==
''
or
attrvalue
==
''
:
return
0
return
self
.
__server
.
AddSliceAttribute
(
self
.
auth
,
self
.
slicename
,
attrname
,
attrvalue
)
if
node
:
return
self
.
__server
.
AddSliceAttribute
(
self
.
auth
,
self
.
slicename
,
attrname
,
attrvalue
,
node
)
else
:
return
self
.
__server
.
AddSliceAttribute
(
self
.
auth
,
self
.
slicename
,
attrname
,
attrvalue
)
pass
def
SiteAdd
(
self
,
name
,
url
,
longitude
,
latitude
):
return
self
.
__server
.
AddSite
(
self
.
auth
,
...
...
@@ -733,6 +738,7 @@ class mod_PLC4:
pass
# Allow slice attributes to be set "generically" via the db
# Also see below where we add slice attributes on a per-node basis
sas
=
self
.
plc
.
getAttrVal
(
"slice_attributes"
,
required
=
False
)
if
sas
:
try
:
...
...
@@ -802,6 +808,12 @@ class mod_PLC4:
print
"Failed to add nodes to slice %s"
%
slice
.
slicename
raise
# add any per-node or per-nodegroup attributes:
#
# XXX: will not work as above -- need to fix above and add this
# code in a way that works with the plab_attributes table.
#
# XXX: this is currently locked out to pi/user roles, although the docs
# say otherwise, so we can't use it automatically yet.
#
...
...
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