Clone tempest before installing the package
[functest.git] / functest / utils / openstack_utils.py
index 0b9f8b8..0ab6305 100644 (file)
@@ -425,12 +425,12 @@ def get_or_create_flavor(flavor_name, ram, disk, vcpus, public=True):
     return flavor_exists, flavor_id
 
 
-def get_floating_ips(nova_client):
+def get_floating_ips(neutron_client):
     try:
-        floating_ips = nova_client.floating_ips.list()
-        return floating_ips
+        floating_ips = neutron_client.list_floatingips()
+        return floating_ips['floatingips']
     except Exception as e:
-        logger.error("Error [get_floating_ips(nova_client)]: %s" % e)
+        logger.error("Error [get_floating_ips(neutron_client)]: %s" % e)
         return None
 
 
@@ -593,12 +593,12 @@ def delete_instance(nova_client, instance_id):
         return False
 
 
-def delete_floating_ip(nova_client, floatingip_id):
+def delete_floating_ip(neutron_client, floatingip_id):
     try:
-        nova_client.floating_ips.delete(floatingip_id)
+        neutron_client.delete_floatingip(floatingip_id)
         return True
     except Exception as e:
-        logger.error("Error [delete_floating_ip(nova_client, '%s')]: %s"
+        logger.error("Error [delete_floating_ip(neutron_client, '%s')]: %s"
                      % (floatingip_id, e))
         return False
 
@@ -962,43 +962,6 @@ def create_shared_network_full(net_name, subnt_name, router_name, subnet_cidr):
     return network_dic
 
 
-def create_bgpvpn(neutron_client, **kwargs):
-    # route_distinguishers
-    # route_targets
-    json_body = {"bgpvpn": kwargs}
-    return neutron_client.create_bgpvpn(json_body)
-
-
-def create_network_association(neutron_client, bgpvpn_id, neutron_network_id):
-    json_body = {"network_association": {"network_id": neutron_network_id}}
-    return neutron_client.create_network_association(bgpvpn_id, json_body)
-
-
-def create_router_association(neutron_client, bgpvpn_id, router_id):
-    json_body = {"router_association": {"router_id": router_id}}
-    return neutron_client.create_router_association(bgpvpn_id, json_body)
-
-
-def update_bgpvpn(neutron_client, bgpvpn_id, **kwargs):
-    json_body = {"bgpvpn": kwargs}
-    return neutron_client.update_bgpvpn(bgpvpn_id, json_body)
-
-
-def delete_bgpvpn(neutron_client, bgpvpn_id):
-    return neutron_client.delete_bgpvpn(bgpvpn_id)
-
-
-def get_bgpvpn(neutron_client, bgpvpn_id):
-    return neutron_client.show_bgpvpn(bgpvpn_id)
-
-
-def get_bgpvpn_routers(neutron_client, bgpvpn_id):
-    return get_bgpvpn(neutron_client, bgpvpn_id)['bgpvpn']['routers']
-
-
-def get_bgpvpn_networks(neutron_client, bgpvpn_id):
-    return get_bgpvpn(neutron_client, bgpvpn_id)['bgpvpn']['networks']
-
 # *********************************************
 #   SEC GROUPS
 # *********************************************
@@ -1191,9 +1154,9 @@ def delete_security_group(neutron_client, secgroup_id):
 # *********************************************
 #   GLANCE
 # *********************************************
-def get_images(nova_client):
+def get_images(glance_client):
     try:
-        images = nova_client.images.list()
+        images = glance_client.images.list()
         return images
     except Exception as e:
         logger.error("Error [get_images]: %s" % e)
@@ -1257,12 +1220,12 @@ def get_or_create_image(name, path, format):
     return image_exists, image_id
 
 
-def delete_glance_image(nova_client, image_id):
+def delete_glance_image(glance_client, image_id):
     try:
-        nova_client.images.delete(image_id)
+        glance_client.images.delete(image_id)
         return True
     except Exception as e:
-        logger.error("Error [delete_glance_image(nova_client, '%s')]: %s"
+        logger.error("Error [delete_glance_image(glance_client, '%s')]: %s"
                      % (image_id, e))
         return False