From 6ad9203d9b75d4c1a8367e983b9f990fd39be47e Mon Sep 17 00:00:00 2001 From: Qiaowei Ren Date: Sat, 15 Aug 2015 10:34:31 +0800 Subject: [PATCH] xenapi: support the session to "unix://local" When url is "unix://local", xenapi inspector should use specific api to create the session to xenapi. Change-Id: I1531c4ab75be7e1d462093dff1ddf0ca4ae4808e Closes-Bug: 1484764 --- ceilometer/compute/virt/xenapi/inspector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ceilometer/compute/virt/xenapi/inspector.py b/ceilometer/compute/virt/xenapi/inspector.py index 74d14124..28e5afef 100644 --- a/ceilometer/compute/virt/xenapi/inspector.py +++ b/ceilometer/compute/virt/xenapi/inspector.py @@ -66,7 +66,8 @@ def get_api_session(): exception = api.Failure(_("Unable to log in to XenAPI " "(is the Dom0 disk full?)")) try: - session = api.Session(url) + session = (api.xapi_local() if url == 'unix://local' + else api.Session(url)) with timeout.Timeout(CONF.xenapi.login_timeout, exception): session.login_with_password(username, password) except api.Failure as e: