def missing_premium_feature_abort():
    """Throw a nicely formatted "premium only" error"""
    abort_error(
        error=MissingPremiumPackage(
            'This feature exists only in the premium edition of Cloudify.'
            '\nPlease contact sales for additional info.'
        ),
        logger=current_app.logger,
        hide_server_message=True
    )
Exemple #2
0
    def get(self, tenant_name, multi_tenancy=None):
        """Get details for a single tenant

        On community, only getting the default tenant is allowed.
        """
        if multi_tenancy:
            rest_utils.validate_inputs({'tenant_name': tenant_name})
            return multi_tenancy.get_tenant(tenant_name)
        else:
            if tenant_name != constants.DEFAULT_TENANT_NAME:
                raise MissingPremiumPackage()
            tenant = get_storage_manager().get(models.Tenant,
                                               None,
                                               filters={'name': tenant_name})
            if is_user_action_allowed('tenant_rabbitmq_credentials',
                                      tenant_name):
                tenant.rabbitmq_password = decrypt(tenant.rabbitmq_password)
            else:
                tenant.rabbitmq_username = None
                tenant.rabbitmq_password = None
                tenant.rabbitmq_vhost = None
            return tenant
Exemple #3
0
 def abort(*args, **kwargs):
     abort_error(error=MissingPremiumPackage(
         'This feature exists only in the premium edition of Cloudify.'
         '\nPlease contact sales for additional info.'),
                 logger=current_app.logger,
                 hide_server_message=True)
 def abort(*args, **kwargs):
     raise MissingPremiumPackage()