示例#1
0
文件: views.py 项目: JerryDog/mana
def install_new_minion(node, region):
    print "ADD MINION TO DB"
    ComputeNodeMana().addMinion(node, region)
    salt_master = settings.C2_STATIC["Salt_master"]
    state = "INSTALLED"
    rets = []
    removeKey(node.hypervisor_hostname, node.id, region)

    print "------------start to remove minion ------------------"
    try:
        LOG = c2_ssh.conn2(getConnIp(node.host_ip), CMD_REMOVE_MINION)
        print "REMOVE_MINION log:%s" % LOG
    except Exception, ex:
        LOG = "REMOVE_MINION exception:%s" % str(ex)
        ComputeNodeMana().addSaltLog("(%s)_REMOVE_MINION_ERROR:%s" % (node.hypervisor_hostname, LOG), "INSTALL_ERROR")
        print Exception, "REMOVE_MINION:", ex
示例#2
0
文件: views.py 项目: JerryDog/mana
    rets = []
    removeKey(node.hypervisor_hostname, node.id, region)

    print "------------start to remove minion ------------------"
    try:
        LOG = c2_ssh.conn2(getConnIp(node.host_ip), CMD_REMOVE_MINION)
        print "REMOVE_MINION log:%s" % LOG
    except Exception, ex:
        LOG = "REMOVE_MINION exception:%s" % str(ex)
        ComputeNodeMana().addSaltLog("(%s)_REMOVE_MINION_ERROR:%s" % (node.hypervisor_hostname, LOG), "INSTALL_ERROR")
        print Exception, "REMOVE_MINION:", ex
    print "----------------finish remove minion --------------------------"

    print "------------start to clear minion config------------------"
    try:
        LOG = c2_ssh.conn2(getConnIp(node.host_ip), CMD_CLEAR_MINION_CONF)
        print "CLEAR_MINION_CONF log:%s" % LOG
    except Exception, ex:
        LOG = "CLEAR_MINION_CONF exception:%s" % str(ex)
        print Exception, "CLEAR_MINION_CONF:", ex
    print "----------------finish clear minion config --------------------------"

    # CMD_CLEAR_MODULE_CONF

    print "------------start to clear MODULE config------------------"
    try:
        LOG = c2_ssh.conn2(getConnIp(node.host_ip), CMD_CLEAR_MODULE_CONF)
        print "CLEAR_MODULE_CONF log:%s" % LOG
    except Exception, ex:
        LOG = "CLEAR_MODULE_CONF exception:%s" % str(ex)
        print Exception, "CLEAR_MODULE_CONF:", ex