git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01aa57a
)
sfi: Renew() handles single slivers + cosmetic
author
Mohamed Larabi
<mohamed.larabi@inria.fr>
Tue, 17 Dec 2013 14:12:09 +0000
(15:12 +0100)
committer
Mohamed Larabi
<mohamed.larabi@inria.fr>
Tue, 17 Dec 2013 14:12:09 +0000
(15:12 +0100)
sfa/client/sfi.py
patch
|
blob
|
history
diff --git
a/sfa/client/sfi.py
b/sfa/client/sfi.py
index
dca8e9a
..
e557537
100644
(file)
--- a/
sfa/client/sfi.py
+++ b/
sfa/client/sfi.py
@@
-1147,7
+1147,7
@@
use this if you mean an authority instead""")
@register_command("slice_hrn [<sliver_urn> ... <sliver_urn>]","")
def delete(self, options, args):
"""
@register_command("slice_hrn [<sliver_urn> ... <sliver_urn>]","")
def delete(self, options, args):
"""
- de-allocate and de-provision all or named slivers of the slice (Delete)
+ de-allocate and de-provision all or named slivers of the
named
slice (Delete)
"""
server = self.sliceapi()
"""
server = self.sliceapi()
@@
-1239,7
+1239,7
@@
use this if you mean an authority instead""")
@register_command("slice_hrn [<sliver_urn> ... <sliver_urn>]","")
def provision(self, options, args):
"""
@register_command("slice_hrn [<sliver_urn> ... <sliver_urn>]","")
def provision(self, options, args):
"""
- provision al
ready or named
allocated slivers of the named slice (Provision)
+ provision al
l or named already
allocated slivers of the named slice (Provision)
"""
server = self.sliceapi()
server_version = self.get_cached_server_version(server)
"""
server = self.sliceapi()
server_version = self.get_cached_server_version(server)
@@
-1304,7
+1304,7
@@
use this if you mean an authority instead""")
@register_command("slice_hrn","")
def status(self, options, args):
"""
@register_command("slice_hrn","")
def status(self, options, args):
"""
- retrieve the status of the slivers belonging to t
n
e named slice (Status)
+ retrieve the status of the slivers belonging to t
h
e named slice (Status)
"""
server = self.sliceapi()
"""
server = self.sliceapi()
@@
-1333,7
+1333,7
@@
use this if you mean an authority instead""")
@register_command("slice_hrn [<sliver_urn> ... <sliver_urn>] action","")
def action(self, options, args):
"""
@register_command("slice_hrn [<sliver_urn> ... <sliver_urn>] action","")
def action(self, options, args):
"""
- Perform the named operational action on
these slivers
+ Perform the named operational action on
all or named slivers of the named slice
"""
server = self.sliceapi()
api_options = {}
"""
server = self.sliceapi()
api_options = {}
@@
-1362,18
+1362,26
@@
use this if you mean an authority instead""")
print value
return value
print value
return value
- @register_command("slice_hrn time","")
+ @register_command("slice_hrn
[<sliver_urn> ... <sliver_urn>]
time","")
def renew(self, options, args):
"""
def renew(self, options, args):
"""
- renew slice (Renew
Sliver
)
+ renew slice (Renew)
"""
server = self.sliceapi()
"""
server = self.sliceapi()
- if len(args)
!=
2:
+ if len(args)
<
2:
self.print_help()
sys.exit(1)
self.print_help()
sys.exit(1)
- [ slice_hrn, input_time ] = args
- # slice urn
- slice_urn = hrn_to_urn(slice_hrn, 'slice')
+ slice_hrn = args[0]
+ slice_urn = Xrn(slice_hrn, type='slice').get_urn()
+
+ if len(args) > 2:
+ # we have sliver urns
+ sliver_urns = args[1:-1]
+ else:
+ # we provision all the slivers of the slice
+ sliver_urns = [slice_urn]
+ input_time = args[-1]
+
# time: don't try to be smart on the time format, server-side will
# creds
slice_cred = self.slice_credential(args[0])
# time: don't try to be smart on the time format, server-side will
# creds
slice_cred = self.slice_credential(args[0])
@@
-1383,7
+1391,7
@@
use this if you mean an authority instead""")
api_options['call_id']=unique_call_id()
if options.show_credential:
show_credentials(creds)
api_options['call_id']=unique_call_id()
if options.show_credential:
show_credentials(creds)
- result = server.Renew(
[slice_urn]
, creds, input_time, *self.ois(server,api_options))
+ result = server.Renew(
sliver_urns
, creds, input_time, *self.ois(server,api_options))
value = ReturnValue.get_value(result)
if self.options.raw:
save_raw_to_file(result, self.options.raw, self.options.rawformat, self.options.rawbanner)
value = ReturnValue.get_value(result)
if self.options.raw:
save_raw_to_file(result, self.options.raw, self.options.rawformat, self.options.rawbanner)