]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Refactor Nexenta driver"
authorJenkins <jenkins@review.openstack.org>
Fri, 16 Aug 2013 04:54:21 +0000 (04:54 +0000)
committerGerrit Code Review <review@openstack.org>
Fri, 16 Aug 2013 04:54:21 +0000 (04:54 +0000)
1  2 
cinder/volume/drivers/nexenta/volume.py
etc/cinder/cinder.conf.sample

index 077136e4cd1ed7bbc6456a38d1d3f9e3c12cf698,c71b43fb8d5fe71e00221b352301d1472bea1307..7238f22df4f51eb1a76eaffd701ce8765ab1ac76
@@@ -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
              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]
Simple merge