Fixing port discovery in REST provider

Change-Id: If6ecabc0c1d10cb855d702a2002a0b507bd63202
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
index 3dc2a8d..edbf5c7 100644
--- a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
+++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
@@ -429,10 +429,10 @@
                                 new DefaultDeviceDescription(
                                         updatedDeviceDescription, true,
                                         updatedDeviceDescription.annotations()));
-                        //if ports are not discovered, retry the discovery
-                        if (deviceService.getPorts(deviceId).isEmpty()) {
-                            discoverPorts(deviceId);
-                        }
+                    }
+                    //if ports are not discovered, retry the discovery
+                    if (deviceService.getPorts(deviceId).isEmpty()) {
+                        discoverPorts(deviceId);
                     }
                 } else {
                     log.warn("No DeviceDescriptionDiscovery behaviour for device {}", deviceId);