git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
28e1fb9
)
- use slice_fields instead of update_fields
author
Mark Huang
<mlhuang@cs.princeton.edu>
Fri, 13 Oct 2006 20:05:38 +0000
(20:05 +0000)
committer
Mark Huang
<mlhuang@cs.princeton.edu>
Fri, 13 Oct 2006 20:05:38 +0000
(20:05 +0000)
PLC/Methods/UpdateSlice.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/UpdateSlice.py
b/PLC/Methods/UpdateSlice.py
index
8b34ed1
..
1dcbd26
100644
(file)
--- a/
PLC/Methods/UpdateSlice.py
+++ b/
PLC/Methods/UpdateSlice.py
@@
-56,7
+56,7
@@
class UpdateSlice(Method):
raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
# Renewing
raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
# Renewing
- if 'expires' in
update_fields and updat
e_fields['expires'] > slice['expires']:
+ if 'expires' in
slice_fields and slic
e_fields['expires'] > slice['expires']:
sites = Sites(self.api, [slice['site_id']]).values()
assert sites
site = sites[0]
sites = Sites(self.api, [slice['site_id']]).values()
assert sites
site = sites[0]
@@
-68,15
+68,15
@@
class UpdateSlice(Method):
# XXX Make this configurable
max_expires = time.time() + (8 * 7 * 24 * 60 * 60)
# XXX Make this configurable
max_expires = time.time() + (8 * 7 * 24 * 60 * 60)
- if 'admin' not in self.caller['roles'] and
updat
e_fields['expires'] > max_expires:
+ if 'admin' not in self.caller['roles'] and
slic
e_fields['expires'] > max_expires:
raise PLCInvalidArgument, "Cannot renew a slice beyond 8 weeks from now"
raise PLCInvalidArgument, "Cannot renew a slice beyond 8 weeks from now"
- if 'max_nodes' in
update_fields and updat
e_fields['max_nodes'] != slice['max_nodes']:
+ if 'max_nodes' in
slice_fields and slic
e_fields['max_nodes'] != slice['max_nodes']:
if 'admin' not in self.caller['roles'] and \
'pi' not in self.caller['roles']:
raise PLCInvalidArgument, "Only admins and PIs may update max_nodes"
if 'admin' not in self.caller['roles'] and \
'pi' not in self.caller['roles']:
raise PLCInvalidArgument, "Only admins and PIs may update max_nodes"
- slice.update(
updat
e_fields)
+ slice.update(
slic
e_fields)
# XXX Make this a configurable policy
if slice['description'] is None or not slice['description'].strip() or \
# XXX Make this a configurable policy
if slice['description'] is None or not slice['description'].strip() or \