Skip to content

Commit 14ecedf

Browse files
authored
Merge branch 'main' into cfg-auto-add-license-headers
2 parents 74cb4bf + bc76f20 commit 14ecedf

File tree

6 files changed

+74
-43
lines changed

6 files changed

+74
-43
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ repos:
7272
- .github/workflows/license-templates/LICENSE.txt
7373
- --fuzzy-match-generates-todo
7474
exclude: ^(CHANGES|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)\.md$|^ui/docs/(full|smoke)-test-plan\.template\.md$
75+
- id: insert-license
76+
name: add license for all properties files
77+
description: automatically adds a licence header to all properties files that don't have a license header
78+
files: \.properties$
79+
args:
80+
- --comment-style
81+
- '|#|'
82+
- --license-filepath
83+
- .github/workflows/license-templates/LICENSE.txt
84+
- --fuzzy-match-generates-todo
7585
- id: insert-license
7686
name: add license for all Shell files
7787
description: automatically adds a licence header to all Shell files that don't have a license header

plugins/hypervisors/ovm3/sonar-project.properties

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
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
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
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
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.
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.
1717

1818
# Required metadata
1919
sonar.projectKey=cloud-plugin-hypervisor-ovm3

plugins/hypervisors/ovm3/src/test/resources/log4j.properties

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
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
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
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
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.
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.
1717

1818
# Root logger option
1919
log4j.rootLogger=DEBUG, stdout

plugins/network-elements/globodns/src/test/resources/log4j.properties

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one or more
2-
# contributor license agreements. See the NOTICE file distributed with
3-
# this work for additional information regarding copyright ownership.
4-
# The ASF licenses this file to You under the Apache License, Version 2.0
5-
# (the "License"); you may not use this file except in compliance with
6-
# the License. You may obtain a copy of the License at
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
78
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
910
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
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.
1517

1618
# Define the root logger with appender file
1719
#log = /var/log/log4j

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,14 +2179,16 @@ public Volume changeDiskOfferingForVolumeInternal(Long volumeId, Long newDiskOff
21792179
}
21802180
Collections.shuffle(suitableStoragePoolsWithEnoughSpace);
21812181
MigrateVolumeCmd migrateVolumeCmd = new MigrateVolumeCmd(volume.getId(), suitableStoragePoolsWithEnoughSpace.get(0).getId(), newDiskOffering.getId(), true);
2182+
String volumeUuid = volume.getUuid();
21822183
try {
21832184
Volume result = migrateVolume(migrateVolumeCmd);
21842185
volume = (result != null) ? _volsDao.findById(result.getId()) : null;
21852186
if (volume == null) {
2186-
throw new CloudRuntimeException(String.format("Volume change offering operation failed for volume: %s migration failed to storage pool %s", volume, suitableStoragePools.get(0)));
2187+
throw new CloudRuntimeException("Change offering for the volume failed.");
21872188
}
21882189
} catch (Exception e) {
2189-
throw new CloudRuntimeException(String.format("Volume change offering operation failed for volume: %s migration failed to storage pool %s due to %s", volume, suitableStoragePools.get(0), e.getMessage()));
2190+
logger.error("Volume change offering operation failed for volume ID: {} migration failed to storage pool {} due to {}", volumeUuid, suitableStoragePoolsWithEnoughSpace.get(0).getId(), e.getMessage());
2191+
throw new CloudRuntimeException("Change offering for the volume failed.", e);
21902192
}
21912193
}
21922194

@@ -2199,7 +2201,7 @@ public Volume changeDiskOfferingForVolumeInternal(Long volumeId, Long newDiskOff
21992201
if (volumeMigrateRequired) {
22002202
logger.warn(String.format("Volume change offering operation succeeded for volume ID: %s but volume resize operation failed, so please try resize volume operation separately", volume.getUuid()));
22012203
} else {
2202-
throw new CloudRuntimeException(String.format("Volume change offering operation failed for volume ID: %s due to resize volume operation failed", volume.getUuid()));
2204+
throw new CloudRuntimeException(String.format("Volume disk offering change operation failed for volume ID [%s] because the volume resize operation failed.", volume.getUuid()));
22032205
}
22042206
}
22052207
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
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+
118
paths.script=../../scripts/storage/secondary/
219
paths.pid=.

0 commit comments

Comments
 (0)