newPool.getBranding().add(new Branding(b.getProductId(), b.getType(),
b.getName()));
}
newPool.setSourceSubscription(new SourceSubscription(sub.getId(), "master"));
ProductAttribute virtAtt = sub.getProduct().getAttribute("virt_only");
// note: the product attributes are getting copied above, but the following will
// make virt_only a pool attribute. That makes the pool explicitly virt_only to
// subscription manager and any other downstream comsumer.
if (virtAtt != null && virtAtt.getValue() != null &&
!virtAtt.getValue().equals("")) {
newPool.addAttribute(new org.candlepin.model.PoolAttribute("virt_only",
virtAtt.getValue()));
}
pools.add(newPool);
}