From: Jenkins Date: Fri, 16 Aug 2013 04:54:21 +0000 (+0000) Subject: Merge "Refactor Nexenta driver" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5718080adb882ca5378bbb8e39686e5b60d4e5bc;p=openstack-build%2Fcinder-build.git Merge "Refactor Nexenta driver" --- 5718080adb882ca5378bbb8e39686e5b60d4e5bc diff --cc cinder/volume/drivers/nexenta/volume.py index 077136e4c,c71b43fb8..7238f22df --- a/cinder/volume/drivers/nexenta/volume.py +++ b/cinder/volume/drivers/nexenta/volume.py @@@ -30,48 -30,15 +30,14 @@@ from cinder import unit from cinder.volume import driver from cinder.volume.drivers import nexenta from cinder.volume.drivers.nexenta import jsonrpc + from cinder.volume.drivers.nexenta import options -VERSION = '1.0' LOG = logging.getLogger(__name__) - NEXENTA_OPTS = [ - cfg.StrOpt('nexenta_host', - default='', - help='IP address of Nexenta SA'), - cfg.IntOpt('nexenta_rest_port', - default=2000, - help='HTTP port to connect to Nexenta REST API server'), - cfg.StrOpt('nexenta_rest_protocol', - default='auto', - help='Use http or https for REST connection (default auto)'), - cfg.StrOpt('nexenta_user', - default='admin', - help='User name to connect to Nexenta SA'), - cfg.StrOpt('nexenta_password', - default='nexenta', - help='Password to connect to Nexenta SA', - secret=True), - cfg.IntOpt('nexenta_iscsi_target_portal_port', - default=3260, - help='Nexenta target portal port'), - cfg.StrOpt('nexenta_volume', - default='cinder', - help='pool on SA that will hold all volumes'), - cfg.StrOpt('nexenta_target_prefix', - default='iqn.1986-03.com.sun:02:cinder-', - help='IQN prefix for iSCSI targets'), - cfg.StrOpt('nexenta_target_group_prefix', - default='cinder/', - help='prefix for iSCSI target groups on SA'), - cfg.StrOpt('nexenta_blocksize', - default='', - help='block size for volumes (blank=default,8KB)'), - cfg.BoolOpt('nexenta_sparse', - default=False, - help='flag to create sparse volumes'), - ] - CONF = cfg.CONF - CONF.register_opts(NEXENTA_OPTS) + CONF.register_opts(options.NEXENTA_CONNECTION_OPTIONS) + CONF.register_opts(options.NEXENTA_ISCSI_OPTIONS) + CONF.register_opts(options.NEXENTA_VOLUME_OPTIONS) class NexentaDriver(driver.ISCSIDriver): # pylint: disable=R0921 @@@ -368,11 -341,11 +342,11 @@@ backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or self.__class__.__name__ data["vendor_name"] = 'Nexenta' - data["driver_version"] = VERSION + data["driver_version"] = self.VERSION data["storage_protocol"] = 'iSCSI' - stats = self.nms.volume.get_child_props(CONF.nexenta_volume, - 'health|size|used|available') + stats = self.nms.volume.get_child_props( + self.configuration.nexenta_volume, 'health|size|used|available') total_unit = stats['size'][-1] total_amount = float(stats['size'][:-1]) free_unit = stats['available'][-1]