Ejemplo n.º 1
0
def associate_sccp_device(line, device):
    device_name = "SEP" + device.mac.replace(":", "").upper()

    sccpdevice = (Session.query(SCCPDevice).filter(
        SCCPDevice.device == device_name).first())

    if sccpdevice:
        sccpdevice.line = line.name
    else:
        Session.add(
            SCCPDevice(name=device_name, device=device_name, line=line.name))
    Session.flush()
Ejemplo n.º 2
0
def dissociate_sccp_device(line, device):
    device_name = "SEP" + device.mac.replace(":", "").upper()

    (Session.query(SCCPDevice).filter(SCCPDevice.device == device_name).filter(
        SCCPDevice.line == line.name).delete())
    Session.flush()
Ejemplo n.º 3
0
def update(provisioning_networking):
    Session.add(provisioning_networking)
    Session.flush()