[_modules] safer checking of instances
authorArthur Lutz <arthur.lutz@logilab.fr>
Thu, 11 Feb 2016 14:29:40 +0100
changeset 68 448139f2bee5
parent 67 7874ed3fe201
child 69 7597f1ea2d5b
[_modules] safer checking of instances
_modules/cubicweb.py
--- a/_modules/cubicweb.py	Thu Feb 11 14:29:17 2016 +0100
+++ b/_modules/cubicweb.py	Thu Feb 11 14:29:40 2016 +0100
@@ -155,7 +155,8 @@
 
         salt '*' cubicweb.instances
     '''
-    return _cwlist(verbose)['instances']
+    cwlist = _cwlist(verbose)
+    return 'instances' in cwlist and cwlist['instances'] or {}
 
 def status(instance=None):
     '''