Skip to content

Commit 2871af3

Browse files
committed
revert exception change
1 parent cac5905 commit 2871af3

File tree

5 files changed

+480
-49
lines changed

5 files changed

+480
-49
lines changed

client/conf/log4j-cloud.xml.in

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
10-
11-
http://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
19-
-->
201
<Configuration monitorInterval="60" packages="org.apache.cloudstack.alert.snmp,org.apache.cloudstack.syslog">
212
<Appenders>
223

@@ -34,7 +15,7 @@ under the License.
3415
<Policies>
3516
<TimeBasedTriggeringPolicy/>
3617
</Policies>
37-
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
18+
<PatternLayout pattern="%d{ISO8601} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
3819
</RollingFile>
3920

4021

@@ -43,33 +24,15 @@ under the License.
4324
<Policies>
4425
<TimeBasedTriggeringPolicy/>
4526
</Policies>
46-
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
27+
<PatternLayout pattern="%d{ISO8601} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
4728
</RollingFile>
4829

49-
<!-- ============================== -->
50-
<!-- Append warnings+ to the syslog if it is listening on UDP port -->
51-
<!-- ============================== -->
52-
53-
<Syslog name="SYSLOG" host="localhost" facility="LOCAL6">
54-
<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
55-
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
56-
</Syslog>
57-
58-
<!-- ============================== -->
59-
<!-- Append alerts to the syslog if it is configured -->
60-
<!-- ============================== -->
61-
62-
<AlertSyslogAppender name="ALERTSYSLOG" syslogHosts="" facility="LOCAL6">
63-
<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
64-
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
65-
</AlertSyslogAppender>
66-
6730
<!-- ============================== -->
6831
<!-- Append messages to the console -->
6932
<!-- ============================== -->
7033

7134
<Console name="CONSOLE" target="SYSTEM_OUT">
72-
<ThresholdFilter level="OFF" onMatch="ACCEPT" onMismatch="DENY"/>
35+
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
7336
<PatternLayout pattern="%-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
7437
</Console>
7538

@@ -131,4 +94,4 @@ under the License.
13194
</Root>
13295

13396
</Loggers>
134-
</Configuration>
97+
</Configuration>

results.xml

Lines changed: 467 additions & 0 deletions
Large diffs are not rendered by default.

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,7 @@ private NetworkVO getDefaultNetwork(DataCenter zone, Account owner, boolean sele
39843984
return defaultNetwork;
39853985
}
39863986

3987-
protected NetworkVO createDefaultNetworkForAccount(DataCenter zone, Account owner, List<NetworkOfferingVO> requiredOfferings)
3987+
private NetworkVO createDefaultNetworkForAccount(DataCenter zone, Account owner, List<NetworkOfferingVO> requiredOfferings)
39883988
throws InsufficientCapacityException, ResourceAllocationException {
39893989
NetworkVO defaultNetwork = null;
39903990
long physicalNetworkId = _networkModel.findPhysicalNetworkId(zone.getId(), requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType());
@@ -7594,7 +7594,7 @@ protected void executeStepsToChangeOwnershipOfVm(AssignVMCmd cmd, Account caller
75947594
MutableBoolean isNetworkCreated = new MutableBoolean(false);
75957595
try {
75967596
updateVmNetwork(cmd, caller, vm, newAccount, template, isNetworkCreated);
7597-
} catch (Exception e) {
7597+
} catch (InsufficientCapacityException | ResourceAllocationException e) {
75987598
List<NetworkVO> networkVOS = _networkDao.listByAccountIdNetworkName(newAccountId, newAccount.getAccountName() + "-network");
75997599
if (networkVOS.size() == 1 && isNetworkCreated.get()) {
76007600
_networkDao.remove(networkVOS.get(0).getId());
@@ -7663,7 +7663,7 @@ protected void updateVolumesOwner(final List<VolumeVO> volumes, Account oldAccou
76637663
* @throws ResourceAllocationException
76647664
*/
76657665
protected void updateVmNetwork(AssignVMCmd cmd, Account caller, UserVmVO vm, Account newAccount, VirtualMachineTemplate template, MutableBoolean isNetworkCreated)
7666-
throws Exception {
7666+
throws InsufficientCapacityException, ResourceAllocationException {
76677667

76687668
logger.trace("Updating network for VM [{}].", vm);
76697669

@@ -7792,7 +7792,7 @@ protected void updateBasicTypeNetworkForVm(AssignVMCmd cmd, UserVmVO vm, Account
77927792
*/
77937793
protected void updateAdvancedTypeNetworkForVm(AssignVMCmd cmd, Account caller, UserVmVO vm, Account newAccount, VirtualMachineTemplate template,
77947794
VirtualMachineProfileImpl vmOldProfile, DataCenterVO zone, List<Long> networkIdList, List<Long> securityGroupIdList, MutableBoolean isNetworkCreated)
7795-
throws Exception {
7795+
throws InsufficientCapacityException, ResourceAllocationException, InvalidParameterValueException {
77967796

77977797
LinkedHashSet<NetworkVO> applicableNetworks = new LinkedHashSet<>();
77987798
Map<Long, String> requestedIPv4ForNics = new HashMap<>();
@@ -7943,11 +7943,12 @@ protected NetworkVO addNicsToApplicableNetworksAndReturnDefaultNetwork(LinkedHas
79437943
* @param newAccount The new account associated to the selected network.
79447944
* @param zone The zone where the network is selected.
79457945
* @param applicableNetworks The applicable networks to which the selected network has to be added to.
7946-
* @throws Exception
7946+
* @throws InsufficientCapacityException
7947+
* @throws ResourceAllocationException
79477948
*/
79487949
protected void selectApplicableNetworkToCreateVm(Account caller, Account newAccount, DataCenterVO zone,
79497950
Set<NetworkVO> applicableNetworks, MutableBoolean isNetworkCreated)
7950-
throws Exception {
7951+
throws InsufficientCapacityException, ResourceAllocationException {
79517952

79527953
logger.trace("Selecting the applicable network to create the VM.");
79537954

test/integration/component/test_assign_vm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def test_01_move_across_different_domains(self):
246246
self.virtual_machine.assign_virtual_machine(self.apiclient, self.domain_account_user2['account'].name ,self.domain_account_user2['domain'].id)
247247
self.check_vm_is_moved_in_account_domainid(self.domain_account_user2['account'])
248248

249-
@attr(tags = ["advanced"])
249+
@attr(tags = ["pearl", "advanced"])
250250
@log_test_exceptions
251251
def test_02_move_across_subdomains(self):
252252
"""Test as root, stop a VM from subdomain1 and attempt to move it to subdomain2

test/integration/smoke/test_hostha_simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def test_ha_configure_enabledisable_across_clusterzones(self):
401401
self.checkSyncToState('Available')
402402

403403

404-
@attr(tags=["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
404+
@attr(tags=["pearl", "devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
405405
def test_ha_multiple_mgmt_server_ownership(self):
406406
"""
407407
Tests ha resource ownership expiry across multi-mgmt server

0 commit comments

Comments
 (0)