CLOUDSTACK-6787: Publishing uuids missing in some cases, adding/correcting events in some cases.

Also fixed a bug in the global config framework.
This commit is contained in:
Nitin Mehta 2014-07-21 14:07:41 -07:00
parent 58bad41910
commit 77dadd75c4
4 changed files with 10 additions and 5 deletions

View File

@ -261,6 +261,7 @@ public class CreateEgressFirewallRuleCmd extends BaseAsyncCreateCmd implements F
try {
FirewallRule result = _firewallService.createEgressFirewallRule(this);
setEntityId(result.getId());
setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: " + ex.getMessage());
s_logger.trace("Network Rule Conflict: ", ex);

View File

@ -133,7 +133,7 @@ public class ConfigKey<T> {
public T value() {
if (_value == null || isDynamic()) {
ConfigurationVO vo = s_depot != null ? s_depot.global().findById(key()) : null;
_value = valueOf(vo != null ? vo.getValue() : defaultValue());
_value = valueOf((vo != null && vo.getValue() != null) ? vo.getValue() : defaultValue());
}
return _value;

View File

@ -795,6 +795,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
}
@Override
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_CREATE, eventDescription = "creating autoscale vm group", async = true)
public boolean configureAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd) throws ResourceUnavailableException {
return configureAutoScaleVmGroup(cmd.getEntityId(), AutoScaleVmGroup.State_New);
}
@ -823,7 +824,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
@Override
@DB
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DELETE, eventDescription = "deleting autoscale vm group")
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DELETE, eventDescription = "deleting autoscale vm group", async = true)
public boolean deleteAutoScaleVmGroup(final long id) {
AutoScaleVmGroupVO autoScaleVmGroupVO = getEntityInDatabase(CallContext.current().getCallingAccount(), "AutoScale Vm Group", id, _autoScaleVmGroupDao);
@ -997,7 +998,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
}
@Override
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_UPDATE, eventDescription = "updating autoscale vm group")
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_UPDATE, eventDescription = "updating autoscale vm group", async = true)
public AutoScaleVmGroup updateAutoScaleVmGroup(UpdateAutoScaleVmGroupCmd cmd) {
Long vmGroupId = cmd.getId();
Integer minMembers = cmd.getMinMembers();
@ -1046,7 +1047,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
@Override
@DB
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_ENABLE, eventDescription = "enabling autoscale vm group")
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_ENABLE, eventDescription = "enabling autoscale vm group", async = true)
public AutoScaleVmGroup enableAutoScaleVmGroup(Long id) {
AutoScaleVmGroupVO vmGroup = getEntityInDatabase(CallContext.current().getCallingAccount(), "AutoScale Vm Group", id, _autoScaleVmGroupDao);
boolean success = false;
@ -1072,7 +1073,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
}
@Override
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DISABLE, eventDescription = "disabling autoscale vm group")
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DISABLE, eventDescription = "disabling autoscale vm group", async = true)
@DB
public AutoScaleVmGroup disableAutoScaleVmGroup(Long id) {
AutoScaleVmGroupVO vmGroup = getEntityInDatabase(CallContext.current().getCallingAccount(), "AutoScale Vm Group", id, _autoScaleVmGroupDao);

View File

@ -639,6 +639,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
@Override
@DB
@ActionEvent(eventType = EventTypes.EVENT_SNAPSHOT_POLICY_CREATE, eventDescription = "creating snapshot policy")
public SnapshotPolicyVO createPolicy(CreateSnapshotPolicyCmd cmd, Account policyOwner) {
Long volumeId = cmd.getVolumeId();
boolean display = cmd.isDisplay();
@ -735,6 +736,8 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
}
}
// TODO - Make createSnapshotPolicy - BaseAsyncCreate and remove this.
CallContext.current().putContextParameter(SnapshotPolicy.class.getName(), policy.getUuid());
return policy;
}