|
91 | 91 | import com.cloud.network.dao.NetworkDao; |
92 | 92 | import com.cloud.network.dao.NetworkVO; |
93 | 93 | import com.cloud.network.rules.RulesManager; |
94 | | -import com.cloud.offering.DiskOffering; |
95 | 94 | import com.cloud.offering.NetworkOffering; |
96 | 95 | import com.cloud.offering.ServiceOffering; |
97 | 96 | import com.cloud.offerings.dao.NetworkOfferingDao; |
|
105 | 104 | import com.cloud.storage.StoragePoolStatus; |
106 | 105 | import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; |
107 | 106 | import com.cloud.storage.VMTemplateVO; |
108 | | -import com.cloud.storage.dao.DiskOfferingDao; |
109 | 107 | import com.cloud.storage.dao.VMTemplateDao; |
110 | 108 | import com.cloud.user.Account; |
111 | 109 | import com.cloud.user.AccountManager; |
@@ -196,8 +194,6 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy |
196 | 194 | @Inject |
197 | 195 | private ServiceOfferingDao _offeringDao; |
198 | 196 | @Inject |
199 | | - private DiskOfferingDao _diskOfferingDao; |
200 | | - @Inject |
201 | 197 | private NetworkOfferingDao _networkOfferingDao; |
202 | 198 | @Inject |
203 | 199 | private PrimaryDataStoreDao _storagePoolDao; |
@@ -1254,13 +1250,15 @@ public boolean configure(String name, Map<String, Object> params) throws Configu |
1254 | 1250 | //check if there is a default service offering configured |
1255 | 1251 | String cpvmSrvcOffIdStr = configs.get(Config.ConsoleProxyServiceOffering.key()); |
1256 | 1252 | if (cpvmSrvcOffIdStr != null) { |
1257 | | - DiskOffering diskOffering = _diskOfferingDao.findByUuid(cpvmSrvcOffIdStr); |
1258 | | - if (diskOffering == null) { |
1259 | | - diskOffering = _diskOfferingDao.findById(Long.parseLong(cpvmSrvcOffIdStr)); |
| 1253 | + _serviceOffering = _offeringDao.findByUuid(cpvmSrvcOffIdStr); |
| 1254 | + if (_serviceOffering == null) { |
| 1255 | + try { |
| 1256 | + _serviceOffering = _offeringDao.findById(Long.parseLong(cpvmSrvcOffIdStr)); |
| 1257 | + } catch (NumberFormatException ex) { |
| 1258 | + s_logger.debug("The system service offering specified by global config is not id, but uuid=" + cpvmSrvcOffIdStr + " for console proxy vm"); |
| 1259 | + } |
1260 | 1260 | } |
1261 | | - if (diskOffering != null) { |
1262 | | - _serviceOffering = _offeringDao.findById(diskOffering.getId()); |
1263 | | - } else { |
| 1261 | + if (_serviceOffering == null) { |
1264 | 1262 | s_logger.warn("Can't find system service offering specified by global config, uuid=" + cpvmSrvcOffIdStr + " for console proxy vm"); |
1265 | 1263 | } |
1266 | 1264 | } |
|
0 commit comments