Skip to content

Commit 33e9a50

Browse files
committed
Merge remote-tracking branch 'origin/4.13'
2 parents 107bba3 + bfdb914 commit 33e9a50

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
import com.cloud.agent.api.Command;
5656
import com.cloud.agent.api.StartupCommand;
5757
import com.cloud.alert.AlertManager;
58+
import com.cloud.api.query.dao.TemplateJoinDao;
59+
import com.cloud.api.query.vo.TemplateJoinVO;
5860
import com.cloud.configuration.Resource;
5961
import com.cloud.event.EventTypes;
6062
import com.cloud.event.UsageEventUtils;
@@ -111,6 +113,8 @@ public class ImageStoreUploadMonitorImpl extends ManagerBase implements ImageSto
111113
private TemplateDataFactory templateFactory;
112114
@Inject
113115
private TemplateService templateService;
116+
@Inject
117+
private TemplateJoinDao templateJoinDao;
114118

115119
private long _nodeId;
116120
private ScheduledExecutorService _executor = null;
@@ -322,7 +326,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
322326

323327
// publish usage events
324328
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_UPLOAD, tmpVolume.getAccountId(),
325-
tmpVolumeDataStore.getDataStoreId(), tmpVolume.getId(), tmpVolume.getName(),
329+
tmpVolume.getDataCenterId(), tmpVolume.getId(), tmpVolume.getName(),
326330
null, null, tmpVolumeDataStore.getPhysicalSize(), tmpVolumeDataStore.getSize(),
327331
Volume.class.getName(), tmpVolume.getUuid());
328332

@@ -425,7 +429,9 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
425429
if (tmpTemplate.getFormat() == Storage.ImageFormat.ISO) {
426430
etype = EventTypes.EVENT_ISO_CREATE;
427431
}
428-
UsageEventUtils.publishUsageEvent(etype, tmpTemplate.getAccountId(), tmpTemplateDataStore.getDataStoreId(), tmpTemplate.getId(), tmpTemplate.getName(), null, null,
432+
TemplateJoinVO vo = templateJoinDao.findById(tmpTemplate.getId());
433+
assert (vo != null) : "Couldn't find the template view for given template ID";
434+
UsageEventUtils.publishUsageEvent(etype, tmpTemplate.getAccountId(), vo.getDataCenterId(), tmpTemplate.getId(), tmpTemplate.getName(), null, null,
429435
tmpTemplateDataStore.getPhysicalSize(), tmpTemplateDataStore.getSize(), VirtualMachineTemplate.class.getName(), tmpTemplate.getUuid());
430436

431437
if (s_logger.isDebugEnabled()) {

test/integration/smoke/test_privategw_acl.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,14 @@ def performVPCTests(self, vpc_off, restart_with_cleanup = False):
373373
nat_rule_2 = self.create_natrule(vpc_2, vm2, public_ip_2, network_2)
374374

375375
self.check_pvt_gw_connectivity(vm1, public_ip_1, [vm2.nic[0].ipaddress, vm1.nic[0].ipaddress])
376+
self.check_pvt_gw_connectivity(vm2, public_ip_2, [vm2.nic[0].ipaddress, vm1.nic[0].ipaddress])
376377

377378
if restart_with_cleanup:
378379
self.reboot_vpc_with_cleanup(vpc_1, cleanup = restart_with_cleanup)
379380
self.reboot_vpc_with_cleanup(vpc_2, cleanup = restart_with_cleanup)
380381

381382
self.check_pvt_gw_connectivity(vm1, public_ip_1, [vm2.nic[0].ipaddress, vm1.nic[0].ipaddress])
383+
self.check_pvt_gw_connectivity(vm2, public_ip_2, [vm2.nic[0].ipaddress, vm1.nic[0].ipaddress])
382384

383385
def performPrivateGWInterfaceTests(self, vpc_off):
384386
self.logger.debug("Creating VPCs with offering ID %s" % vpc_off.id)
@@ -438,25 +440,32 @@ def performPrivateGWInterfaceTests(self, vpc_off):
438440
public_ip_1 = self.acquire_publicip(vpc_1, network_1)
439441
nat_rule_1 = self.create_natrule(vpc_1, vm1, public_ip_1, network_1)
440442

443+
public_ip_2 = self.acquire_publicip(vpc_2, network_2)
444+
nat_rule_2 = self.create_natrule(vpc_2, vm2, public_ip_2, network_2)
445+
441446
self.check_private_gateway_interfaces()
442447

443448
self.check_pvt_gw_connectivity(vm1, public_ip_1, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
449+
self.check_pvt_gw_connectivity(vm2, public_ip_2, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
444450

445451
self.reboot_vpc_with_cleanup(vpc_1, cleanup = True)
446452
self.check_routers_state()
447453

448454
self.check_pvt_gw_connectivity(vm1, public_ip_1, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
455+
self.check_pvt_gw_connectivity(vm2, public_ip_2, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
449456

450457
self.stop_router_by_type("MASTER")
451458
self.check_routers_state()
452459

453460
self.check_private_gateway_interfaces()
454461
self.check_pvt_gw_connectivity(vm1, public_ip_1, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
462+
self.check_pvt_gw_connectivity(vm2, public_ip_2, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
455463

456464
self.start_routers()
457465
self.check_routers_state()
458466
self.check_private_gateway_interfaces()
459467
self.check_pvt_gw_connectivity(vm1, public_ip_1, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
468+
self.check_pvt_gw_connectivity(vm2, public_ip_2, [vm2.nic[0].ipaddress, vm3.nic[0].ipaddress, vm4.nic[0].ipaddress])
460469

461470
self.deletePvtGw(privateGw_1.id)
462471
self.check_private_gateway_interfaces(status_to_check = "DOWN")

0 commit comments

Comments
 (0)