]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Initialize shares variables for RemoteFsDriver(s)
authorEric Harney <eharney@redhat.com>
Wed, 2 Oct 2013 18:11:31 +0000 (14:11 -0400)
committerEric Harney <eharney@redhat.com>
Tue, 15 Oct 2013 14:13:35 +0000 (10:13 -0400)
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

cinder/volume/drivers/nfs.py

index f85ca913c67fc107be723836a9fdf65b69d3206f..277b173a6495772be6ab5b6b043f8fd37c0bc46a 100644 (file)
@@ -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."""