Skip to content

Commit 77dadd7

Browse files
committed
CLOUDSTACK-6787: Publishing uuids missing in some cases, adding/correcting events in some cases.
Also fixed a bug in the global config framework.
1 parent 58bad41 commit 77dadd7

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public void create() {
261261
try {
262262
FirewallRule result = _firewallService.createEgressFirewallRule(this);
263263
setEntityId(result.getId());
264+
setEntityUuid(result.getUuid());
264265
} catch (NetworkRuleConflictException ex) {
265266
s_logger.info("Network rule conflict: " + ex.getMessage());
266267
s_logger.trace("Network Rule Conflict: ", ex);

framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public boolean equals(Object obj) {
133133
public T value() {
134134
if (_value == null || isDynamic()) {
135135
ConfigurationVO vo = s_depot != null ? s_depot.global().findById(key()) : null;
136-
_value = valueOf(vo != null ? vo.getValue() : defaultValue());
136+
_value = valueOf((vo != null && vo.getValue() != null) ? vo.getValue() : defaultValue());
137137
}
138138

139139
return _value;

server/src/com/cloud/network/as/AutoScaleManagerImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ public AutoScaleVmGroup createAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd) {
795795
}
796796

797797
@Override
798+
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_CREATE, eventDescription = "creating autoscale vm group", async = true)
798799
public boolean configureAutoScaleVmGroup(CreateAutoScaleVmGroupCmd cmd) throws ResourceUnavailableException {
799800
return configureAutoScaleVmGroup(cmd.getEntityId(), AutoScaleVmGroup.State_New);
800801
}
@@ -823,7 +824,7 @@ private boolean configureAutoScaleVmGroup(long vmGroupid, String currentState) t
823824

824825
@Override
825826
@DB
826-
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DELETE, eventDescription = "deleting autoscale vm group")
827+
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DELETE, eventDescription = "deleting autoscale vm group", async = true)
827828
public boolean deleteAutoScaleVmGroup(final long id) {
828829
AutoScaleVmGroupVO autoScaleVmGroupVO = getEntityInDatabase(CallContext.current().getCallingAccount(), "AutoScale Vm Group", id, _autoScaleVmGroupDao);
829830

@@ -997,7 +998,7 @@ public AutoScaleVmGroupVO doInTransaction(TransactionStatus status) {
997998
}
998999

9991000
@Override
1000-
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_UPDATE, eventDescription = "updating autoscale vm group")
1001+
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_UPDATE, eventDescription = "updating autoscale vm group", async = true)
10011002
public AutoScaleVmGroup updateAutoScaleVmGroup(UpdateAutoScaleVmGroupCmd cmd) {
10021003
Long vmGroupId = cmd.getId();
10031004
Integer minMembers = cmd.getMinMembers();
@@ -1046,7 +1047,7 @@ public AutoScaleVmGroup updateAutoScaleVmGroup(UpdateAutoScaleVmGroupCmd cmd) {
10461047

10471048
@Override
10481049
@DB
1049-
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_ENABLE, eventDescription = "enabling autoscale vm group")
1050+
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_ENABLE, eventDescription = "enabling autoscale vm group", async = true)
10501051
public AutoScaleVmGroup enableAutoScaleVmGroup(Long id) {
10511052
AutoScaleVmGroupVO vmGroup = getEntityInDatabase(CallContext.current().getCallingAccount(), "AutoScale Vm Group", id, _autoScaleVmGroupDao);
10521053
boolean success = false;
@@ -1072,7 +1073,7 @@ public AutoScaleVmGroup enableAutoScaleVmGroup(Long id) {
10721073
}
10731074

10741075
@Override
1075-
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DISABLE, eventDescription = "disabling autoscale vm group")
1076+
@ActionEvent(eventType = EventTypes.EVENT_AUTOSCALEVMGROUP_DISABLE, eventDescription = "disabling autoscale vm group", async = true)
10761077
@DB
10771078
public AutoScaleVmGroup disableAutoScaleVmGroup(Long id) {
10781079
AutoScaleVmGroupVO vmGroup = getEntityInDatabase(CallContext.current().getCallingAccount(), "AutoScale Vm Group", id, _autoScaleVmGroupDao);

server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ public boolean deleteSnapshotDirsForAccount(long accountId) {
639639

640640
@Override
641641
@DB
642+
@ActionEvent(eventType = EventTypes.EVENT_SNAPSHOT_POLICY_CREATE, eventDescription = "creating snapshot policy")
642643
public SnapshotPolicyVO createPolicy(CreateSnapshotPolicyCmd cmd, Account policyOwner) {
643644
Long volumeId = cmd.getVolumeId();
644645
boolean display = cmd.isDisplay();
@@ -735,6 +736,8 @@ public SnapshotPolicyVO createPolicy(CreateSnapshotPolicyCmd cmd, Account policy
735736
}
736737

737738
}
739+
// TODO - Make createSnapshotPolicy - BaseAsyncCreate and remove this.
740+
CallContext.current().putContextParameter(SnapshotPolicy.class.getName(), policy.getUuid());
738741
return policy;
739742
}
740743

0 commit comments

Comments
 (0)