Skip to content

Commit 8a9ae6f

Browse files
committed
Merge remote-tracking branch 'origin/4.14' into 4.15
Fix upgrade path conflicts, add 4.15.0.0->4.15.1.0 stub Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2 parents abfe0b0 + f70da10 commit 8a9ae6f

5 files changed

Lines changed: 120 additions & 0 deletions

File tree

engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import com.cloud.upgrade.dao.Upgrade41300to41310;
7070
import com.cloud.upgrade.dao.Upgrade41310to41400;
7171
import com.cloud.upgrade.dao.Upgrade41400to41500;
72+
import com.cloud.upgrade.dao.Upgrade41500to41510;
7273
import com.cloud.upgrade.dao.Upgrade420to421;
7374
import com.cloud.upgrade.dao.Upgrade421to430;
7475
import com.cloud.upgrade.dao.Upgrade430to440;
@@ -193,6 +194,8 @@ public DatabaseUpgradeChecker() {
193194
.next("4.13.0.0", new Upgrade41300to41310())
194195
.next("4.13.1.0", new Upgrade41310to41400())
195196
.next("4.14.0.0", new Upgrade41400to41500())
197+
.next("4.14.1.0", new Upgrade41400to41500())
198+
.next("4.15.0.0", new Upgrade41500to41510())
196199
.build();
197200
}
198201

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package com.cloud.upgrade.dao;
19+
20+
import java.io.InputStream;
21+
import java.sql.Connection;
22+
23+
import org.apache.log4j.Logger;
24+
25+
import com.cloud.utils.exception.CloudRuntimeException;
26+
27+
public class Upgrade41500to41510 implements DbUpgrade {
28+
29+
final static Logger LOG = Logger.getLogger(Upgrade41500to41510.class);
30+
31+
@Override
32+
public String[] getUpgradableVersionRange() {
33+
return new String[] {"4.15.0.0", "4.15.1.0"};
34+
}
35+
36+
@Override
37+
public String getUpgradedVersion() {
38+
return "4.15.1.0";
39+
}
40+
41+
@Override
42+
public boolean supportsRollingUpgrade() {
43+
return false;
44+
}
45+
46+
@Override
47+
public InputStream[] getPrepareScripts() {
48+
final String scriptFile = "META-INF/db/schema-41500to41510.sql";
49+
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
50+
if (script == null) {
51+
throw new CloudRuntimeException("Unable to find " + scriptFile);
52+
}
53+
54+
return new InputStream[] {script};
55+
}
56+
57+
@Override
58+
public void performDataMigration(Connection conn) {
59+
}
60+
61+
@Override
62+
public InputStream[] getCleanupScripts() {
63+
final String scriptFile = "META-INF/db/schema-41500to41510-cleanup.sql";
64+
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
65+
if (script == null) {
66+
throw new CloudRuntimeException("Unable to find " + scriptFile);
67+
}
68+
69+
return new InputStream[] {script};
70+
}
71+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one
2+
-- or more contributor license agreements. See the NOTICE file
3+
-- distributed with this work for additional information
4+
-- regarding copyright ownership. The ASF licenses this file
5+
-- to you under the Apache License, Version 2.0 (the
6+
-- "License"); you may not use this file except in compliance
7+
-- with the License. You may obtain a copy of the License at
8+
--
9+
-- http://www.apache.org/licenses/LICENSE-2.0
10+
--
11+
-- Unless required by applicable law or agreed to in writing,
12+
-- software distributed under the License is distributed on an
13+
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
-- KIND, either express or implied. See the License for the
15+
-- specific language governing permissions and limitations
16+
-- under the License.
17+
18+
--;
19+
-- Schema upgrade cleanup from 4.15.0.0 to 4.15.1.0
20+
--;
21+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one
2+
-- or more contributor license agreements. See the NOTICE file
3+
-- distributed with this work for additional information
4+
-- regarding copyright ownership. The ASF licenses this file
5+
-- to you under the Apache License, Version 2.0 (the
6+
-- "License"); you may not use this file except in compliance
7+
-- with the License. You may obtain a copy of the License at
8+
--
9+
-- http://www.apache.org/licenses/LICENSE-2.0
10+
--
11+
-- Unless required by applicable law or agreed to in writing,
12+
-- software distributed under the License is distributed on an
13+
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
-- KIND, either express or implied. See the License for the
15+
-- specific language governing permissions and limitations
16+
-- under the License.
17+
18+
--;
19+
-- Schema upgrade from 4.15.0.0 to 4.15.1.0
20+
--;
21+

vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,10 @@ public static VMwareDVSPvlanConfigSpec createDVPortPvlanConfigSpec(int vlanId, i
10891089
}
10901090

10911091
public static VmwareDistributedVirtualSwitchVlanSpec createDVPortVlanSpec(Integer vlanId, String vlanRange) {
1092+
if (vlanId != null && vlanId == 4095){
1093+
vlanId = null;
1094+
vlanRange = "0-4094";
1095+
}
10921096
if (vlanId == null && vlanRange != null && !vlanRange.isEmpty()) {
10931097
s_logger.debug("Creating dvSwitch port vlan-trunk spec with range: " + vlanRange);
10941098
VmwareDistributedVirtualSwitchTrunkVlanSpec trunkVlanSpec = new VmwareDistributedVirtualSwitchTrunkVlanSpec();

0 commit comments

Comments
 (0)