From a823370a48df2efb1092c70533cbb7f0dcda4538 Mon Sep 17 00:00:00 2001 From: Gavin Williams Date: Thu, 6 Oct 2016 15:21:21 +0100 Subject: [PATCH] provider/openstack: gophercloud migration: Fix handling of Neutron networking when managing instances. --- .../openstack/resource_openstack_compute_instance_v2.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/providers/openstack/resource_openstack_compute_instance_v2.go b/builtin/providers/openstack/resource_openstack_compute_instance_v2.go index 80cb957d3..a1ad6f98d 100644 --- a/builtin/providers/openstack/resource_openstack_compute_instance_v2.go +++ b/builtin/providers/openstack/resource_openstack_compute_instance_v2.go @@ -965,18 +965,19 @@ func getInstanceNetworks(computeClient *gophercloud.ServiceClient, d *schema.Res allPages, err := tenantnetworks.List(computeClient).AllPages() if err != nil { if _, ok := err.(gophercloud.ErrDefault404); ok { + log.Println("[DEBUG] os-tenant-networks disabled") tenantNetworkExt = false } + log.Println("[DEBUG] Err looks like: %+v", err) if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok { if errCode.Actual == 403 { + log.Println("[DEBUG] os-tenant-networks disabled.") tenantNetworkExt = false + } else { + return nil, err } - - return nil, err } - - return nil, err } networkID := ""