git://git.onelab.eu
/
unfold.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SFA Rest bug fix if the result value is 0
[unfold.git]
/
rest
/
sfa_api.py
diff --git
a/rest/sfa_api.py
b/rest/sfa_api.py
index
2cfb639
..
f88fc04
100644
(file)
--- a/
rest/sfa_api.py
+++ b/
rest/sfa_api.py
@@
-226,7
+226,9
@@
def sfa_client(request, method, hrn=None, urn=None, object_type=None, rspec=None
# else GetVersion = v3
else:
result = server.Describe([urn] ,[object_cred], api_options)
# else GetVersion = v3
else:
result = server.Describe([urn] ,[object_cred], api_options)
- dict_result = xmltodict.parse(result['value']['geni_rspec'])
+ if isinstance(result, dict):
+ if result['value'] != 0:
+ dict_result = xmltodict.parse(result['value']['geni_rspec'])
result['parsed'] = dict_result
if 'rspec' in dict_result and 'node' in dict_result['rspec']:
result['parsed'] = dict_result
if 'rspec' in dict_result and 'node' in dict_result['rspec']: