Skip to content

Commit 3d22a16

Browse files
Bump priority stragety is no longer used for redundant virtual routers
- With the changes added by the rVPC work, the bump priority became deprecated. This commit includes a refactor to get it removed from the following resources: * Java classes * domain_router table - removing the is_priority_bumpup column * Fixing unit tests All changes were tested with: XenServer 6.2 running under our VMWare zone CloudStack Management Server running on MacBook Pro MySql running on MackBook Pro Storage Type: Local
1 parent 3e28747 commit 3d22a16

21 files changed

Lines changed: 680 additions & 987 deletions

File tree

core/src/com/cloud/agent/api/CheckRouterAnswer.java

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,63 +22,49 @@
2222
import com.cloud.network.router.VirtualRouter.RedundantState;
2323

2424
public class CheckRouterAnswer extends Answer {
25+
2526
public static final String ROUTER_NAME = "router.name";
2627
public static final String ROUTER_IP = "router.ip";
2728
RedundantState state;
28-
boolean isBumped;
2929

3030
protected CheckRouterAnswer() {
3131
}
3232

33-
public CheckRouterAnswer(CheckRouterCommand cmd, String details, boolean parse) {
33+
public CheckRouterAnswer(final CheckRouterCommand cmd, final String details, final boolean parse) {
3434
super(cmd, true, details);
3535
if (parse) {
3636
if (!parseDetails(details)) {
37-
this.result = false;
37+
result = false;
3838
}
3939
}
4040
}
4141

42-
public CheckRouterAnswer(CheckRouterCommand cmd, String details) {
42+
public CheckRouterAnswer(final CheckRouterCommand cmd, final String details) {
4343
super(cmd, false, details);
4444
}
4545

46-
protected boolean parseDetails(String details) {
47-
String[] lines = details.split("&");
48-
if (lines.length != 2) {
46+
protected boolean parseDetails(final String details) {
47+
if (details == null || "".equals(details.trim())) {
48+
state = RedundantState.UNKNOWN;
4949
return false;
5050
}
51-
if (lines[0].startsWith("Status: MASTER")) {
51+
if (details.startsWith("Status: MASTER")) {
5252
state = RedundantState.MASTER;
53-
} else if (lines[0].startsWith("Status: BACKUP")) {
53+
} else if (details.startsWith("Status: BACKUP")) {
5454
state = RedundantState.BACKUP;
55-
} else if (lines[0].startsWith("Status: FAULT")) {
55+
} else if (details.startsWith("Status: FAULT")) {
5656
state = RedundantState.FAULT;
5757
} else {
5858
state = RedundantState.UNKNOWN;
5959
}
60-
if (lines[1].startsWith("Bumped: YES")) {
61-
isBumped = true;
62-
} else {
63-
isBumped = false;
64-
}
6560
return true;
6661
}
6762

68-
public void setState(RedundantState state) {
63+
public void setState(final RedundantState state) {
6964
this.state = state;
7065
}
7166

7267
public RedundantState getState() {
7368
return state;
7469
}
75-
76-
public boolean isBumped() {
77-
return isBumped;
78-
}
79-
80-
public void setIsBumped(boolean isBumped) {
81-
this.isBumped = isBumped;
82-
}
83-
84-
}
70+
}

core/src/com/cloud/agent/api/SetupGuestNetworkCommand.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class SetupGuestNetworkCommand extends NetworkElementCommand {
2828
String defaultDns1 = null;
2929
String defaultDns2 = null;
3030
boolean isRedundant = false;
31-
Integer priority;
3231
boolean add = true;
3332
NicTO nic;
3433

@@ -60,14 +59,13 @@ public boolean executeInSequence() {
6059
protected SetupGuestNetworkCommand() {
6160
}
6261

63-
public SetupGuestNetworkCommand(String dhcpRange, String networkDomain, boolean isRedundant, Integer priority, String defaultDns1, String defaultDns2, boolean add,
64-
NicTO nic) {
62+
public SetupGuestNetworkCommand(final String dhcpRange, final String networkDomain, final boolean isRedundant, final String defaultDns1, final String defaultDns2, final boolean add,
63+
final NicTO nic) {
6564
this.dhcpRange = dhcpRange;
6665
this.networkDomain = networkDomain;
6766
this.defaultDns1 = defaultDns1;
6867
this.defaultDns2 = defaultDns2;
6968
this.isRedundant = isRedundant;
70-
this.priority = priority;
7169
this.add = add;
7270
this.nic = nic;
7371
}

0 commit comments

Comments
 (0)