Skip to content

Commit d80623b

Browse files
committed
small fix
1 parent aa678bb commit d80623b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public boolean hostAboutToBeRemoved(long hostId) {
211211
}
212212
if (!answer.getResult()) {
213213
String msg = String.format("Unable to cleanup persistent network resources from network %d on the host %d", persistentNetworkVO.getId(), hostId);
214-
s_logger.error(msg);
214+
s_logger.error(msg);
215215
}
216216
}
217217
return true;
@@ -235,7 +235,6 @@ public boolean hostEnabled(long hostId) {
235235

236236
private void setupPersistentNetwork(HostVO host) {
237237
List<NetworkVO> allPersistentNetworks = networkDao.getAllPersistentNetworksFromZone(host.getDataCenterId());
238-
239238
for (NetworkVO networkVO : allPersistentNetworks) {
240239
NetworkOfferingVO networkOfferingVO = networkOfferingDao.findById(networkVO.getNetworkOfferingId());
241240

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import javax.inject.Inject;
3737
import javax.naming.ConfigurationException;
3838

39+
import com.cloud.exception.StorageConflictException;
40+
import com.cloud.exception.StorageUnavailableException;
3941
import org.apache.cloudstack.annotation.AnnotationService;
4042
import org.apache.cloudstack.annotation.dao.AnnotationDao;
4143
import org.apache.cloudstack.api.ApiConstants;
@@ -1836,6 +1838,11 @@ public Host updateHost(final UpdateHostCmd cmd) throws NoTransitionException {
18361838
if (url != null) {
18371839
_storageMgr.updateSecondaryStorage(cmd.getId(), cmd.getUrl());
18381840
}
1841+
try {
1842+
_storageMgr.enableHost(hostId);
1843+
} catch (StorageUnavailableException | StorageConflictException e) {
1844+
s_logger.error(String.format("Failed to setup host %s when enabled", host));
1845+
}
18391846

18401847
final HostVO updatedHost = _hostDao.findById(hostId);
18411848
return updatedHost;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,15 +1121,13 @@ public void disconnectHostFromSharedPool(long hostId, long poolId) throws Storag
11211121
}
11221122

11231123
@Override
1124-
public void enableHost(long hostId) throws StorageUnavailableException, StorageConflictException {
1124+
public void enableHost(long hostId) {
11251125
List<DataStoreProvider> providers = _dataStoreProviderMgr.getProviders();
1126-
11271126
if (providers != null) {
11281127
for (DataStoreProvider provider : providers) {
11291128
if (provider instanceof PrimaryDataStoreProvider) {
11301129
try {
11311130
HypervisorHostListener hypervisorHostListener = provider.getHostListener();
1132-
11331131
if (hypervisorHostListener != null) {
11341132
hypervisorHostListener.hostEnabled(hostId);
11351133
}

0 commit comments

Comments
 (0)