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
ba859a48
Commit
ba859a48
authored
Oct 26, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retry a few times to get the slice credential, if the slice is locked
(busy).
parent
2ae5f2cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
8 deletions
+41
-8
protogeni/test/test-common.py
protogeni/test/test-common.py
+41
-8
No files found.
protogeni/test/test-common.py
View file @
ba859a48
...
...
@@ -316,12 +316,28 @@ def resolve_slice( name, selfcredential ):
params
[
"urn"
]
=
name
else
:
params
[
"hrn"
]
=
name
rval
,
response
=
do_method
(
"sa"
,
"Resolve"
,
params
)
if
rval
:
Fatal
(
"Slice does not exist"
);
pass
else
:
return
response
[
"value"
]
count
=
2
while
True
:
rval
,
response
=
do_method
(
"sa"
,
"Resolve"
,
params
)
if
rval
:
if
rval
==
14
:
if
count
:
print
" Will try again in a few seconds"
count
=
count
-
1
;
time
.
sleep
(
5.0
)
else
:
Fatal
(
"Giving up, busy for too long"
);
pass
else
:
Fatal
(
"Slice does not exist"
);
pass
pass
else
:
break
pass
return
response
[
"value"
]
def
get_slice_credential
(
slice
,
selfcredential
):
if
slicecredentialfile
:
...
...
@@ -337,8 +353,25 @@ def get_slice_credential( slice, selfcredential ):
params
[
"urn"
]
=
slice
[
"urn"
]
else
:
params
[
"uuid"
]
=
slice
[
"uuid"
]
rval
,
response
=
do_method
(
"sa"
,
"GetCredential"
,
params
)
if
rval
:
Fatal
(
"Could not get Slice credential"
)
pass
count
=
2
while
True
:
rval
,
response
=
do_method
(
"sa"
,
"GetCredential"
,
params
)
if
rval
:
if
rval
==
14
:
if
count
:
print
" Will try again in a few seconds"
count
=
count
-
1
;
time
.
sleep
(
5.0
)
else
:
Fatal
(
"Giving up, busy for too long"
);
pass
else
:
Fatal
(
"Could not get Slice credential"
)
pass
pass
else
:
break
pass
return
response
[
"value"
]
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