Example #1
0
def initMDM():
    global g_config
    # change working directory.
    os.chdir(g_config.base_dir)

    # set certificate and private key for Https connection.
    if not (os.path.exists(g_config.https_certificate) and os.path.exists(g_config.https_private_key)):
        print "The certificate for https connection not found"
        return False

    print "Https:%s -- %s" % (g_config.https_certificate, g_config.https_private_key)
    CherryPyWSGIServer.ssl_certificate = g_config.https_certificate
    CherryPyWSGIServer.ssl_private_key = g_config.https_private_key

    cmd_queue = MDMDB("./mdm.db")
    cmd_queue.open()
    cmd_queue.cleanTable("mdm_cmd_queue")
    cmd_queue.close()
    return True
Example #2
0
def initMDM():
    global g_config
    #change working directory.
    os.chdir(g_config.base_dir)

    #set certificate and private key for Https connection.
    if not (os.path.exists(g_config.https_certificate)
            and os.path.exists(g_config.https_private_key)):
        print "The certificate for https connection not found"
        return False

    print "Https:%s -- %s" % (g_config.https_certificate,
                              g_config.https_private_key)
    CherryPyWSGIServer.ssl_certificate = g_config.https_certificate
    CherryPyWSGIServer.ssl_private_key = g_config.https_private_key

    cmd_queue = MDMDB("./mdm.db")
    cmd_queue.open()
    cmd_queue.cleanTable('mdm_cmd_queue')
    cmd_queue.close()
    return True