class GlobalVar: proxy_interface = "ens8" nos1_interface = "ens8f5" nos2_interface = "ens8f5" nos3_interface = "ens8f5" nos4_interface = "ens8f5" master_nos_interface = "ens8f5" master_nos_vlan = "200" nos_ip = "192.168.11.1" #def set_db_handle(db): # GlobalVar.db_handle = db def get_proxy_interface(): return GlobalVar.proxy_interface def get_nos1_interface(): return GlobalVar.nos1_interface def get_nos2_interface(): return GlobalVar.nos2_interface def get_nos3_interface(): return GlobalVar.nos3_interface def get_nos4_interface(): return GlobalVar.nos4_interface def get_master_nos_interface(): fileHandle = open ('nos.conf','r') nos = fileHandle.read (1) fileHandle.close() if nos == "1": GlobalVar.master_nos_interface = GlobalVar.nos1_interface elif nos == "2": GlobalVar.master_nos_interface = GlobalVar.nos2_interface elif nos == "3": GlobalVar.master_nos_interface = GlobalVar.nos3_interface elif nos == "4": GlobalVar.master_nos_interface = GlobalVar.nos4_interface else: GlobalVar.master_nos_interface = GlobalVar.nos1_interface return GlobalVar.master_nos_interface def get_master_nos_vlan(): fileHandle = open ('nos_vlan.conf','r') nosvlan = fileHandle.read (3) fileHandle.close() GlobalVar.master_nos_vlan = nosvlan return GlobalVar.master_nos_vlan def get_nos_ip(): return GlobalVar.nos_ip