You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by aledsage <gi...@git.apache.org> on 2016/04/16 22:26:36 UTC

[GitHub] brooklyn-server pull request: BROOKLYN-257: allow nulling imageId ...

GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/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"?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server fix/imageId-overriding

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/115.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #115
    
----
commit d5a01b23ec38b7f6e3faba9b7b6ef45257113d55
Author: Aled Sage <al...@gmail.com>
Date:   2016-04-16T20:19:12Z

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

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request: BROOKLYN-257: allow nulling imageId ...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:

    https://github.com/apache/brooklyn-server/pull/115#issuecomment-214718946
  
    Cherry-picking this into 0.9.x branch.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request: BROOKLYN-257: allow nulling imageId ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/115


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request: BROOKLYN-257: allow nulling imageId ...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the pull request:

    https://github.com/apache/brooklyn-server/pull/115#issuecomment-212502063
  
    +1 to doing this in `buildTemplate`. Looking at the `CustomizeTemplateBuilder`s they either will break with null values or ignore them if present.
    Merging as is, it's useful on it's own. Further changes can be done in a separate commit.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---