From: Eric Harney Date: Wed, 2 Oct 2013 18:11:31 +0000 (-0400) Subject: Initialize shares variables for RemoteFsDriver(s) X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7e37cd80fe12eabaafba5c5c1c8f35413f193e37;p=openstack-build%2Fcinder-build.git Initialize shares variables for RemoteFsDriver(s) self.shares and self._mounted_shares are used by various methods for RemoteFs-based drivers, but may not be instantiated early enough. Initialize them in __init__ to ensure they always exist. (Also fixes pylint warnings.) Closes-Bug: #1239741 Change-Id: I0ef884c28b82b7f694cf8a0fb4629c835da11c91 --- diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index f85ca913c..277b173a6 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -73,6 +73,8 @@ class RemoteFsDriver(driver.VolumeDriver): def __init__(self, *args, **kwargs): super(RemoteFsDriver, self).__init__(*args, **kwargs) + self.shares = {} + self._mounted_shares = [] def check_for_setup_error(self): """Just to override parent behavior."""