You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/04/20 18:29:55 UTC

[2/2] brooklyn-server git commit: Closes #115

Closes #115

BROOKLYN-257: allow nulling imageId in jcloudsLocation.obtain()

Fixes https://issues.apache.org/jira/browse/BROOKLYN-257.

To fix this, I was tempted to instead change `JcloudsLocation.buildTemplate` so that it ignored all null values, changing the code below:

```
        for (Map.Entry<ConfigKey<?>, CustomizeTemplateBuilder> entry : SUPPORTED_TEMPLATE_BUILDER_PROPERTIES.entrySet()) {
            ConfigKey<?> name = entry.getKey();
            CustomizeTemplateBuilder code = entry.getValue();
            if (config.containsKey(name))
                code.apply(templateBuilder, config, config.get(name));
        }
```

to:

```
        for (Map.Entry<ConfigKey<?>, CustomizeTemplateBuilder> entry : SUPPORTED_TEMPLATE_BUILDER_PROPERTIES.entrySet()) {
            ConfigKey<?> name = entry.getKey();
            CustomizeTemplateBuilder code = entry.getValue();
            if (config.containsKey(name) && config.get(name) != null)
                code.apply(templateBuilder, config, config.get(name));
        }
```

But is that risky? Do we rely for any config keys on `null` meaning something other than "use the jclouds default"?


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/fee7438f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/fee7438f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/fee7438f

Branch: refs/heads/master
Commit: fee7438f9328dda368ff69b881cc7b30e6a48b50
Parents: d3cc050 d5a01b2
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Wed Apr 20 17:29:40 2016 +0100
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Wed Apr 20 17:29:40 2016 +0100

----------------------------------------------------------------------
 .../location/jclouds/JcloudsLocation.java       |  8 +-
 .../jclouds/AbstractJcloudsStubbedLiveTest.java | 12 ++-
 .../JcloudsImageChoiceStubbedLiveTest.java      | 83 ++++++++++++++++++++
 3 files changed, 99 insertions(+), 4 deletions(-)
----------------------------------------------------------------------