Avoid errors in log when neutron tests are skipped

The BaseNetworkTest class setUpClass() method will initialize
various class attributes which the tearDownClass() method
expects to exist. Unfortunately when Neutron is not
available, the entire of the setUpClass() method is skipped,
but tearDownClass() still runs. This causes the logs to get
polluted with errors about missing attributes during
tearDownClass(). eg

ERROR tempest.test [-] tearDownClass failed: type object
 'DHCPAgentSchedulersTestJSON' has no attribute 'ipsecpolicies'
TRACE tempest.test     for ipsecpolicy in cls.ipsecpolicies:

Make the tearDownClass() code be conditional on neutron
being enabled too.

Change-Id: I042ca5c47e5c1e8d1042754fd7f36036a40b2f03
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 087b87a..d75339c 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -85,57 +85,58 @@
 
     @classmethod
     def tearDownClass(cls):
-        # Clean up ipsec policies
-        for ipsecpolicy in cls.ipsecpolicies:
-            cls.client.delete_ipsecpolicy(ipsecpolicy['id'])
-        # Clean up firewall policies
-        for fw_policy in cls.fw_policies:
-            cls.client.delete_firewall_policy(fw_policy['id'])
-        # Clean up firewall rules
-        for fw_rule in cls.fw_rules:
-            cls.client.delete_firewall_rule(fw_rule['id'])
-        # Clean up ike policies
-        for ikepolicy in cls.ikepolicies:
-            cls.client.delete_ikepolicy(ikepolicy['id'])
-        # Clean up vpn services
-        for vpnservice in cls.vpnservices:
-            cls.client.delete_vpnservice(vpnservice['id'])
-        # Clean up floating IPs
-        for floating_ip in cls.floating_ips:
-            cls.client.delete_floatingip(floating_ip['id'])
-        # Clean up routers
-        for router in cls.routers:
-            cls.delete_router(router)
+        if CONF.service_available.neutron:
+            # Clean up ipsec policies
+            for ipsecpolicy in cls.ipsecpolicies:
+                cls.client.delete_ipsecpolicy(ipsecpolicy['id'])
+            # Clean up firewall policies
+            for fw_policy in cls.fw_policies:
+                cls.client.delete_firewall_policy(fw_policy['id'])
+            # Clean up firewall rules
+            for fw_rule in cls.fw_rules:
+                cls.client.delete_firewall_rule(fw_rule['id'])
+            # Clean up ike policies
+            for ikepolicy in cls.ikepolicies:
+                cls.client.delete_ikepolicy(ikepolicy['id'])
+            # Clean up vpn services
+            for vpnservice in cls.vpnservices:
+                cls.client.delete_vpnservice(vpnservice['id'])
+            # Clean up floating IPs
+            for floating_ip in cls.floating_ips:
+                cls.client.delete_floatingip(floating_ip['id'])
+            # Clean up routers
+            for router in cls.routers:
+                cls.delete_router(router)
 
-        # Clean up health monitors
-        for health_monitor in cls.health_monitors:
-            cls.client.delete_health_monitor(health_monitor['id'])
-        # Clean up members
-        for member in cls.members:
-            cls.client.delete_member(member['id'])
-        # Clean up vips
-        for vip in cls.vips:
-            cls.client.delete_vip(vip['id'])
-        # Clean up pools
-        for pool in cls.pools:
-            cls.client.delete_pool(pool['id'])
-        # Clean up metering label rules
-        for metering_label_rule in cls.metering_label_rules:
-            cls.admin_client.delete_metering_label_rule(
-                metering_label_rule['id'])
-        # Clean up metering labels
-        for metering_label in cls.metering_labels:
-            cls.admin_client.delete_metering_label(metering_label['id'])
-        # Clean up ports
-        for port in cls.ports:
-            cls.client.delete_port(port['id'])
-        # Clean up subnets
-        for subnet in cls.subnets:
-            cls.client.delete_subnet(subnet['id'])
-        # Clean up networks
-        for network in cls.networks:
-            cls.client.delete_network(network['id'])
-        cls.clear_isolated_creds()
+            # Clean up health monitors
+            for health_monitor in cls.health_monitors:
+                cls.client.delete_health_monitor(health_monitor['id'])
+            # Clean up members
+            for member in cls.members:
+                cls.client.delete_member(member['id'])
+            # Clean up vips
+            for vip in cls.vips:
+                cls.client.delete_vip(vip['id'])
+            # Clean up pools
+            for pool in cls.pools:
+                cls.client.delete_pool(pool['id'])
+            # Clean up metering label rules
+            for metering_label_rule in cls.metering_label_rules:
+                cls.admin_client.delete_metering_label_rule(
+                    metering_label_rule['id'])
+            # Clean up metering labels
+            for metering_label in cls.metering_labels:
+                cls.admin_client.delete_metering_label(metering_label['id'])
+            # Clean up ports
+            for port in cls.ports:
+                cls.client.delete_port(port['id'])
+            # Clean up subnets
+            for subnet in cls.subnets:
+                cls.client.delete_subnet(subnet['id'])
+            # Clean up networks
+            for network in cls.networks:
+                cls.client.delete_network(network['id'])
+            cls.clear_isolated_creds()
         super(BaseNetworkTest, cls).tearDownClass()
 
     @classmethod