> + boolean localDiskFlag = checkNotNull(virtualGuest.isLocalDiskFlag(),
> "localDiskFlag");
> + String datacenterName =
> checkNotNull(virtualGuest.getDatacenter().getName(), "datacenterName");
> + Set<NetworkComponent> networkComponents =
> getNetworkComponents(virtualGuest);
> + if(virtualGuest.getOperatingSystem() != null) {
> + String operatingSystemReferenceCode =
> checkNotNull(virtualGuest.getOperatingSystem()
> + .getOperatingSystemReferenceCode(),
> "operatingSystemReferenceCode");
> + templateObject = new TemplateObject(hostname, domain, startCpus,
> maxMemory, true,
> + operatingSystemReferenceCode, null, localDiskFlag, new
> Datacenter(datacenterName), networkComponents,
> + getBlockDevices(virtualGuest));
> + } else if(virtualGuest.getVirtualGuestBlockDeviceTemplateGroup() !=
> null) {
> + String globalIdentifier =
> checkNotNull(virtualGuest.getVirtualGuestBlockDeviceTemplateGroup()
> + .getGlobalIdentifier(),
> "blockDeviceTemplateGroup.globalIdentifier");
> + templateObject = new TemplateObject(hostname, domain, startCpus,
> maxMemory, true, null,
> + new BlockDeviceTemplateGroup(globalIdentifier),
> localDiskFlag, new Datacenter(datacenterName),
> + networkComponents, null);
> + }
What if `getOperatingSystem` and `getVirtualGuestBlockDeviceTemplateGroup` are
**both** `null`? Or is that not possible?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/296/files#r11324390