Skip to content

Commit 778bbaf

Browse files
committed
address comments
1 parent 1c18ca8 commit 778bbaf

File tree

8 files changed

+18
-13
lines changed

8 files changed

+18
-13
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/backup/UpdateBackupOfferingCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public Boolean getAllowUserDrivenBackups() {
8383
public void execute() {
8484
try {
8585
if (StringUtils.isAllEmpty(getName(), getDescription()) && getAllowUserDrivenBackups() == null) {
86-
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated, at least one of the " +
87-
"following should be informed: name, description or allowUserDrivenBackups.", id));
86+
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated," +
87+
" at least one of the following should be informed: name, description or allowUserDrivenBackups.", id));
8888
}
8989

9090
BackupOffering result = backupManager.updateBackupOffering(this);

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ public boolean equals(final Object obj) {
352352
return false;
353353
}
354354
AgentAttache that = (AgentAttache)obj;
355-
return _id == that._id;
355+
return Objects.equals(_uuid, that._uuid) &&
356+
Objects.equals(_name, that._name);
356357
}
357358

358359
public void send(final Request req, final Listener listener) throws AgentUnavailableException {
@@ -500,7 +501,7 @@ public void process(final Answer[] answers) {
500501

501502
@Override
502503
public int hashCode() {
503-
return Objects.hash(_id, _uuid, _name);
504+
return Objects.hash(_uuid, _name);
504505
}
505506

506507
protected class Alarm extends ManagedContextRunnable {

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ public void stop(final String vmUuid) throws ResourceUnavailableException {
17301730
} catch (final OperationTimedoutException e) {
17311731
throw new AgentUnavailableException(String.format("Unable to stop vm [%s] because the operation to stop timed out", vmUuid), e.getAgentId(), e);
17321732
} catch (final ConcurrentOperationException e) {
1733-
throw new CloudRuntimeException(String.format("Unable to stop vm: %s because of a concurrent operation", vmUuid), e);
1733+
throw new CloudRuntimeException(String.format("Unable to stop vm [%s] because of a concurrent operation", vmUuid), e);
17341734
}
17351735

17361736
}

engine/schema/src/main/java/com/cloud/upgrade/dao/DatabaseAccessObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public boolean indexExists(Connection conn, String tableName, String indexName)
9898
return true;
9999
}
100100
} catch (SQLException e) {
101-
logger.debug(String.format("Index %s doesn't exist, ignoring exception:", indexName), e.getMessage());
101+
logger.debug("Index {} doesn't exist, ignoring exception: {}", indexName, e.getMessage());
102102
}
103103
return false;
104104
}

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/XenServerGuru.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,7 @@ public Pair<Boolean, Long> getCommandHostDelegation(long hostId, Command cmd) {
182182
return defaultHostToExecuteCommands;
183183
}
184184
if (cmd instanceof StorageSubSystemCommand) {
185-
if (logger.isTraceEnabled()) {
186-
logger.trace(String.format("XenServer StrorageSubSystemCommand is always executed in sequence (command of type %s to host %s).", cmd.getClass(), hostId));
187-
}
185+
logger.trace("XenServer StrorageSubSystemCommand is always executed in sequence (command of type {} to host {}).", cmd.getClass(), hostId);
188186
StorageSubSystemCommand c = (StorageSubSystemCommand)cmd;
189187
c.setExecuteInSequence(true);
190188
}

server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,9 +1038,7 @@ private void processWork(final HaWorkVO work) {
10381038
final VMInstanceVO vm = _instanceDao.findById(work.getInstanceId());
10391039
try {
10401040
if (vm != null && !VmHaEnabled.valueIn(vm.getDataCenterId())) {
1041-
if (logger.isDebugEnabled()) {
1042-
logger.debug("VM high availability manager is disabled, rescheduling the HA work {}, for the VM {} (id: {}) to retry later in case VM high availability manager is enabled on retry attempt", work, vm.getName(), vm.getId());
1043-
}
1041+
logger.debug("VM high availability manager is disabled, rescheduling the HA work {}, for the VM {} (id: {}) to retry later in case VM high availability manager is enabled on retry attempt", work, vm.getName(), vm.getId());
10441042
long nextTime = getRescheduleTime(wt);
10451043
rescheduleWork(work, nextTime);
10461044
return;

server/src/main/java/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,18 @@ private boolean applyGlobalLoadBalancerRuleConfig(long gslbRuleId, boolean revok
668668
// loop through all the zones, participating in GSLB, and send GSLB config command
669669
// to the corresponding GSLB service provider in that zone
670670
for (Pair<Long, Long> zoneId : gslbSiteIds) {
671+
if (zoneId.first() == null) {
672+
logger.warn("Skipping GSLB configuration for zone with null ID");
673+
continue;
674+
}
671675

672676
List<SiteLoadBalancerConfig> slbs = new ArrayList<SiteLoadBalancerConfig>();
673677
// set site as 'local' for the site in that zone
674678
for (Pair<Long, Long> innerLoopZoneId : gslbSiteIds) {
679+
if (innerLoopZoneId.first() == null) {
680+
logger.warn("Skipping GSLB configuration for zone with null ID");
681+
continue;
682+
}
675683
SiteLoadBalancerConfig siteLb = zoneSiteLoadbalancerMap.get(innerLoopZoneId.first());
676684
siteLb.setLocal(zoneId.first().equals(innerLoopZoneId.first()));
677685
slbs.add(siteLb);

tools/marvin/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
raise RuntimeError("python setuptools is required to build Marvin")
2828

2929

30-
VERSION = "4.20.3.0-SNAPSHOT"
30+
VERSION = "4.20.3.0"
3131

3232
setup(name="Marvin",
3333
version=VERSION,

0 commit comments

Comments
 (0)