예제 #1
0
    def add_route(self, virt_address, virt_address6,
            host_address, host_address6):
        virt_address = virt_address.split('/')[0]

        try:
            if virt_address in self.client_routes:
                try:
                    self.client_routes.remove(virt_address)
                except KeyError:
                    pass
                utils.del_route(virt_address)

            if not host_address or host_address == \
                    settings.local.host.local_addr:
                return

            self.client_routes.add(virt_address)
            utils.add_route(virt_address, host_address)
        except:
            logger.exception('Failed to add route', 'clients',
                virt_address=virt_address,
                virt_address6=virt_address6,
                host_address=host_address,
                host_address6=host_address6,
            )
예제 #2
0
파일: clients.py 프로젝트: rchicoli/pritunl
    def add_route(self, virt_address, virt_address6,
            host_address, host_address6):
        virt_address = virt_address.split('/')[0]

        try:
            if virt_address in self.client_routes:
                try:
                    self.client_routes.remove(virt_address)
                except KeyError:
                    pass
                utils.del_route(virt_address)

            if not host_address or host_address == \
                    settings.local.host.local_addr:
                return

            self.client_routes.add(virt_address)
            utils.add_route(virt_address, host_address)
        except:
            logger.exception('Failed to add route', 'clients',
                virt_address=virt_address,
                virt_address6=virt_address6,
                host_address=host_address,
                host_address6=host_address6,
            )
예제 #3
0
    def remove_route(self, virt_address, virt_address6,
            host_address, host_address6):
        virt_address = virt_address.split('/')[0]

        try:
            self.client_routes.remove(virt_address)
        except KeyError:
            pass

        utils.del_route(virt_address)
예제 #4
0
파일: clients.py 프로젝트: rchicoli/pritunl
    def remove_route(self, virt_address, virt_address6,
            host_address, host_address6):
        virt_address = virt_address.split('/')[0]

        try:
            self.client_routes.remove(virt_address)
        except KeyError:
            pass

        utils.del_route(virt_address)