From 340019d77442140aaf9ecb24c9af739ea66c6f6b Mon Sep 17 00:00:00 2001
From: Filippos Giannakos <philipgian@grnet.gr>
Date: Fri, 30 Jun 2017 13:21:35 +0300
Subject: [PATCH] Fix KeyError in case of missing cephx_id

---
 ext_scripts/ext_rbd.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext_scripts/ext_rbd.py b/ext_scripts/ext_rbd.py
index 38f576a..5d80151 100755
--- a/ext_scripts/ext_rbd.py
+++ b/ext_scripts/ext_rbd.py
@@ -297,7 +297,7 @@ def format_qemu_uri(name, pool=None, cephx=None, conf_file=None, cache=None,
     uri = 'kvm:rbd:%s' % RBD.format_name(name, pool=pool)
     extra_conf = ''
     # Only id is supported for cephx authentication, for the userspace URI.
-    if cephx['id']:
+    if cephx.get('id'):
         extra_conf += ':id=%s' % cephx['id']
     if conf_file:
         extra_conf += ':conf=%s' % conf_file
-- 
GitLab