Пример #1
0
def delete():
    l = conecta()
    print request.vars
    if (isinstance(request.vars['cn[]'], str)):
        h = Hosts(l, request.vars['cn[]'], "", "", request.vars['type_host'])
        h.process(request.vars['action'])
    else:
        for t in request.vars['cn[]']:
            h = Hosts(l, t, "", "", request.vars['type_host'])
            h.process(request.vars['action'])

    l.close()
    return dict(response="OK")
Пример #2
0
def delete():
    l=conecta()
    print request.vars
    if(isinstance(request.vars['cn[]'], str)):
        h = Hosts(l,request.vars['cn[]'],"","",request.vars['type_host'])
        h.process(request.vars['action'])
    else:
        for t in request.vars['cn[]']:
            h = Hosts(l,t,"","",request.vars['type_host'])
            h.process(request.vars['action'])

    l.close()
    return dict(response="OK")
Пример #3
0
def modify():
    l=conecta()
    ip = "172."+request.vars['subrange']+"."+request.vars['range']+"."+request.vars['ip']    
    h = Hosts(l,request.vars['name'],ip,request.vars['mac'],request.vars['type_host'])
    response=h.process(request.vars['action'])
    l.close()
    return dict(response=response)
Пример #4
0
def modify():
    l = conecta()
    ip = "172." + request.vars['subrange'] + "." + request.vars[
        'range'] + "." + request.vars['ip']
    h = Hosts(l, request.vars['name'], ip, request.vars['mac'],
              request.vars['type_host'])
    response = h.process(request.vars['action'])
    l.close()
    return dict(response=response)
Пример #5
0
def delete():
    l=conecta()
    h = Hosts(l,request.vars['cn'],"","",request.vars['type_host'])
    response=h.process(request.vars['action']  )
    l.close()
    return dict(response=response)