def __init__(self, host=None, username=None, password=None, **enable): """Initialize instance attributes. Credentials _host _username _password routes = maintains nested parse route data,VRF, route particulars _routing = Parent to routes dictionary, maintans VDC Key prefix = maintains current prefix in the loop protocol = maintains routing protocol until the next line provides the next protocol initialize_class_methods() = initializes class methods """ self._host = host self._username = username self._password = password self.netmiko_connection = None self.routes = collections.defaultdict(list) self._routing = {} self.prefix = None self.protocol = None try: self.enable = enable["enable"] except TypeError: self.enable = None self.create_db = DatabaseOps.RoutingDatabase() self.initialize_class_methods() self.database()
def __init__(self, host=None, username=None, password=None, **enable): """Initialize instance attributes. Credentials _host _username _password routes = maintains parse route data in dictionary format prefix = maintains current prefix in the loop _vdcroutes = parent dictionary, routes are value initialize_class_methods() = initializes class methods """ self._host = host self._username = username self._password = password self.netmiko_connection = None self.routes = collections.defaultdict(list) self._vdcroutes = collections.defaultdict(list) self.cdp_lldp_neighbors = {} self.prefix = None try: self.enable = enable["enable"] except KeyError: self.enable = None self.create_db = DataBaseOps.RoutingDatabase() self.initialize_class_methods() # Initiate class methods self.database()
def __init__(self, host, username, password, enable=None): self.host = host self.username = username self.password = password self.enable = enable self.netmiko_connection = None self.prefix = None self.protocol = None self.vrf = None self.admin_dis = [] self.metric = [] self.next_hop = [] self.route_age = [] self.interface = [] self.create_db = DatabaseOps.RoutingDatabase() self.device_login() self._parse_global_routing_entries()