Skip to content

Commit

Permalink
Initialize shares variables for RemoteFsDriver(s)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eharney committed Oct 15, 2013
1 parent c287b15 commit 7e37cd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cinder/volume/drivers/nfs.py
Expand Up @@ -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."""
Expand Down

0 comments on commit 7e37cd8

Please sign in to comment.