def delete_network_all_subnets(self, net_id):
try:<EOL><INDENT>body = {'<STR_LIT>': net_id}<EOL>subnet_list = self.neutronclient.list_subnets(body=body)<EOL>subnet_list = subnet_list.get('<STR_LIT>')<EOL>for subnet in subnet_list:<EOL><INDENT>if subnet.get('<STR_LIT>') == net_id:<EOL><INDENT>subnet_id = subnet.get('<STR_LIT:id>')<EOL>self.neutronclient.delete_subnet(subnet_id)<EOL><DEDENT><DEDENT><DEDENT>except Exception as exc:<EOL><INDENT>LOG.error("<STR_LIT>"<EOL>"<STR_LIT>", {'<STR_LIT>': net_id, '<STR_LIT>': str(exc)})<EOL>return False<EOL><DEDENT>try:<EOL><INDENT>self.neutronclient.delete_network(net_id)<EOL><DEDENT>except Exception as exc:<EOL><INDENT>LOG.error("<STR_LIT>",<EOL>{'<STR_LIT>': net_id, '<STR_LIT>': str(exc)})<EOL>return False<EOL><DEDENT>return True<EOL>
Delete the openstack network including all its subnets.