mirror of https://github.com/apache/cloudstack.git
bug 12105: don't generate corresponding firewall rule for the pf/staticNat/lb rule in revoke state
This commit is contained in:
parent
dc4c25fdcc
commit
fd0dc5281a
|
|
@ -112,7 +112,7 @@ public class Upgrade229to2210 implements DbUpgrade {
|
|||
long currentRuleId = 0;
|
||||
try {
|
||||
// Host and Primary storage capacity types
|
||||
pstmt = conn.prepareStatement("select id, ip_address_id, start_port, end_port, protocol, account_id, domain_id, network_id from firewall_rules");
|
||||
pstmt = conn.prepareStatement("select id, ip_address_id, start_port, end_port, protocol, account_id, domain_id, network_id from firewall_rules where state != 'Revoke'");
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
long id = rs.getLong(1);
|
||||
|
|
@ -142,12 +142,13 @@ public class Upgrade229to2210 implements DbUpgrade {
|
|||
pstmt.executeUpdate();
|
||||
|
||||
//get new FirewallRule update
|
||||
pstmt = conn.prepareStatement("SELECT id from firewall_rules where purpose='Firewall' and start_port=? and end_port=? and protocol=? and ip_address_id=? and network_id=?");
|
||||
pstmt = conn.prepareStatement("SELECT id from firewall_rules where purpose='Firewall' and start_port=? and end_port=? and protocol=? and ip_address_id=? and network_id=? and related=?");
|
||||
pstmt.setInt(1, startPort);
|
||||
pstmt.setInt(2, endPort);
|
||||
pstmt.setString(3, protocol);
|
||||
pstmt.setLong(4, ipId);
|
||||
pstmt.setLong(5, networkId);
|
||||
pstmt.setLong(6, id);
|
||||
|
||||
ResultSet rs1 = pstmt.executeQuery();
|
||||
|
||||
|
|
|
|||
|
|
@ -94,12 +94,6 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restartNetwork(RestartNetworkCmd cmd) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActiveNicsInNetwork(long networkId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
@ -502,4 +496,12 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restartNetwork(RestartNetworkCmd cmd, boolean cleanup)
|
||||
throws ConcurrentOperationException, ResourceUnavailableException,
|
||||
InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class AdvanceZone223To224UpgradeTest extends TestCase {
|
|||
@Override
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
DbTestUtils.executeScript("PreviousDatabaseSchema/clean-db.sql", false, true);
|
||||
// DbTestUtils.executeScript("PreviousDatabaseSchema/clean-db.sql", false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -46,8 +46,8 @@ public class AdvanceZone223To224UpgradeTest extends TestCase {
|
|||
}
|
||||
|
||||
public void test217to22Upgrade() throws SQLException {
|
||||
s_logger.debug("Finding sample data from 2.2.3");
|
||||
DbTestUtils.executeScript("PreviousDatabaseSchema/2.2.3/dave-sample.sql", false, true);
|
||||
s_logger.debug("Finding sample data from 2.2.8");
|
||||
// DbTestUtils.executeScript("PreviousDatabaseSchema/2.2.8/dave-sample.sql", false, true);
|
||||
|
||||
Connection conn;
|
||||
PreparedStatement pstmt;
|
||||
|
|
@ -56,9 +56,9 @@ public class AdvanceZone223To224UpgradeTest extends TestCase {
|
|||
DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
|
||||
|
||||
String version = dao.getCurrentVersion();
|
||||
assert version.equals("2.2.2") : "Version returned is not 2.2.2 but " + version;
|
||||
assert version.equals("2.2.8") : "Version returned is not 2.2.8 but " + version;
|
||||
|
||||
checker.upgrade("2.2.2", "2.2.4");
|
||||
checker.upgrade("2.2.8", "2.2.12");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,13 +266,7 @@ public class MockAccountManagerImpl implements Manager, AccountManager {
|
|||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResourceLimitVO> searchForLimits(Criteria c) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean disableAccount(long accountId) throws ConcurrentOperationException, ResourceUnavailableException {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
|||
|
|
@ -337,12 +337,6 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVm migrateVirtualMachine(UserVm vm, Host destinationHost) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner,
|
||||
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps,
|
||||
|
|
@ -369,4 +363,13 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost)
|
||||
throws ResourceUnavailableException, ConcurrentOperationException,
|
||||
ManagementServerException, VirtualMachineMigrationException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue