Skip to content

Commit 7ee697f

Browse files
committed
Merge release branch 4.18 to main
* 4.18: UI: allow new keys for VM details (#7793) Refactoring StorPool's smoke tests (#7392) UI: decode userdata in EditVM dialog (#7796) packaging: unalias cp before package upgrade (#7722) make NoopDbUpgrade do a systemvm template check (#7564) UI unit test: fix expected values (#7792)
2 parents 6f45034 + c86684f commit 7ee697f

File tree

12 files changed

+113
-42
lines changed

12 files changed

+113
-42
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,11 @@ private void decryptInit(Connection conn) throws SQLException {
446446
}
447447

448448
@VisibleForTesting
449-
protected static final class NoopDbUpgrade implements DbUpgrade {
449+
protected static final class NoopDbUpgrade implements DbUpgrade, DbUpgradeSystemVmTemplate {
450450

451451
private final String upgradedVersion;
452452
private final String[] upgradeRange;
453+
private SystemVmTemplateRegistration systemVmTemplateRegistration;
453454

454455
private NoopDbUpgrade(final CloudStackVersion fromVersion, final CloudStackVersion toVersion) {
455456

@@ -490,5 +491,19 @@ public InputStream[] getCleanupScripts() {
490491
return new InputStream[0];
491492
}
492493

494+
private void initSystemVmTemplateRegistration() {
495+
systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
496+
}
497+
498+
@Override
499+
public void updateSystemVmTemplates(Connection conn) {
500+
s_logger.debug("Updating System Vm template IDs");
501+
initSystemVmTemplateRegistration();
502+
try {
503+
systemVmTemplateRegistration.updateSystemVmTemplates(conn);
504+
} catch (Exception e) {
505+
throw new CloudRuntimeException("Failed to find / register SystemVM template(s)");
506+
}
507+
}
493508
}
494509
}

packaging/centos8/cloud.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ install -D tools/whisker/LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/%{name}-inte
392392

393393
%posttrans common
394394

395+
unalias cp
395396
python_dir=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
396397
if [ ! -z $python_dir ];then
397398
cp -f -r /usr/share/cloudstack-common/python-site/* $python_dir/

plugins/storage/volume/storpool/pom.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
<artifactId>mockito-inline</artifactId>
6262
<version>4.7.0</version>
6363
</dependency>
64+
<dependency>
65+
<groupId>pl.project13.maven</groupId>
66+
<artifactId>git-commit-id-plugin</artifactId>
67+
<version>4.9.10</version>
68+
</dependency>
6469
</dependencies>
6570
<build>
6671
<plugins>
@@ -75,6 +80,35 @@
7580
</execution>
7681
</executions>
7782
</plugin>
83+
<plugin>
84+
<groupId>pl.project13.maven</groupId>
85+
<artifactId>git-commit-id-plugin</artifactId>
86+
<version>4.9.10</version>
87+
<executions>
88+
<execution>
89+
<id>get-the-git-infos</id>
90+
<goals>
91+
<goal>revision</goal>
92+
</goals>
93+
</execution>
94+
</executions>
95+
<configuration>
96+
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
97+
<prefix>git</prefix>
98+
<verbose>false</verbose>
99+
<generateGitPropertiesFile>true</generateGitPropertiesFile>
100+
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
101+
<format>json</format>
102+
<excludeProperties>
103+
<excludeProperty>git.*.email</excludeProperty>
104+
</excludeProperties>
105+
<gitDescribe>
106+
<skip>false</skip>
107+
<always>false</always>
108+
<dirty>-dirty</dirty>
109+
</gitDescribe>
110+
</configuration>
111+
</plugin>
78112
</plugins>
79113
</build>
80114
</project>

test/integration/plugins/storpool/MigrateVolumeToStorPool.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,19 @@ def setUpClass(cls):
7878

7979
@classmethod
8080
def setUpCloudStack(cls):
81-
cls.spapi = spapi.Api(host="10.2.23.248", port="81", auth="6549874687", multiCluster=True)
81+
config = cls.getClsConfig()
82+
StorPoolHelper.logger = cls
83+
84+
zone = config.zones[0]
85+
assert zone is not None
86+
87+
cls.spapi = spapi.Api(host=zone.spEndpoint, port=zone.spEndpointPort, auth=zone.spAuthToken, multiCluster=True)
8288
testClient = super(TestMigrateVolumeToAnotherPool, cls).getClsTestClient()
8389
cls.apiclient = testClient.getApiClient()
8490

91+
cls.zone = list_zones(cls.apiclient, name=zone.name)[0]
92+
assert cls.zone is not None
93+
8594
cls._cleanup = []
8695

8796
cls.unsupportedHypervisor = False
@@ -93,14 +102,6 @@ def setUpCloudStack(cls):
93102
cls.services = testClient.getParsedTestDataConfig()
94103
# Get Zone, Domain and templates
95104
cls.domain = get_domain(cls.apiclient)
96-
cls.zone = None
97-
zones = list_zones(cls.apiclient)
98-
99-
for z in zones:
100-
if z.name == cls.getClsConfig().mgtSvr[0].zone:
101-
cls.zone = z
102-
103-
assert cls.zone is not None
104105

105106
td = TestData()
106107
cls.testdata = td.testdata

test/integration/plugins/storpool/TestStorPoolVolumes.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ def setUpClass(cls):
7777

7878
@classmethod
7979
def setUpCloudStack(cls):
80+
config = cls.getClsConfig()
81+
StorPoolHelper.logger = cls
82+
83+
zone = config.zones[0]
84+
assert zone is not None
85+
86+
cls.spapi = spapi.Api(host=zone.spEndpoint, port=zone.spEndpointPort, auth=zone.spAuthToken, multiCluster=True)
8087
testClient = super(TestStoragePool, cls).getClsTestClient()
8188

8289
cls._cleanup = []
@@ -94,20 +101,16 @@ def setUpCloudStack(cls):
94101

95102
# Get Zone, Domain and templates
96103
cls.domain = get_domain(cls.apiclient)
97-
cls.zone = None
98-
zones = list_zones(cls.apiclient)
99-
100-
for z in zones:
101-
if z.name == cls.getClsConfig().mgtSvr[0].zone:
102-
cls.zone = z
103-
104+
cls.zone = list_zones(cls.apiclient, name=zone.name)[0]
105+
cls.debug(cls.zone)
106+
cls.debug(list_zones(cls.apiclient, name=zone.name))
104107
assert cls.zone is not None
105108

106109
cls.sp_template_1 = "ssd"
107110
storpool_primary_storage = {
108111
"name" : cls.sp_template_1,
109112
"zoneid": cls.zone.id,
110-
"url": "SP_API_HTTP=10.2.23.248:81;SP_AUTH_TOKEN=6549874687;SP_TEMPLATE=%s" % cls.sp_template_1,
113+
"url": "SP_API_HTTP=%s:%s;SP_AUTH_TOKEN=%s;SP_TEMPLATE=%s" % (zone.spEndpoint, zone.spEndpointPort, zone.spAuthToken, cls.sp_template_1),
111114
"scope": "zone",
112115
"capacitybytes": 564325555333,
113116
"capacityiops": 155466,
@@ -117,8 +120,6 @@ def setUpCloudStack(cls):
117120
}
118121

119122
cls.storpool_primary_storage = storpool_primary_storage
120-
host, port, auth = cls.getCfgFromUrl(url = storpool_primary_storage["url"])
121-
cls.spapi = spapi.Api(host=host, port=port, auth=auth, multiCluster=True)
122123

123124
storage_pool = list_storage_pools(
124125
cls.apiclient,
@@ -166,7 +167,7 @@ def setUpCloudStack(cls):
166167
storpool_primary_storage2 = {
167168
"name" : cls.sp_template_2,
168169
"zoneid": cls.zone.id,
169-
"url": "SP_API_HTTP=10.2.23.248:81;SP_AUTH_TOKEN=6549874687;SP_TEMPLATE=%s" % cls.sp_template_2,
170+
"url": "SP_API_HTTP=%s:%s;SP_AUTH_TOKEN=%s;SP_TEMPLATE=%s" % (zone.spEndpoint, zone.spEndpointPort, zone.spAuthToken, cls.sp_template_2),
170171
"scope": "zone",
171172
"capacitybytes": 564325555333,
172173
"capacityiops": 1554,

test/integration/plugins/storpool/TestTagsOnStorPool.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ def setUpClass(cls):
7777

7878
@classmethod
7979
def setUpCloudStack(cls):
80-
cls.spapi = spapi.Api(host="10.2.23.248", port="81", auth="6549874687", multiCluster=True)
80+
config = cls.getClsConfig()
81+
StorPoolHelper.logger = cls
82+
83+
zone = config.zones[0]
84+
assert zone is not None
85+
86+
cls.spapi = spapi.Api(host=zone.spEndpoint, port=zone.spEndpointPort, auth=zone.spAuthToken, multiCluster=True)
8187
testClient = super(TestStoragePool, cls).getClsTestClient()
8288
cls.apiclient = testClient.getApiClient()
8389
cls.unsupportedHypervisor = False
@@ -91,12 +97,10 @@ def setUpCloudStack(cls):
9197
cls.services = testClient.getParsedTestDataConfig()
9298
# Get Zone, Domain and templates
9399
cls.domain = get_domain(cls.apiclient)
94-
cls.zone = None
95-
zones = list_zones(cls.apiclient)
96-
97-
for z in zones:
98-
if z.name == cls.getClsConfig().mgtSvr[0].zone:
99-
cls.zone = z
100+
cls.zone = list_zones(cls.apiclient, name=zone.name)[0]
101+
cls.debug(cls.zone)
102+
cls.debug(list_zones(cls.apiclient, name=zone.name))
103+
assert cls.zone is not None
100104

101105
assert cls.zone is not None
102106

test/integration/plugins/storpool/TestVmSnapshots.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ def setUpClass(cls):
6060

6161
@classmethod
6262
def setUpCloudStack(cls):
63+
config = cls.getClsConfig()
64+
StorPoolHelper.logger = cls
65+
66+
zone = config.zones[0]
67+
assert zone is not None
68+
6369
testClient = super(TestVmSnapshot, cls).getClsTestClient()
6470
cls.apiclient = testClient.getApiClient()
6571
cls._cleanup = []
@@ -74,13 +80,9 @@ def setUpCloudStack(cls):
7480
cls.services = testClient.getParsedTestDataConfig()
7581
# Get Zone, Domain and templates
7682
cls.domain = get_domain(cls.apiclient)
77-
cls.zone = None
78-
zones = list_zones(cls.apiclient)
79-
80-
for z in zones:
81-
if z.name == cls.getClsConfig().mgtSvr[0].zone:
82-
cls.zone = z
83-
83+
cls.zone = list_zones(cls.apiclient, name=zone.name)[0]
84+
cls.debug(cls.zone)
85+
cls.debug(list_zones(cls.apiclient, name=zone.name))
8486
assert cls.zone is not None
8587

8688
cls.cluster = list_clusters(cls.apiclient)[0]

test/integration/plugins/storpool/sp_util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ def __init__(self):
301301
},
302302
}
303303
class StorPoolHelper():
304+
def setUpClass(cls):
305+
cls.logger = None
306+
307+
@classmethod
308+
def logging(cls):
309+
return cls.logger
304310

305311
@classmethod
306312
def create_template_from_snapshot(self, apiclient, services, snapshotid=None, volumeid=None):

ui/public/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,6 @@
780780
"label.egressdefaultpolicy": "Default egress policy",
781781
"label.elastic": "Elastic",
782782
"label.email": "Email",
783-
"label.enabled": "Enabled",
784783
"label.enable.autoscale.vmgroup": "Enable AutoScale VM Group",
785784
"label.enable.host": "Enable Host",
786785
"label.enable.network.offering": "Enable network offering",
@@ -2058,6 +2057,7 @@
20582057
"label.uk.keyboard": "UK keyboard",
20592058
"label.unauthorized": "Unauthorized",
20602059
"label.unavailable": "Unavailable",
2060+
"label.undefined": "Undefined",
20612061
"label.unit": "Usage unit",
20622062
"label.unknown": "Unknown",
20632063
"label.unlimited": "Unlimited",

ui/src/components/view/DetailSettings.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ export default {
170170
return []
171171
}
172172
if (!Array.isArray(this.detailOptions[this.newKey])) {
173-
return { value: this.detailOptions[this.newKey] }
173+
if (this.detailOptions[this.newKey]) {
174+
return { value: this.detailOptions[this.newKey] }
175+
} else {
176+
return ''
177+
}
174178
}
175179
return this.detailOptions[this.newKey].map(value => {
176180
return { value: value }

0 commit comments

Comments
 (0)