Bug #887805 Error during report_driver_status(): 'LibvirtConnection' object has no attribute '_host_state'

Fixes the host status reports from LibvirtConnection driver.
This fix initializes in class 'LibvirtConnection', the local variable
'_host_state' and replaces the variable 'session' by the local
variable 'read_only'.

Change-Id: Ia3ba29dc287c793c79a2bbde0d5ec69eb6ada480
This commit is contained in:
Édouard Thuleau 2011-11-09 17:37:54 +01:00
parent 26d2bad187
commit 1ecd70f23a
3 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,7 @@
<dan@nicira.com> <danwent@dan-xs3-cs>
<dan@nicira.com> <danwent@gmail.com>
<devin.carlen@gmail.com> <devcamcar@illian.local>
<edouard1.thuleau@orange.com> <thuleau@gmail.com>
<ewan.mellor@citrix.com> <emellor@silver>
<itoumsn@nttdata.co.jp> <itoumsn@shayol>
<jake@ansolabs.com> <jake@markupisart.com>

View File

@ -39,7 +39,7 @@ Devendra Modium <dmodium@isi.edu>
Devin Carlen <devin.carlen@gmail.com>
Donal Lafferty <donal.lafferty@citrix.com>
Ed Leafe <ed@leafe.com>
Edouard Thuleau <thuleau@gmail.com>
Edouard Thuleau <edouard1.thuleau@orange.com>
Eldar Nugaev <reldan@oscloud.ru>
Eric Day <eday@oddments.org>
Eric Windisch <eric@cloudscaling.com>

View File

@ -195,11 +195,12 @@ class LibvirtConnection(driver.ComputeDriver):
driver_type, _sep, driver = driver_str.partition('=')
driver_class = utils.import_class(driver)
self.volume_drivers[driver_type] = driver_class(self)
self._host_state = None
@property
def host_state(self):
if not self._host_state:
self._host_state = HostState(self._session)
self._host_state = HostState(self.read_only)
return self._host_state
def init_host(self, host):