Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
d5c719b7
Commit
d5c719b7
authored
Mar 04, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow extra argument, which should be a policy credential that
overrides the CM max_sliver_lifetime.
parent
3be88cd1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
11 deletions
+35
-11
protogeni/test/renewslice.py
protogeni/test/renewslice.py
+17
-5
protogeni/test/renewsliver.py
protogeni/test/renewsliver.py
+18
-6
No files found.
protogeni/test/renewslice.py
View file @
d5c719b7
#! /usr/bin/env python
#
# Copyright (c) 2008-201
1
University of Utah and the Flux Group.
# Copyright (c) 2008-201
4
University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
...
...
@@ -47,15 +47,23 @@ from M2Crypto import X509
ACCEPTSLICENAME
=
1
minutes
=
60
extracred
=
None
;
execfile
(
"test-common.py"
)
if
len
(
REQARGS
)
!=
1
:
if
len
(
REQARGS
)
<
1
:
print
>>
sys
.
stderr
,
"Must provide number of minutes to renew for"
sys
.
exit
(
1
)
else
:
minutes
=
REQARGS
[
0
]
pass
# Always first argument.
minutes
=
REQARGS
[
0
]
if
len
(
REQARGS
)
==
2
:
f
=
open
(
REQARGS
[
1
])
extracred
=
f
.
read
()
f
.
close
()
pass
#
# Get a credential for myself, that allows me to do things at the SA.
#
...
...
@@ -100,7 +108,11 @@ slicecred = get_slice_credential( myslice, mycredential )
print
"Got the slice credential, attempting to renew the sliver..."
;
params
=
{}
params
[
"credentials"
]
=
(
slicecred
,)
if
extracred
:
params
[
"credentials"
]
=
(
slicecred
,
extracred
)
else
:
params
[
"credentials"
]
=
(
slicecred
,)
pass
params
[
"slice_urn"
]
=
myslice
[
"urn"
]
params
[
"valid_until"
]
=
valid_until
rval
,
response
=
do_method
(
"cm"
,
"RenewSlice"
,
params
,
version
=
"2.0"
)
...
...
protogeni/test/renewsliver.py
View file @
d5c719b7
#! /usr/bin/env python
#
# Copyright (c) 2008-201
1
University of Utah and the Flux Group.
# Copyright (c) 2008-201
4
University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
...
...
@@ -45,16 +45,24 @@ from M2Crypto import X509
ACCEPTSLICENAME
=
1
minutes
=
60
minutes
=
60
extracred
=
None
;
execfile
(
"test-common.py"
)
if
len
(
REQARGS
)
!=
1
:
if
len
(
REQARGS
)
<
1
:
print
>>
sys
.
stderr
,
"Must provide number of minutes to renew for"
sys
.
exit
(
1
)
else
:
minutes
=
REQARGS
[
0
]
pass
# Always first argument.
minutes
=
REQARGS
[
0
]
if
len
(
REQARGS
)
==
2
:
f
=
open
(
REQARGS
[
1
])
extracred
=
f
.
read
()
f
.
close
()
pass
#
# Get a credential for myself, that allows me to do things at the SA.
#
...
...
@@ -80,7 +88,11 @@ valid_until = time.strftime("%Y%m%dT%H:%M:%S",
time
.
gmtime
(
time
.
time
()
+
(
60
*
int
(
minutes
))))
params
=
{}
params
[
"credentials"
]
=
(
slicecred
,)
if
extracred
:
params
[
"credentials"
]
=
(
slicecred
,
extracred
)
else
:
params
[
"credentials"
]
=
(
slicecred
,)
pass
params
[
"slice_urn"
]
=
myslice
[
"urn"
]
params
[
"valid_until"
]
=
valid_until
rval
,
response
=
do_method
(
"cm"
,
"RenewSlice"
,
params
,
version
=
"2.0"
)
...
...
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