brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/2] brooklyn-server git commit: Closes #115
Date Wed, 20 Apr 2016 16:29:55 GMT
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 <svetoslav.neykov@cloudsoftcorp.com>
Authored: Wed Apr 20 17:29:40 2016 +0100
Committer: Svetoslav Neykov <svetoslav.neykov@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(-)
----------------------------------------------------------------------



Mime
View raw message