diff --git a/kvmagent/kvmagent/plugins/vm_plugin.py b/kvmagent/kvmagent/plugins/vm_plugin.py index b17ad62025..386084159a 100644 --- a/kvmagent/kvmagent/plugins/vm_plugin.py +++ b/kvmagent/kvmagent/plugins/vm_plugin.py @@ -3308,7 +3308,9 @@ def _create_ceph_secret_key(userKey, uuid): try: o = shell.call("virsh secret-define %s" % spath) o = o.strip(' \n\t\r') - _, generateuuid, _ = o.split() + uuidReg = "[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}" + pattern = re.compile(uuidReg) + generateuuid = pattern.findall(o)[0] shell.call('virsh secret-set-value %s %s' % (generateuuid, userKey)) finally: os.remove(spath)