Deleting ports before deletion of routers in resource_cleanup

In resource_cleanup need to delete ports before deleting the
routers. This is required in a private nuage thirdparty
testcase because a router-interface-delete is not allowed
when a port is present under that router. Also a port
resource sits beneath a router resource, and this change
would not affect any other tempest testcase.

Change-Id: I82a2cc9338a037f3b0d087c8f7c50c9cd0d0627b
Closes-Bug:1460223
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 1cd1386..f864f95 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -123,10 +123,6 @@
             for floating_ip in cls.floating_ips:
                 cls._try_delete_resource(cls.client.delete_floatingip,
                                          floating_ip['id'])
-            # Clean up routers
-            for router in cls.routers:
-                cls._try_delete_resource(cls.delete_router,
-                                         router)
 
             # Clean up health monitors
             for health_monitor in cls.health_monitors:
@@ -158,6 +154,10 @@
             for port in cls.ports:
                 cls._try_delete_resource(cls.client.delete_port,
                                          port['id'])
+            # Clean up routers
+            for router in cls.routers:
+                cls._try_delete_resource(cls.delete_router,
+                                         router)
             # Clean up subnets
             for subnet in cls.subnets:
                 cls._try_delete_resource(cls.client.delete_subnet,