Example #1
0
def persist_host(host):
    session = SESSION_MAKER()
    try:
        session.add(host)
        session.commit()
    except Exception:
        LOGGER.error('Not expected error in host insertion.')
        raise
    finally:
        session.close()
Example #2
0
def persist_host(host):
    session = SESSION_MAKER()
    try:
        session.add(host)
        session.commit()
    except Exception:
        LOGGER.error("Not expected error in host insertion.")
        raise
    finally:
        session.close()
Example #3
0
def persist_features(rapideye_features):
    '''
    Expects a RapideyeFeatures object and commits it to the database.
    '''
    session = SESSION_MAKER()
    try:
        session.add(rapideye_features)
        session.commit()
    except Exception:
        LOGGER.error('Not expected error in host insertion.')
        raise
    finally:
        session.close()
Example #4
0
def persist_quality(quality):
    '''
    Gets a Command object, and inserts it into the database.
    '''
    session = SESSION_MAKER()
    try:
        session.add(quality)
        session.commit()
    except Exception:
        LOGGER.error('Not expected error in host insertion.')
        raise
    finally:
        session.close()
Example #5
0
def persist_command(command):
    """
    Gets a Command object, and inserts it into the database.
    """
    session = SESSION_MAKER()
    try:
        session.add(command)
        session.commit()
    except Exception:
        LOGGER.error("Not expected error in host insertion.")
        raise
    finally:
        session.close()
Example #6
0
def persist_features(rapideye_features):
    """
    Expects a RapideyeFeatures object and commits it to the database.
    """
    session = SESSION_MAKER()
    try:
        session.add(rapideye_features)
        session.commit()
    except Exception:
        LOGGER.error("Not expected error in host insertion.")
        raise
    finally:
        session.close()