Skip to content

Commit d676cef

Browse files
Don't keep url in details
1 parent 333a395 commit d676cef

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

engine/schema/src/main/java/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public StoragePoolVO persist(StoragePoolVO pool, Map<String, String> details, Li
304304
if (details != null) {
305305
for (Map.Entry<String, String> detail : details.entrySet()) {
306306
boolean display = true;
307-
if (detail.getKey().toLowerCase().contains("password")) {
307+
if (detail.getKey().toLowerCase().contains("password") || detail.getKey().toLowerCase().contains("token")) {
308308
display = false;
309309
}
310310
StoragePoolDetailVO vo = new StoragePoolDetailVO(pool.getId(), detail.getKey(), detail.getValue(), display);

engine/schema/src/main/resources/META-INF/db/schema-41920to41930.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
-- Schema upgrade from 4.19.2.0 to 4.19.3.0
2020
--;
2121

22-
-- Updated display to false for password detail of the storage pool details
22+
-- Updated display to false for password/token detail of the storage pool details
2323
UPDATE `cloud`.`storage_pool_details` SET display = 0 WHERE name LIKE '%password%';
24+
UPDATE `cloud`.`storage_pool_details` SET display = 0 WHERE name LIKE '%token%';

engine/storage/src/main/java/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public class PrimaryDataStoreHelper {
7575
private AnnotationDao annotationDao;
7676

7777
public DataStore createPrimaryDataStore(PrimaryDataStoreParameters params) {
78-
if(params == null)
79-
{
78+
if (params == null) {
8079
throw new InvalidParameterValueException("createPrimaryDataStore: Input params is null, please check");
8180
}
8281
StoragePoolVO dataStoreVO = dataStoreDao.findPoolByUUID(params.getUuid());

plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public DataStore initialize(Map<String, Object> dsInfos) {
125125
Long clusterId = (Long)dsInfos.get("clusterId");
126126
Long podId = (Long)dsInfos.get("podId");
127127
Long zoneId = (Long)dsInfos.get("zoneId");
128-
String url = (String)dsInfos.get("url");
129128
String providerName = (String)dsInfos.get("providerName");
130129
HypervisorType hypervisorType = (HypervisorType)dsInfos.get("hypervisorType");
131130
if (clusterId != null && podId == null) {

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,6 @@ public PrimaryDataStoreInfo createPool(CreateStoragePoolCmd cmd) throws Resource
992992

993993
Map<String, String> details = extractApiParamAsMap(cmd.getDetails());
994994
checkNFSMountOptionsForCreate(details, hypervisorType, uriParams.get("scheme"));
995-
if (StringUtils.isNotBlank(cmd.getUrl())) {
996-
details.put("url", cmd.getUrl());
997-
}
998995

999996
DataCenterVO zone = _dcDao.findById(cmd.getZoneId());
1000997
if (zone == null) {

0 commit comments

Comments
 (0)