def refresh(self): if stoq.trial_mode: self.status = ResourceStatus.STATUS_NA self.reason = (_('Online features are not available in trial mode')) self.reason_long = _('Online features require a subscription of Stoq.link') return if not api.sysparam.get_bool('ONLINE_SERVICES'): self.status = ResourceStatus.STATUS_NA self.reason = (_("Online services (Stoq.link integration, backup, " "etc) not enabled...")) self.reason_long = _('Enable the parameter "Online Services" ' 'on the "Admin" app to solve this issue') return if self._check_running(): self.status = self.STATUS_OK self.reason = _("Online services data hub is running fine.") self.reason_long = None else: self.status = ResourceStatus.STATUS_ERROR self.reason = _("Online services data hub not found...") package = '<a href="apt://stoq-server">stoq-server</a>' self.reason_long = safe_str( api.escape(_("Install and configure the %s package " "to solve this issue")) % (package, ))