Exemplo n.º 1
0
 def backend_supported(self, manager, **kwargs):
     return (
         (
             (
                 kwargs['is_catalog'] and
                 (
                     (
                         self.CATALOG_DB_SUPPORTED and
                         kwargs['db_support']
                     ) or (
                         not self.CATALOG_DB_SUPPORTED and
                         not kwargs[
                             'db_support'] and
                         (
                             self.SUPPORTED_SCHEMAS is None or
                             kwargs[
                                 'schema_name'] in self.SUPPORTED_SCHEMAS
                         )
                     )
                 )
             ) or
             (
                 not kwargs['is_catalog'] and self.CATALOG_DB_SUPPORTED
             )
         ) and
         CollectionNodeModule.backend_supported(self, manager, **kwargs)
     )
Exemplo n.º 2
0
def backend_supported(module, manager, **kwargs):

    if CollectionNodeModule.backend_supported(module, manager, **kwargs):
        if 'tid' not in kwargs:
            return True

        conn = manager.connection(did=kwargs['did'])

        template_path = 'partitions/sql/{0}/#{0}#{1}#'.format(
            manager.server_type, manager.version)
        SQL = render_template("/".join([template_path, 'backend_support.sql']),
                              tid=kwargs['tid'])
        status, res = conn.execute_scalar(SQL)

        # check if any errors
        if not status:
            return internal_server_error(errormsg=res)

        return res