def register_vpn(): env = get_env() chal = DB.Challenge(env['NAUM_CHAL']) if len(chal.files) == 0: chal.files.extend(env['NAUM_FILES']) vpn = DB.Vpn(env['HOSTNAME']) vpn.update(veth=env['NAUM_VETHHOST'], veth_state=DB.Vpn.VETH_DOWN, chal=chal) DB.vpns.add(vpn)
def register_vpn(): env = get_env() chal = DB.Challenge(env['NAUM_CHAL']) # Assign the list of files for this challenge. chal.files.clear() chal.files.extend(env['NAUM_FILES']) vpn = DB.Vpn(env['HOSTNAME']) vpn.update(veth=env['NAUM_VETHHOST'], veth_state=DB.Vpn.VETH_DOWN, chal=chal) DB.vpns.add(vpn)