@Override public void releaseAddress(String ip) { String iPNotValidMsg = String.format("Unable to release the IP. The given IP is not valid", ip); assertValidIP(ip, iPNotValidMsg); if (null == neutronApi || null == portApi || null == floatingIPApi) { buildNeutronApi(); } if (log.isDebugEnabled()) { String msg = String.format("Trying delete the floating IP %s", ip); log.debug(msg); } FloatingIP floatingIP = getFloatingIPByIPAddress(ip); if (null == floatingIP) { if (log.isDebugEnabled()) { String msg = String.format( "Floating IP %s is not found. " + "It might be already deleted, if instance is already terminated", ip); log.debug(msg); } return; } boolean deleted = floatingIPApi.delete(floatingIP.getId()); if (deleted) { if (log.isDebugEnabled()) { String msg = String.format("Successfully deleted the floating IP %s", ip); log.debug(msg); } } else { String msg = String.format("Couldn't release the floating IP %s", ip); log.error(msg); throw new CloudControllerException(msg); } }