Exemple #1
0
def run():
    """Populate graph schema."""
    logger.info('Populating graph schema...')
    status, json_result = BayesianGraph.populate_schema()
    if not status:
        logger.error(json_result)
        raise RuntimeError('Failed to setup graph schema')
    # to prevent weird "parallelMutate" errors
    time.sleep(10)
Exemple #2
0
import logging
from src import config
import traceback
from minio import Minio
from minio.error import ResponseError, BucketAlreadyOwnedByYou, BucketAlreadyExists
from src.data_importer import import_epv_from_s3_http
from src.graph_manager import BayesianGraph

logging.basicConfig()
logger = logging.getLogger(__name__)

# Check whether schema is created or not
# populate schema if not already done
try:
    status, json_result = BayesianGraph.populate_schema()
except Exception as exc:
    # Py2 compatibility: switch to "from exc" once we're on Py3
    new_exc = RuntimeError("Failed to initialize graph schema")
    new_exc.__cause__ = exc
    raise new_exc

if status:
    logger.info("Graph Schema Created")
else:
    logger.error(json_result)
    raise RuntimeError("Failed to setup graph schema")


def test_create_minio_bucket():
    """Test if buckets can be put into the Minio storage."""