def get_network_by_name(self, nwk_name):
ret_net_lst = []<EOL>try:<EOL><INDENT>body = {}<EOL>net_list = self.neutronclient.list_networks(body=body)<EOL>net_list = net_list.get('<STR_LIT>')<EOL>for net in net_list:<EOL><INDENT>if net.get('<STR_LIT:name>') == nwk_name:<EOL><INDENT>ret_net_lst.append(net)<EOL><DEDENT><DEDENT><DEDENT>except Exception as exc:<EOL><INDENT>LOG.error("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>{'<STR_LIT:name>': nwk_name, '<STR_LIT>': str(exc)})<EOL><DEDENT>return ret_net_lst<EOL>
Search for a openstack network by name.