def get_show_cts_role_based_sgtmaps_all(self): self.ise.get_sgts() self.sgts = self.ise.sgts net_connect = ConnectHandler(**self.cisco_switch) for vrf in self.vrfs: command = 'show cts role-based sgt-map vrf ' + vrf + ' all' cts_sgt_maps_output = net_connect.send_command(command) f = open( os.path.join( os.path.dirname(os.path.dirname( os.path.abspath(__file__))), 'templates/cts_role_based_sgt_map_all.templ'), 'r') template = textfsm.TextFSM(f) output = template.ParseText(cts_sgt_maps_output) for o in output: e = Endpoint(self.arp[o[0]]) e.set_ip(o[0]) e.set_vrf(vrf) e.set_sgt(self.sgts[int(o[1])]) self.endpoints[self.arp[o[0]]] = e