def do_setup(self, context): image_utils.check_qemu_img_version(self._MINIMUM_QEMU_IMG_VERSION) config = self.configuration.smbfs_shares_config if not config: msg = (_("SMBFS config file not set (smbfs_shares_config).")) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.exists(config): msg = (_("SMBFS config file at %(config)s doesn't exist.") % {'config': config}) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.isabs(self.base): msg = _("Invalid mount point base: %s") % self.base LOG.error(msg) raise exception.SmbfsException(msg) if not self.configuration.smbfs_oversub_ratio > 0: msg = _( "SMBFS config 'smbfs_oversub_ratio' invalid. Must be > 0: " "%s") % self.configuration.smbfs_oversub_ratio LOG.error(msg) raise exception.SmbfsException(msg) if ((not self.configuration.smbfs_used_ratio > 0) and (self.configuration.smbfs_used_ratio <= 1)): msg = _("SMBFS config 'smbfs_used_ratio' invalid. Must be > 0 " "and <= 1.0: %s") % self.configuration.smbfs_used_ratio LOG.error(msg) raise exception.SmbfsException(msg) self.shares = {} # address : options self._ensure_shares_mounted()
def do_setup(self, context): self._check_os_platform() super(WindowsSmbfsDriver, self).do_setup(context) image_utils.check_qemu_img_version(self._MINIMUM_QEMU_IMG_VERSION) config = self.configuration.smbfs_shares_config if not config: msg = (_("SMBFS config file not set (smbfs_shares_config).")) LOG.error(msg) raise SmbfsException(msg) if not os.path.exists(config): msg = (_("SMBFS config file at %(config)s doesn't exist.") % {'config': config}) LOG.error(msg) raise SmbfsException(msg) if not os.path.isabs(self.base): msg = _("Invalid mount point base: %s") % self.base LOG.error(msg) raise SmbfsException(msg) self.shares = {} # address : options self._ensure_shares_mounted() self._setup_pool_mappings()
def do_setup(self, context): self._check_os_platform() super(WindowsSmbfsDriver, self).do_setup(context) image_utils.check_qemu_img_version(self._MINIMUM_QEMU_IMG_VERSION) config = self.configuration.smbfs_shares_config if not config: msg = (_("SMBFS config file not set (smbfs_shares_config).")) LOG.error(msg) raise SmbfsException(msg) if not os.path.exists(config): msg = (_("SMBFS config file at %(config)s doesn't exist.") % { 'config': config }) LOG.error(msg) raise SmbfsException(msg) if not os.path.isabs(self.base): msg = _("Invalid mount point base: %s") % self.base LOG.error(msg) raise SmbfsException(msg) self.shares = {} # address : options self._ensure_shares_mounted() self._setup_pool_mappings()
def do_setup(self, context): image_utils.check_qemu_img_version(self._MINIMUM_QEMU_IMG_VERSION) config = self.configuration.smbfs_shares_config if not config: msg = (_("SMBFS config file not set (smbfs_shares_config).")) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.exists(config): msg = (_("SMBFS config file at %(config)s doesn't exist.") % { 'config': config }) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.isabs(self.base): msg = _("Invalid mount point base: %s") % self.base LOG.error(msg) raise exception.SmbfsException(msg) if not self.configuration.smbfs_oversub_ratio > 0: msg = _( "SMBFS config 'smbfs_oversub_ratio' invalid. Must be > 0: " "%s") % self.configuration.smbfs_oversub_ratio LOG.error(msg) raise exception.SmbfsException(msg) if ((not self.configuration.smbfs_used_ratio > 0) and (self.configuration.smbfs_used_ratio <= 1)): msg = _("SMBFS config 'smbfs_used_ratio' invalid. Must be > 0 " "and <= 1.0: %s") % self.configuration.smbfs_used_ratio LOG.error(msg) raise exception.SmbfsException(msg) self.shares = {} # address : options self._ensure_shares_mounted()
def do_setup(self, context): self._check_os_platform() if self.configuration.smbfs_oversub_ratio is not None: self.configuration.max_over_subscription_ratio = ( self.configuration.smbfs_oversub_ratio) if self.configuration.smbfs_used_ratio is not None: self.configuration.reserved_percentage = ( 1 - self.configuration.smbfs_used_ratio) * 100 super(WindowsSmbfsDriver, self).do_setup(context) image_utils.check_qemu_img_version(self._MINIMUM_QEMU_IMG_VERSION) config = self.configuration.smbfs_shares_config if not config: msg = (_("SMBFS config file not set (smbfs_shares_config).")) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.exists(config): msg = (_("SMBFS config file at %(config)s doesn't exist.") % {'config': config}) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.isabs(self.base): msg = _("Invalid mount point base: %s") % self.base LOG.error(msg) raise exception.SmbfsException(msg) if not self.configuration.max_over_subscription_ratio > 0: msg = _( "SMBFS config 'max_over_subscription_ratio' invalid. " "Must be > 0: %s" ) % self.configuration.max_over_subscription_ratio LOG.error(msg) raise exception.SmbfsException(msg) if not 0 <= self.configuration.reserved_percentage <= 100: msg = _( "SMBFS config 'reserved_percentage' invalid. " "Must be > 0 and <= 100: %s" ) % self.configuration.reserved_percentage LOG.error(msg) raise exception.SmbfsException(msg) self.shares = {} # address : options self._ensure_shares_mounted() self._setup_pool_mappings()
def do_setup(self, context): self._check_os_platform() if self.configuration.smbfs_oversub_ratio is not None: self.configuration.max_over_subscription_ratio = ( self.configuration.smbfs_oversub_ratio) if self.configuration.smbfs_used_ratio is not None: self.configuration.reserved_percentage = ( 1 - self.configuration.smbfs_used_ratio) * 100 super(WindowsSmbfsDriver, self).do_setup(context) image_utils.check_qemu_img_version(self._MINIMUM_QEMU_IMG_VERSION) config = self.configuration.smbfs_shares_config if not config: msg = (_("SMBFS config file not set (smbfs_shares_config).")) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.exists(config): msg = (_("SMBFS config file at %(config)s doesn't exist.") % { 'config': config }) LOG.error(msg) raise exception.SmbfsException(msg) if not os.path.isabs(self.base): msg = _("Invalid mount point base: %s") % self.base LOG.error(msg) raise exception.SmbfsException(msg) if not self.configuration.max_over_subscription_ratio > 0: msg = _("SMBFS config 'max_over_subscription_ratio' invalid. " "Must be > 0: %s" ) % self.configuration.max_over_subscription_ratio LOG.error(msg) raise exception.SmbfsException(msg) if not 0 <= self.configuration.reserved_percentage <= 100: msg = _("SMBFS config 'reserved_percentage' invalid. " "Must be > 0 and <= 100: %s" ) % self.configuration.reserved_percentage LOG.error(msg) raise exception.SmbfsException(msg) self.shares = {} # address : options self._ensure_shares_mounted() self._setup_pool_mappings()