import glob

filenames=glob.glob("../configs/*/*8360*")

for filename in filenames:
    in_mgmt = False
    in_vlan10 = False
    vlan10_ip = None
    mgmt_ip = None
    with open(filename) as f:
        for line in f:
            if in_mgmt:
                if not line[0]==" ":
                    in_mgmt=False
                elif line.startswith("    ip static"):
                    mgmt_ip = line.strip().split()[2] 
            if line.startswith("interface mgmt"):
                #print(line)
                in_mgmt=True
            if in_vlan10:
                if not line[0]==" ":
                    in_vlan10=False
                elif line.startswith("    ip address"):
                    vlan10_ip = line.strip().split()[2] 
            if line.strip()=="interface vlan 10":
                #print(line)
                in_vlan10=True
            #print (line)
        if vlan10_ip:
            print (filename.split("/")[-1],mgmt_ip,vlan10_ip)
    #sys.exit()