Drivers that need a special proxy logic can't inherit from BaseVD
directly. This is problematic for the ABCmeta feature since the class
model can't be accessed easily with isinstance().
Change-Id: I553a72991bb450e8581a757fb98a264ed1ba8fb2
Partly-Implements: blueprint abc-volume-drivers
return None
+class ProxyVD(object):
+ """Proxy Volume Driver to mark proxy drivers
+
+ If a driver uses a proxy class (e.g. by using __setattr__ and
+ __getattr__) without directly inheriting from base volume driver this
+ class can help marking them and retrieve the actual used driver object.
+ """
+ def _get_driver(self):
+ """Returns the actual driver object. Can be overloaded by the proxy.
+ """
+ return getattr(self, "driver", None)
+
+
class ISCSIDriver(VolumeDriver):
"""Executes commands relating to ISCSI volumes.
from cinder import exception
from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
+from cinder.volume import driver
from cinder.volume.drivers.netapp.options import netapp_proxy_opts
from cinder.volume.drivers.netapp import utils as na_utils
}}
-class NetAppDriver(object):
+class NetAppDriver(driver.ProxyVD):
""""NetApp unified block storage driver.
Acts as a factory to create NetApp storage drivers based on the