Example #1
0
File: views.py Project: spawn3/uss
def vm_startOnPm(request):
    print 'vm_startOnPm'
    vm_uuid = request.POST['vm_uuid']
    pm_uuid = request.POST['pm_selected']

    erl_call_command, info = toolbox_json.vm_start(vm_uuid, pm_uuid)
    if is_ok(info):
        if not updateGlobalInfo():
            return HttpResponse(u'获取更新信息失败!')
        return HttpResponse(action_succ_resp_msg % (u'虚拟机在指定物理机上启动', info))
    else:
        return HttpResponse(action_fail_resp_msg % (u'虚拟机在指定物理机上启动', info, erl_call_command))
Example #2
0
File: views.py Project: spawn3/uss
def vm_start(request):
    print 'vm_start'
    vm_uuid = request.GET['vm_uuid']
    pm_uuid = ''

    erl_call_command, info = toolbox_json.vm_start(vm_uuid, pm_uuid)
    if is_ok(info):
        if not updateGlobalInfo():
            return HttpResponse(u'获取更新信息失败!')
        return HttpResponse(action_succ_resp_msg % (u'开机', info))

    else:
        return HttpResponse(action_fail_resp_msg % (u'开机', info, erl_call_command))