Skip to content

Commit 6c92ccf

Browse files
CLOUDSTACK-8607 - Refactoring attribute name
- Refactoring attribute name from shouldUpdateHost to updatePasswdOnHost - Fixing ApiConstants class because it had an error in the constant name
1 parent 0dd02ce commit 6c92ccf

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

api/src/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public class ApiConstants {
180180
public static final String PARAMS = "params";
181181
public static final String PARENT_DOMAIN_ID = "parentdomainid";
182182
public static final String PASSWORD = "password";
183-
public static final String SHOULD_UPDATE_PASSWORD = "password";
183+
public static final String SHOULD_UPDATE_PASSWORD = "update_passwd_on_host";
184184
public static final String NEW_PASSWORD = "new_password";
185185
public static final String PASSWORD_ENABLED = "passwordenabled";
186186
public static final String SSHKEY_ENABLED = "sshkeyenabled";

api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class UpdateHostPasswordCmd extends BaseCmd {
4545
private Long clusterId;
4646

4747
@Parameter(name = ApiConstants.SHOULD_UPDATE_PASSWORD, type = CommandType.BOOLEAN, description = "if the password should also be updated on the hosts")
48-
private Boolean shouldUpdateHost;
48+
private Boolean updatePasswdOnHost;
4949

5050
@Parameter(name = ApiConstants.USERNAME, type = CommandType.STRING, required = true, description = "the username for the host/cluster")
5151
private String username;
@@ -66,8 +66,8 @@ public Long getClusterId() {
6666
return clusterId;
6767
}
6868

69-
public Boolean getShouldUpdateHost() {
70-
return shouldUpdateHost;
69+
public Boolean getUpdatePasswdOnHost() {
70+
return updatePasswdOnHost;
7171
}
7272

7373
public String getPassword() {

server/src/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ private boolean doUpdateHostPassword(final long hostId) {
22452245

22462246
@Override
22472247
public boolean updateClusterPassword(final UpdateHostPasswordCmd command) {
2248-
final boolean shouldUpdateHostPasswd = command.getShouldUpdateHost();
2248+
final boolean shouldUpdateHostPasswd = command.getUpdatePasswdOnHost();
22492249
// get agents for the cluster
22502250
final List<HostVO> hosts = listAllHostsInCluster(command.getClusterId());
22512251
for (final HostVO host : hosts) {
@@ -2285,7 +2285,7 @@ public boolean updateHostPassword(final UpdateHostPasswordCmd command) {
22852285
s_logger.error("Agent is not availbale!", e);
22862286
}
22872287

2288-
final boolean shouldUpdateHostPasswd = command.getShouldUpdateHost();
2288+
final boolean shouldUpdateHostPasswd = command.getUpdatePasswdOnHost();
22892289
// If shouldUpdateHostPasswd has been set to false, the method doUpdateHostPassword() won't be called.
22902290
return shouldUpdateHostPasswd && doUpdateHostPassword(command.getHostId());
22912291
}

0 commit comments

Comments
 (0)