Github user jburwell commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/801#discussion_r41806263
--- Diff:
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
---
@@ -441,6 +456,44 @@ private Answer executeRequest(SyncVspCommand cmd) {
}
}
+ private Answer executeRequest(SyncNuageVspCmsIdCommand cmd) {
+ try {
+ isNuageVspManagerLoaded();
+ if (cmd.getSyncType() == SyncType.AUDIT || cmd.getSyncType()
== SyncType.AUDIT_ONLY) {
+ Pair<Boolean, String> answer =
_nuageVspManagerClient.auditNuageVspCmsId(cmd.getNuageVspCmsId(),
cmd.getSyncType() == SyncType.AUDIT_ONLY);
+ return new SyncNuageVspCmsIdAnswer(answer.getLeft(),
answer.getRight(), cmd.getSyncType());
+ } else if (cmd.getSyncType() == SyncType.REGISTER) {
+ String registeredNuageVspCmsId =
_nuageVspManagerClient.registerNuageVspCmsId();
+ return new
SyncNuageVspCmsIdAnswer(StringUtils.isNotBlank(registeredNuageVspCmsId),
registeredNuageVspCmsId, cmd.getSyncType());
+ } else {
+ boolean success =
_nuageVspManagerClient.unregisterNuageVspCmsId(cmd.getNuageVspCmsId());
+ return new SyncNuageVspCmsIdAnswer(success,
cmd.getNuageVspCmsId(), cmd.getSyncType());
+ }
+ } catch (Exception e) {
--- End diff --
Why are all unchecked and checked exceptions being caught? It seems like
we should only be catching the expected checked exceptions, and allow unchecked
exceptions simply bubble out.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---