def separate_interface_data(ospf_data):
 ospf_data = re.split('(.+ is up, line protocol is up)', ospf_data)
 ospf_data.pop(0)
 ospf_list = []
 while True:
  if (len(ospf_data) >= 2):
   intf = ospf_data.pop(0)
   section = ospf_data.pop(0)
   ospf_string = (intf + section)
   ospf_list.append(ospf_string)
  else:
   break
 return ospf_list

def separate_interface_data ( ospf_data ) : ospf_data = re . split ( '(.+ is up, line protocol is up)' , ospf_data ) ospf_data . pop ( 0 ) ospf_list = [ ] while True : if ( len ( ospf_data ) >= 2 ) : intf = ospf_data . pop ( 0 ) section = ospf_data . pop ( 0 ) ospf_string = ( intf + section ) ospf_list . append ( ospf_string ) else : break return ospf_list
take show ip ospf interface data as a string return a list corresponding to each section of the data [interface1 ospf info .