From 7e37cd80fe12eabaafba5c5c1c8f35413f193e37 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 2 Oct 2013 14:11:31 -0400 Subject: [PATCH] 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 --- cinder/volume/drivers/nfs.py | 2 ++ 1 file changed, 2 insertions(+) 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.""" -- 2.45.2