def check_param(self): """Check parameter values and consistency among them.""" utils.check_opt_value(self.conf, _INHERITED_VOLUME_OPTS) utils.check_opts(self.conf, COMMON_VOLUME_OPTS) utils.check_opts(self.conf, self.driver_info['volume_opts']) if self.conf.hitachi_ldev_range: self.storage_info['ldev_range'] = self._range2list( 'hitachi_ldev_range') if (not self.conf.hitachi_target_ports and not self.conf.hitachi_compute_target_ports): msg = utils.output_log(MSG.INVALID_PARAMETER, param='hitachi_target_ports or ' 'hitachi_compute_target_ports') raise utils.HBSDError(msg) if (self.conf.hitachi_group_delete and not self.conf.hitachi_group_create): msg = utils.output_log(MSG.INVALID_PARAMETER, param='hitachi_group_delete or ' 'hitachi_group_create') raise utils.HBSDError(msg) for opt in _REQUIRED_COMMON_OPTS: if not self.conf.safe_get(opt): msg = utils.output_log(MSG.INVALID_PARAMETER, param=opt) raise utils.HBSDError(msg) if self.storage_info['protocol'] == 'iSCSI': self.check_param_iscsi()
def check_param(self): """Check parameter values and consistency among them.""" super(HBSDREST, self).check_param() utils.check_opts(self.conf, REST_VOLUME_OPTS) utils.check_opts(self.conf, san.san_opts) LOG.debug('Setting ldev_range: %s', self.storage_info['ldev_range']) for opt in _REQUIRED_REST_OPTS: if not self.conf.safe_get(opt): msg = utils.output_log(MSG.INVALID_PARAMETER, param=opt) raise utils.HBSDError(msg) if not self.conf.safe_get('san_api_port'): self.conf.san_api_port = _REST_DEFAULT_PORT