Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r41804441 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java --- @@ -247,6 +467,26 @@ public boolean deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) { } } + ConfigurationVO cmsIdConfig = _configDao.findByName("nuagevsp.cms.id"); + HostVO host = findNuageVspHost(nuageVspDevice.getHostId()); + if (!auditDomainsOnVsp(host, false, true)) { + return false; + } + + String nuageVspCmsId = findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig); + SyncNuageVspCmsIdCommand syncCmd = new SyncNuageVspCmsIdCommand(SyncType.UNREGISTER, nuageVspCmsId); + SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) _agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd); + if (answer != null && answer.getSuccess()) { + String currentValue = cmsIdConfig.getValue(); + String newValue = currentValue.replace(nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId(), ""); + if (newValue.startsWith(";")) { --- End diff -- Check that ``newValue`` with ``Strings.isNullOrEmpty()`` to avoid a potential ``NullPointerException``.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---