Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/585#discussion_r28333207
--- Diff:
core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---
@@ -664,10 +858,28 @@ private DeploymentPlan makePlanFromYaml(String yaml) {
}
@Override
+ public List<? extends CatalogItem<?,?>> addItems(String yaml) {
+ return addItems(yaml, false);
+ }
+
+ @Override
public CatalogItem<?,?> addItem(String yaml, boolean forceUpdate) {
+ return Iterables.getOnlyElement(addItems(yaml, forceUpdate));
+ }
+
+ @Override
+ public List<? extends CatalogItem<?,?>> addItems(String yaml, boolean
forceUpdate) {
log.debug("Adding manual catalog item to "+mgmt+": "+yaml);
checkNotNull(yaml, "yaml");
- CatalogItemDtoAbstract<?,?> itemDto = getAbstractCatalogItem(yaml);
+ List<CatalogItemDtoAbstract<?, ?>> result =
addAbstractCatalogItems(yaml, forceUpdate);
+ // previously we did this here, but now we do it on each item, in
case #2 refers to #1
--- End diff --
I see where you are coming from, but when combined with the "don't
overwrite existing items" default behaviour users will have hard time testing
and developing catalog items blueprints if addition is not atomic.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---