def do_setup(self, context): """Any initialization the volume driver does while starting.""" self.configuration.append_config_values( options.jdss_connection_opts) self.configuration.append_config_values( options.jdss_iscsi_opts) self.configuration.append_config_values( options.jdss_volume_opts) self.configuration.append_config_values(san.san_opts) self._pool = self.configuration.safe_get('jovian_pool') self.jovian_iscsi_target_portal_port = self.configuration.safe_get( 'target_port') self.jovian_target_prefix = self.configuration.safe_get( 'target_prefix') self.jovian_chap_pass_len = self.configuration.safe_get( 'chap_password_len') self.block_size = ( self.configuration.safe_get('jovian_block_size')) self.jovian_sparse = ( self.configuration.safe_get('san_thin_provision')) self.jovian_ignore_tpath = self.configuration.get( 'jovian_ignore_tpath', None) self.jovian_hosts = self.configuration.safe_get( 'san_hosts') self.ra = rest.JovianRESTAPI(self.configuration)
def do_setup(self, context): """Any initialization the volume driver does while starting.""" self.configuration.append_config_values(options.jdss_connection_opts) self.configuration.append_config_values(options.jdss_iscsi_opts) self.configuration.append_config_values(options.jdss_volume_opts) self.configuration.append_config_values(san.san_opts) self._pool = self.configuration.get('jovian_pool', 'Pool-0') self.jovian_iscsi_target_portal_port = self.configuration.get( 'target_port', 3260) self.jovian_target_prefix = self.configuration.get( 'target_prefix', 'iqn.2020-04.com.open-e.cinder:') self.jovian_chap_pass_len = self.configuration.get( 'chap_password_len', 12) self.block_size = (self.configuration.get('jovian_block_size', '64K')) self.jovian_sparse = (self.configuration.get('san_thin_provision', True)) self.jovian_ignore_tpath = self.configuration.get( 'jovian_ignore_tpath', None) self.jovian_hosts = self.configuration.get('san_hosts', []) self.ra = rest.JovianRESTAPI(self.configuration) self.check_for_setup_error()
def get_rest(self, config): ctx = context.get_admin_context() cfg = mock.Mock() cfg.append_config_values.return_value = None cfg.safe_get = lambda val: config[val] cfg.get = lambda val, default: config[val] jdssr = rest.JovianRESTAPI(cfg) jdssr.rproxy = mock.Mock() return jdssr, ctx
def do_setup(self, context): """Any initialization the volume driver does while starting.""" self.jovian_iscsi_target_portal_port = str( self.configuration.safe_get('jovian_iscsi_target_portal_port')) self.conf['jovian_iscsi_target_portal_port'] = \ self.jovian_iscsi_target_portal_port self.pool = self.configuration.safe_get('jovian_pool') self.conf['jovian_pool'] = self.pool self.jovian_target_prefix = self.configuration.safe_get( 'jovian_target_prefix') self.conf['jovian_target_prefix'] = self.jovian_target_prefix self.jovian_target_group_prefix = self.configuration.safe_get( 'jovian_target_group_prefix') self.conf['jovian_target_group_prefix'] = ( self.jovian_target_group_prefix) self.jovian_chap_auth = self.configuration.safe_get('jovian_chap_auth') self.conf['jovian_chap_auth'] = self.jovian_chap_auth self.jovian_host = self.configuration.safe_get('jovian_host') self.conf['jovian_host'] = self.jovian_host self.conf['jovian_rest_port'] = self.configuration.safe_get( 'jovian_rest_port') self.conf['jovian_rest_protocol'] = self.configuration.safe_get( 'jovian_rest_protocol') self.conf['jovian_rest_send_repeats'] = self.configuration.safe_get( 'jovian_rest_send_repeats') self.conf['jovian_user'] = self.configuration.safe_get('jovian_user') self.conf['jovian_password'] = self.configuration.safe_get( 'jovian_password') self.conf['jovian_ignore_tpath'] = self.configuration.safe_get( 'jovian_ignore_tpath') for i in self.conf['jovian_ignore_tpath']: LOG.debug(i) self.jovian_chap_username = \ self.configuration.safe_get('jovian_chap_username') self.conf['jovian_chap_username'] = self.configuration.safe_get( 'jovian_chap_username') self.jovian_chap_pass_len = self.configuration.safe_get( 'jovian_chap_pass_len') self.conf['jovian_chap_pass_len'] = self.jovian_chap_pass_len self.jovian_password_len = \ self.configuration.safe_get('jovian_chap_pass_len') self.jovian_sparse = \ self.configuration.safe_get('jovian_provisioning_thin') if o_netutils.is_valid_ip(self.jovian_host) is False: err_msg = ('JovianDSS: Invalid value of jovian_host property:' '%(addr)s, IP address expected.' % { 'addr': self.jovian_host }) LOG.debug(err_msg) raise exception.InvalidConfigurationValue(err_msg) self.ra = rest.JovianRESTAPI(self.conf) pass