add vendor to sys.path

This commit is contained in:
Maxim Slipenko 2023-09-07 11:43:32 +03:00
parent 3d4a763cbd
commit 458d002142

14
main.py
View File

@ -2,12 +2,18 @@ import httplib
import hashlib import hashlib
import json import json
import argparse import argparse
import os
import socket import socket
import urllib import urllib
import ConfigParser import ConfigParser
from os.path import abspath import os
from netaddr import IPAddress, IPNetwork import sys
parent_dir = os.path.abspath(os.path.dirname(__file__))
vendor_dir = os.path.join(parent_dir, 'vendor')
sys.path.append(vendor_dir)
from netaddr import IPNetwork
class KeeneticAPI: class KeeneticAPI:
@ -110,7 +116,7 @@ def start(args):
for route in old_routes: for route in old_routes:
api.remove_ip_route(route) api.remove_ip_route(route)
routes_dir = abspath(config.get('app', 'dir')) routes_dir = os.path.abspath(config.get('app', 'dir'))
routes = list() routes = list()