Skip to content

Commit 611fc43

Browse files
authored
Merge pull request #1 from apache/master
Update Fork
2 parents 749e302 + 7f408ec commit 611fc43

581 files changed

Lines changed: 20519 additions & 21082 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## Description
2-
<!--- Describe your changes in detail -->
1+
### Description
2+
3+
This PR...
4+
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
35

46
<!-- For new features, provide link to FS, dev ML discussion etc. -->
57
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
@@ -8,17 +10,39 @@
810
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
911
<!-- Fixes: # -->
1012

11-
## Types of changes
12-
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
13+
<!--- ********************************************************************************* -->
14+
<!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
15+
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
16+
<!--- ********************************************************************************* -->
17+
18+
### Types of changes
19+
1320
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
1421
- [ ] New feature (non-breaking change which adds functionality)
1522
- [ ] Bug fix (non-breaking change which fixes an issue)
1623
- [ ] Enhancement (improves an existing feature and functionality)
1724
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
1825

19-
## Screenshots (if appropriate):
26+
### Feature/Enhancement Scale or Bug Severity
27+
28+
#### Feature/Enhancement Scale
29+
30+
- [ ] Major
31+
- [ ] Minor
32+
33+
#### Bug Severity
34+
35+
- [ ] BLOCKER
36+
- [ ] Critical
37+
- [ ] Major
38+
- [ ] Minor
39+
- [ ] Trivial
40+
41+
42+
### Screenshots (if appropriate):
43+
2044

21-
## How Has This Been Tested?
45+
### How Has This Been Tested?
2246
<!-- Please describe in detail how you tested your changes. -->
2347
<!-- Include details of your testing environment, and the tests you ran to -->
2448
<!-- see how your change affects other areas of the code, etc. -->

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,19 @@ protected void cancelTasks() {
420420
}
421421
}
422422

423+
/**
424+
* Cleanup agent zone properties.
425+
*
426+
* Unset zone, cluster and pod values so that host is not added back
427+
* when service is restarted. This will be set to proper values
428+
* when host is added back
429+
*/
430+
protected void cleanupAgentZoneProperties() {
431+
_shell.setPersistentProperty(null, "zone", "");
432+
_shell.setPersistentProperty(null, "cluster", "");
433+
_shell.setPersistentProperty(null, "pod", "");
434+
}
435+
423436
public synchronized void lockStartupTask(final Link link) {
424437
_startup = new StartupTask(link);
425438
_timer.schedule(_startup, _startupWait);
@@ -603,6 +616,9 @@ protected void processRequest(final Request request, final Link link) {
603616
final ShutdownCommand shutdown = (ShutdownCommand)cmd;
604617
s_logger.debug("Received shutdownCommand, due to: " + shutdown.getReason());
605618
cancelTasks();
619+
if (shutdown.isRemoveHost()) {
620+
cleanupAgentZoneProperties();
621+
}
606622
_reconnectAllowed = false;
607623
answer = new Answer(cmd, true, null);
608624
} else if (cmd instanceof ReadyCommand && ((ReadyCommand)cmd).getDetails() != null) {

api/src/main/java/com/cloud/agent/api/StoragePoolInfo.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class StoragePoolInfo {
2828
StoragePoolType poolType;
2929
long capacityBytes;
3030
long availableBytes;
31+
String name;
3132
Map<String, String> details;
3233

3334
protected StoragePoolInfo() {
@@ -67,14 +68,34 @@ public String getHost() {
6768
return host;
6869
}
6970

71+
public String getName() {
72+
return name;
73+
}
74+
75+
public void setName(String name) {
76+
this.name = name;
77+
}
78+
79+
public void setLocalPath(String localPath) {
80+
this.localPath = localPath;
81+
}
82+
7083
public String getLocalPath() {
7184
return localPath;
7285
}
7386

87+
public void setHostPath(String hostPath) {
88+
this.hostPath = hostPath;
89+
}
90+
7491
public String getHostPath() {
7592
return hostPath;
7693
}
7794

95+
public void setPoolType(StoragePoolType poolType) {
96+
this.poolType = poolType;
97+
}
98+
7899
public StoragePoolType getPoolType() {
79100
return poolType;
80101
}

0 commit comments

Comments
 (0)