[2/4] brooklyn-docs git commit: Typos
Typos Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/24371929 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/24371929 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/24371929 Branch: refs/heads/master Commit: 243719295311a80c78a8faa88d58cfa69b9e9faa Parents: ffc3ee6 Author: Sam CorbettAuthored: Wed Apr 20 17:54:24 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 17:54:24 2016 +0100 -- contributing/inline-children.md | 4 ++-- guide/ops/locations/index.md| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/24371929/contributing/inline-children.md -- diff --git a/contributing/inline-children.md b/contributing/inline-children.md index 08eaa38..480f451 100644 --- a/contributing/inline-children.md +++ b/contributing/inline-children.md @@ -48,7 +48,7 @@ Brooklyn supports a wide range of locations: Configuration can be set in `~/.brooklyn/brooklyn.properties` or directly in YAML when specifying a location. -On some entities, config keys determining maching selection and provisioning behavior -can also be set `in `provisioning.properties`. +On some entities, config keys determining matching selection and provisioning behavior +can also be set in `provisioning.properties`. { child_content } http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/24371929/guide/ops/locations/index.md -- diff --git a/guide/ops/locations/index.md b/guide/ops/locations/index.md index 8b74698..fbcf35f 100644 --- a/guide/ops/locations/index.md +++ b/guide/ops/locations/index.md @@ -20,7 +20,7 @@ Brooklyn supports a wide range of locations: Configuration can be set in `~/.brooklyn/brooklyn.properties`, through the location wizard tool available within the web console or directly in YAML when specifying a location. -On some entities, config keys determining maching selection and provisioning behavior -can also be set `in `provisioning.properties`. +On some entities, config keys determining matching selection and provisioning behavior +can also be set in `provisioning.properties`. {% child_content %}
[3/4] brooklyn-docs git commit: This closes #41
This closes #41 Corrected brooklyn references Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/10f49278 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/10f49278 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/10f49278 Branch: refs/heads/master Commit: 10f492785a3dfb37f53fb573c001b58f4eaa5a67 Parents: ffc3ee6 e70716e Author: Sam CorbettAuthored: Wed Apr 20 18:00:50 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 18:00:50 2016 +0100 -- guide/ops/locations/clouds.md | 2 +- guide/ops/persistence/index.md| 2 +- guide/start/running.md| 2 +- guide/yaml/chef/about-chef.md | 4 ++-- website/documentation/increase-entropy.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) --
[4/4] brooklyn-docs git commit: This closes #48
This closes #48 Typos Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/0de526b9 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/0de526b9 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/0de526b9 Branch: refs/heads/master Commit: 0de526b9db061241b741d7d118afa81564c802c8 Parents: 10f4927 2437192 Author: Sam CorbettAuthored: Wed Apr 20 18:00:55 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 18:00:55 2016 +0100 -- contributing/inline-children.md | 4 ++-- guide/ops/locations/index.md| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --
[1/4] brooklyn-docs git commit: Corrected brooklyn references
Repository: brooklyn-docs Updated Branches: refs/heads/master ffc3ee63d -> 0de526b9d Corrected brooklyn references Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/e70716eb Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/e70716eb Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/e70716eb Branch: refs/heads/master Commit: e70716eb8da0151ca80350ae15bf52589e095ee6 Parents: 6f8c37b Author: Duncan GodwinAuthored: Mon Apr 4 16:27:25 2016 +0100 Committer: Duncan Godwin Committed: Mon Apr 4 16:27:25 2016 +0100 -- guide/ops/locations/clouds.md | 2 +- guide/ops/persistence/index.md| 2 +- guide/start/running.md| 2 +- guide/yaml/chef/about-chef.md | 4 ++-- website/documentation/increase-entropy.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/ops/locations/clouds.md -- diff --git a/guide/ops/locations/clouds.md b/guide/ops/locations/clouds.md index 08109e0..89195fa 100644 --- a/guide/ops/locations/clouds.md +++ b/guide/ops/locations/clouds.md @@ -59,7 +59,7 @@ Brooklyn to use specific credentials for the initial login to a cloud-provisione (This custom login is particularly useful when using a custom image templates where the cloud-side account management logic is not enabled. For example, a vCloud (vCD) template can have guest customization that will change -the root password. This setting tells AMP to only use the given password, rather than the initial +the root password. This setting tells Apache Brooklyn to only use the given password, rather than the initial randomly generated password that vCD returns. Without this property, there is a race for such templates: does Brooklyn manage to create the admin user before the guest customization changes the login and reboots, or is the password reset first (the latter means Brooklyn can never ssh to the VM). With this property, http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/ops/persistence/index.md -- diff --git a/guide/ops/persistence/index.md b/guide/ops/persistence/index.md index 58b5915..30c3d5f 100644 --- a/guide/ops/persistence/index.md +++ b/guide/ops/persistence/index.md @@ -367,7 +367,7 @@ An example script to be invoked by CRON is shown below: BACKUP_FILENAME=/path/to/archives/back-${DATE}.tar.gz TEMP_DATA_DIR=/path/to/tempdir -amp copy-state \ +brooklyn copy-state \ --persistenceLocation named:my-persistence-location \ --persistenceDir /path/to/bucket \ --destinationDir $TEMP_DATA_DIR http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/start/running.md -- diff --git a/guide/start/running.md b/guide/start/running.md index 0518743..3464023 100644 --- a/guide/start/running.md +++ b/guide/start/running.md @@ -55,7 +55,7 @@ $ cd apache-brooklyn-{{site.brooklyn-version}}-vagrant For Centos 7 and RHEL 7 users, the recommended way to install Apache Brooklyn on RPM-based Linux distributions is by using the RPM package. -RPM is the de facto standard for packaging software on these Linux distributions and provides a mechanism for installing, upgrading and removing packages such as Apache Brooklyn. The AMP package contains all the necessary files associated with the Apache Brooklyn application. +RPM is the de facto standard for packaging software on these Linux distributions and provides a mechanism for installing, upgrading and removing packages such as Apache Brooklyn. The RPM package contains all the necessary files associated with the Apache Brooklyn application. Download the Apache Brooklyn [RPM distribution](https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{site.brooklyn-version}}-1.noarch.rpm){:target="_blank"}. http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/yaml/chef/about-chef.md -- diff --git a/guide/yaml/chef/about-chef.md b/guide/yaml/chef/about-chef.md index db3ec3c..8f87d07 100644 --- a/guide/yaml/chef/about-chef.md +++ b/guide/yaml/chef/about-chef.md @@ -38,13 +38,13 @@ the server. This is not the case - the bootstrap operation does not involve `kni itself to the server, passing on its configuration. This diagram summarises the interaction between Brooklyn, the new node, and the various Chef tools. Note that there -is no
[1/3] brooklyn-server git commit: Add catalog.bom application white/blacklists.
Repository: brooklyn-server Updated Branches: refs/heads/master fee7438f9 -> bc0362bac Add catalog.bom application white/blacklists. Any bundle with a catalog.bom file may specify applications to appear in the catalog (itemType: template). It is desirable to have a config time mechanism to control what bundles are allowed to present applications in the catalog and what aren't. This change adds a white/blacklist mechanism to the catalog.bom bundle scanning. Each list takes the form of a CSV whitelist of regexes to match against bundle symbolic ids. A bundle will be allowed to add an application (template) to the catalog if its bundle id matches one of the regexes on the whitelist, and also does not match one of the regexes on the blacklist. The configuration keys and default values for the lists are: brooklyn.catalog.osgi.application.whitelist=.* brooklyn.catalog.osgi.application.blacklist= (i.e. by default accept all bundles). these values are specified in the file org.apache.brooklyn.core.catalog.bomscanner.cfg Note that two 'default' example applications are supplied in the bom for brooklyn-software-base. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/7046ba59 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/7046ba59 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/7046ba59 Branch: refs/heads/master Commit: 7046ba59cefd7e82ffad3f97057b3646915d1f08 Parents: 06f68e1 Author: Geoff MacartneyAuthored: Thu Apr 7 09:34:54 2016 +0100 Committer: Geoff Macartney Committed: Thu Apr 14 16:59:30 2016 +0100 -- .../catalog/internal/CatalogBomScanner.java | 105 +--- core/src/main/resources/catalog.bom | 3 +- apache.brooklyn.core.catalog.bomscanner.cfg | 27 + .../resources/OSGI-INF/blueprint/blueprint.xml | 8 +- policy/src/main/resources/catalog.bom | 3 +- server-cli/src/main/resources/catalog.bom | 1 - software/base/src/main/resources/catalog.bom| 121 ++- test-framework/src/main/resources/catalog.bom | 3 +- .../entities/src/main/resources/catalog.bom | 5 +- .../src/main/resources/catalog.bom | 3 +- .../src/main/resources/catalog.bom | 3 +- .../src/main/resources/catalog.bom | 3 +- .../org/apache/brooklyn/util/text/Strings.java | 13 ++ 13 files changed, 263 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7046ba59/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java index 01d25f5..9c14d6d 100644 --- a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java +++ b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java @@ -21,12 +21,12 @@ package org.apache.brooklyn.core.catalog.internal; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import org.apache.brooklyn.api.catalog.BrooklynCatalog; import org.apache.brooklyn.api.catalog.CatalogItem; import org.apache.brooklyn.api.mgmt.ManagementContext; import org.apache.brooklyn.util.collections.MutableList; import org.apache.brooklyn.util.exceptions.Exceptions; import org.apache.brooklyn.util.stream.Streams; +import org.apache.brooklyn.util.text.Strings; import org.apache.brooklyn.util.yaml.Yamls; import org.osgi.framework.Bundle; import org.osgi.framework.BundleEvent; @@ -34,6 +34,7 @@ import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.BundleTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; import java.io.IOException; @@ -42,17 +43,26 @@ import java.net.URL; import java.util.List; import java.util.Map; +import static org.apache.brooklyn.api.catalog.CatalogItem.CatalogItemType.TEMPLATE; + public class CatalogBomScanner { +private final String ACCEPT_ALL_BY_DEFAULT = ".*"; + private static final Logger LOG = LoggerFactory.getLogger(CatalogBomScanner.class); private static final String CATALOG_BOM_URL = "catalog.bom"; private static final String BROOKLYN_CATALOG = "brooklyn.catalog"; private static final String BROOKLYN_LIBRARIES = "brooklyn.libraries"; +private List whiteList = ImmutableList.of(ACCEPT_ALL_BY_DEFAULT); +private List
[3/3] brooklyn-server git commit: Closes #106
Closes #106 Add catalog.bom application white/blacklists. Note this PR depends on https://github.com/apache/brooklyn-server/pull/100 and should be merged after it. It is desirable to have a config time mechanism to control what bundles are allowed to present applications in the catalog and what aren't. This change adds a white/blacklist mechanism to the catalog.bom bundle scanning. Each list takes the form of a CSV whitelist of regexes to match against bundle symbolic ids. A bundle will be allowed to add an application (template) to the catalog if its bundle id matches one of the regexes on the whitelist, and also does not match one of the regexes on the blacklist. The configuration keys and default values for the lists are: brooklyn.catalog.osgi.application.whitelist=.* brooklyn.catalog.osgi.application.blacklist= (i.e. by default accept all bundles). these values are specified in the file org.apache.brooklyn.core.catalog.bomscanner.cfg Note that two 'default' example applications are supplied in the bom for brooklyn-software-base. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/bc0362ba Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/bc0362ba Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/bc0362ba Branch: refs/heads/master Commit: bc0362bacd0724777aae3a2cda6f25b7ed2c4322 Parents: fee7438 3277583 Author: Svetoslav NeykovAuthored: Wed Apr 20 17:37:26 2016 +0100 Committer: Svetoslav Neykov Committed: Wed Apr 20 17:37:26 2016 +0100 -- .../catalog/internal/CatalogBomScanner.java | 107 ++-- core/src/main/resources/catalog.bom | 3 +- apache.brooklyn.core.catalog.bomscanner.cfg | 27 +++ .../resources/OSGI-INF/blueprint/blueprint.xml | 8 +- .../catalog/internal/CatalogBomScannerTest.java | 173 +++ policy/src/main/resources/catalog.bom | 3 +- server-cli/src/main/resources/catalog.bom | 1 - software/base/src/main/resources/catalog.bom| 121 - test-framework/src/main/resources/catalog.bom | 3 +- .../entities/src/main/resources/catalog.bom | 5 +- .../src/main/resources/catalog.bom | 3 +- .../src/main/resources/catalog.bom | 3 +- .../src/main/resources/catalog.bom | 3 +- .../org/apache/brooklyn/util/text/Strings.java | 21 +++ .../apache/brooklyn/util/text/StringsTest.java | 26 +++ 15 files changed, 472 insertions(+), 35 deletions(-) --
[2/3] brooklyn-server git commit: Add integration tests for CatalogBomScanner.
Add integration tests for CatalogBomScanner. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3277583f Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3277583f Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3277583f Branch: refs/heads/master Commit: 3277583f5e64722ffbfaee6f4eda7b5c7ffd357b Parents: 7046ba5 Author: Geoff MacartneyAuthored: Fri Apr 15 16:58:57 2016 +0100 Committer: Geoff Macartney Committed: Wed Apr 20 17:28:54 2016 +0100 -- .../catalog/internal/CatalogBomScanner.java | 10 +- .../catalog/internal/CatalogBomScannerTest.java | 173 +++ .../org/apache/brooklyn/util/text/Strings.java | 16 +- .../apache/brooklyn/util/text/StringsTest.java | 26 +++ 4 files changed, 217 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3277583f/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java index 9c14d6d..ae2885a 100644 --- a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java +++ b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java @@ -91,7 +91,7 @@ public class CatalogBomScanner { public void setWhiteList(String whiteListText) { LOG.debug("Setting whiteList to ", whiteListText); -this.whiteList = Strings.parseCsv(whiteListText, ","); +this.whiteList = Strings.parseCsv(whiteListText); } public List getBlackList() { @@ -104,7 +104,7 @@ public class CatalogBomScanner { public void setBlackList(String blackListText) { LOG.debug("Setting blackList to ", blackListText); -this.blackList = Strings.parseCsv(blackListText, ","); +this.blackList = Strings.parseCsv(blackListText); } public class CatalogPopulator extends BundleTracker > { @@ -170,7 +170,7 @@ public class CatalogBomScanner { } catch (Exception e) { Exceptions.propagateIfFatal(e); LOG.warn(Strings.join(new String[] { -"Failed to remove", item.getSymbolicName(), item.getVersion(), "{} {} from catalog" +"Failed to remove", item.getSymbolicName(), item.getVersion(), "from catalog" }, " "), e); } } @@ -200,7 +200,9 @@ public class CatalogBomScanner { return catalogItems; } -private Iterable> removeAnyApplications(Iterable> catalogItems) { +private Iterable> removeAnyApplications( +Iterable> catalogItems) { + List result = MutableList.of(); for (CatalogItem item: catalogItems) { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3277583f/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java -- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java new file mode 100644 index 000..137ede4 --- /dev/null +++ b/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java @@ -0,0 +1,173 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.brooklyn.core.catalog.internal; + +import org.apache.brooklyn.api.catalog.CatalogItem; +import org.apache.brooklyn.api.mgmt.ManagementContext; +import org.apache.brooklyn.core.BrooklynVersion; +import org.apache.brooklyn.test.Asserts; +import
[1/2] brooklyn-server git commit: BROOKLYN-257: allow nulling imageId in jcloudsLocation.obtain()
Repository: brooklyn-server Updated Branches: refs/heads/master d3cc05026 -> fee7438f9 BROOKLYN-257: allow nulling imageId in jcloudsLocation.obtain() Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d5a01b23 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d5a01b23 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d5a01b23 Branch: refs/heads/master Commit: d5a01b23ec38b7f6e3faba9b7b6ef45257113d55 Parents: d27d6c7 Author: Aled SageAuthored: Sat Apr 16 21:19:12 2016 +0100 Committer: Aled Sage Committed: Sat Apr 16 21:19:12 2016 +0100 -- .../location/jclouds/JcloudsLocation.java | 8 +- .../jclouds/AbstractJcloudsStubbedLiveTest.java | 12 ++- .../JcloudsImageChoiceStubbedLiveTest.java | 83 3 files changed, 99 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d5a01b23/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java -- diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java index 14c5cfb..814df27 100644 --- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java +++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java @@ -1146,11 +1146,15 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im }}) .put(HARDWARE_ID, new CustomizeTemplateBuilder() { public void apply(TemplateBuilder tb, ConfigBag props, Object v) { -tb.hardwareId(((CharSequence)v).toString()); +if (v != null) { +tb.hardwareId(((CharSequence)v).toString()); +} }}) .put(IMAGE_ID, new CustomizeTemplateBuilder() { public void apply(TemplateBuilder tb, ConfigBag props, Object v) { -tb.imageId(((CharSequence)v).toString()); +if (v != null) { +tb.imageId(((CharSequence)v).toString()); +} }}) .put(IMAGE_DESCRIPTION_REGEX, new CustomizeTemplateBuilder() { public void apply(TemplateBuilder tb, ConfigBag props, Object v) { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d5a01b23/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/AbstractJcloudsStubbedLiveTest.java -- diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/AbstractJcloudsStubbedLiveTest.java b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/AbstractJcloudsStubbedLiveTest.java index 472dbf3..cb2334a 100644 --- a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/AbstractJcloudsStubbedLiveTest.java +++ b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/AbstractJcloudsStubbedLiveTest.java @@ -19,6 +19,7 @@ package org.apache.brooklyn.location.jclouds; import java.util.List; +import java.util.Map; import java.util.Set; import org.apache.brooklyn.util.core.config.ConfigBag; @@ -115,9 +116,16 @@ public abstract class AbstractJcloudsStubbedLiveTest extends AbstractJcloudsLive }; jcloudsLocation = (JcloudsLocation) managementContext.getLocationRegistry().getLocationManaged( LOCATION_SPEC, -ImmutableMap.of( +jcloudsLocationConfig(ImmutableMap.
[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.Entryentry : 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 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 Authored: Wed Apr 20 17:29:40 2016 +0100 Committer: Svetoslav Neykov 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(-) --
[1/2] brooklyn-server git commit: Fix NPE in forcePersistNow
Repository: brooklyn-server Updated Branches: refs/heads/master 3ad955999 -> d3cc05026 Fix NPE in forcePersistNow Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8163d02b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8163d02b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8163d02b Branch: refs/heads/master Commit: 8163d02b02c48a3449891480c8f203fef606bb83 Parents: 9fb4193 Author: Andrew Donald KennedyAuthored: Wed Apr 20 10:00:50 2016 +0100 Committer: Andrew Donald Kennedy Committed: Wed Apr 20 11:31:37 2016 +0100 -- .../brooklyn/core/mgmt/rebind/RebindManagerImpl.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8163d02b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java index 5525981..48365d4 100644 --- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java +++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java @@ -435,17 +435,23 @@ public class RebindManagerImpl implements RebindManager { persistenceRealChangeListener.waitForPendingComplete(timeout, canTrigger); persistenceStoreAccess.waitForWritesCompleted(timeout); } + @Override @VisibleForTesting public void forcePersistNow() { forcePersistNow(false, null); } + @Override @VisibleForTesting public void forcePersistNow(boolean full, PersistenceExceptionHandler exceptionHandler) { +if (persistenceStoreAccess == null || persistenceRealChangeListener == null) { +LOG.info("Skipping forced persist; no persistence mechanism available"); +return; +} if (full) { BrooklynMementoRawData memento = BrooklynPersistenceUtils.newStateMemento(managementContext, MementoCopyMode.LOCAL); -if (exceptionHandler==null) { +if (exceptionHandler == null) { exceptionHandler = persistenceRealChangeListener.getExceptionHandler(); } persistenceStoreAccess.checkpoint(memento, exceptionHandler); @@ -455,7 +461,7 @@ public class RebindManagerImpl implements RebindManager { } } } - + @Override public ChangeListener getChangeListener() { return persistencePublicChangeListener;
[2/2] brooklyn-server git commit: Closes #113
Closes #113 Fix NPE in forcePersistNow Fixes issue where `forcePeristNow()` fails due to `persistenceRealChangeListener` being null Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d3cc0502 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d3cc0502 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d3cc0502 Branch: refs/heads/master Commit: d3cc0502611c225732d15898c4db753e7de2d719 Parents: 3ad9559 8163d02 Author: Svetoslav NeykovAuthored: Wed Apr 20 17:03:02 2016 +0100 Committer: Svetoslav Neykov Committed: Wed Apr 20 17:03:02 2016 +0100 -- .../brooklyn/core/mgmt/rebind/RebindManagerImpl.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) --
[2/2] brooklyn-server git commit: Closes #111
Closes #111 pull displayName from flags in LocationTransformer if present - fixes BROOKLYN-250 Untyped config from the YAML is being pushed into flags rather than config, so rather than expose flags in the locations API (which we're moving away from to the catalog API), I'm now checking for the presence of a displayName parameter in flags and setting it in the LocationTransformer. Tests added. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3ad95599 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3ad95599 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3ad95599 Branch: refs/heads/master Commit: 3ad9559991b80070548b0e3d991da71e0ab5f9e1 Parents: 5472c1e 049c852 Author: Svetoslav NeykovAuthored: Wed Apr 20 16:58:24 2016 +0100 Committer: Svetoslav Neykov Committed: Wed Apr 20 16:58:24 2016 +0100 -- .../rest/transform/LocationTransformer.java | 8 +- .../rest/resources/LocationResourceTest.java| 114 +++ 2 files changed, 120 insertions(+), 2 deletions(-) --
[1/2] brooklyn-server git commit: Deprecate BashCommands.ifExecutableElse(String, List, List) misleading name
Repository: brooklyn-server Updated Branches: refs/heads/master fad6e99b9 -> 5472c1e8d Deprecate BashCommands.ifExecutableElse(String, List, List) misleading name Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/ffa29816 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/ffa29816 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/ffa29816 Branch: refs/heads/master Commit: ffa29816480ab6e386d62020931b7a639c4c7d4e Parents: a9f9df4 Author: Valentin AitkenAuthored: Sun Apr 10 23:48:42 2016 +0300 Committer: Valentin Aitken Committed: Wed Apr 13 16:19:55 2016 +0300 -- .../apache/brooklyn/util/ssh/BashCommands.java | 26 1 file changed, 21 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ffa29816/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java index f73ebc2..e4388a7 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/BashCommands.java @@ -235,17 +235,33 @@ public class BashCommands { return alternativesGroup(format("which %s", executable), command); } -public static String ifExecutableElse(String command, String ifTrue, String otherwise) { +/** + * @deprecated As of release 0.10.0, replaced by {@link #ifExecutableDoesNotExistElse(String, String, String)} + */ +@Deprecated +public static String ifExecutableElse(String command, String ifNotExist, String ifExist) { +return ifExecutableDoesNotExistElse(command, ifNotExist, ifExist); +} + +public static String ifExecutableDoesNotExistElse(String command, String ifNotExist, String ifExist) { return com.google.common.base.Joiner.on('\n').join( -ifExecutableElse(command, ImmutableList.of(ifTrue), ImmutableList.of(otherwise))); +ifExecutableDoesNotExistElse(command, ImmutableList.of(ifNotExist), ImmutableList.of(ifExist))); +} + +/** + * @deprecated As of release 0.10.0, replaced by {@link #ifExecutableDoesNotExistElse(String, List, List)} + */ +@Deprecated +public static ImmutableList ifExecutableElse(String command, List ifNotExist, List ifExist) { +return ifExecutableDoesNotExistElse(command, ifNotExist, ifExist); } -public static ImmutableList ifExecutableElse(String command, List ifTrue, List otherwise) { +public static ImmutableList ifExecutableDoesNotExistElse(String command, List ifNotExist, List ifExist) { return ImmutableList.builder() .add(String.format("if test -z `which %s`; then", command)) -.addAll(ifTrue) +.addAll(ifNotExist) .add("else") -.addAll(otherwise) +.addAll(ifExist) .add("fi") .build(); }
[1/2] brooklyn-server git commit: fixes BROOKLYN-250 - config is being pushed into flags, so rather than expose flags in the locations API (which we're moving away from to the catalog API), I'm now ch
Repository: brooklyn-server Updated Branches: refs/heads/master 5472c1e8d -> 3ad955999 fixes BROOKLYN-250 - config is being pushed into flags, so rather than expose flags in the locations API (which we're moving away from to the catalog API), I'm now checking for the presence of a displayName parameter in flags and setting it in the LocationTransformer. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/049c852e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/049c852e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/049c852e Branch: refs/heads/master Commit: 049c852ed0f48435836a061bf3f3745cdd850f8f Parents: d27d6c7 Author: John McCabeAuthored: Mon Apr 11 12:24:45 2016 +0100 Committer: John McCabe Committed: Mon Apr 11 12:24:45 2016 +0100 -- .../rest/transform/LocationTransformer.java | 8 +- .../rest/resources/LocationResourceTest.java| 114 +++ 2 files changed, 120 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/049c852e/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java -- diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java index 3777901..a9ae1d3 100644 --- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java +++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java @@ -74,8 +74,12 @@ public class LocationTransformer { config = ConfigBag.newInstance(spec.getConfig()).putAll(config).getAllConfig(); } else if (level==LocationDetailLevel.LOCAL_EXCLUDING_SECRET) { // in local mode, just make sure display name is set -if (spec!=null && !explicitConfig.containsKey(LocationConfigKeys.DISPLAY_NAME) && Strings.isNonBlank(spec.getDisplayName())) { -config.put(LocationConfigKeys.DISPLAY_NAME.getName(), spec.getDisplayName()); +if (spec!=null && !explicitConfig.containsKey(LocationConfigKeys.DISPLAY_NAME) ) { +if (Strings.isNonBlank((String) spec.getFlags().get(LocationConfigKeys.DISPLAY_NAME.getName({ +config.put(LocationConfigKeys.DISPLAY_NAME.getName(), spec.getFlags().get(LocationConfigKeys.DISPLAY_NAME.getName())); +} else if ( Strings.isNonBlank(spec.getDisplayName()) ) { +config.put(LocationConfigKeys.DISPLAY_NAME.getName(), spec.getDisplayName()); +} } } http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/049c852e/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java -- diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java index 78aa1e2..2a00215 100644 --- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java +++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/LocationResourceTest.java @@ -29,6 +29,8 @@ import javax.annotation.Nullable; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import org.apache.brooklyn.core.location.LocationConfigKeys; +import org.apache.brooklyn.location.byon.FixedListMachineProvisioningLocation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; @@ -62,6 +64,10 @@ public class LocationResourceTest extends BrooklynRestResourceTest { private String locationName = "my-jungle"; private String locationVersion = "0.1.2"; +private String configDisplayName = "config_displayName"; +private String testsDisplayName = "tests_displayName"; +private String byonHostname = "10.10.10.102"; + @Test @Deprecated public void testAddLegacyLocationDefinition() { @@ -187,4 +193,112 @@ public class LocationResourceTest extends BrooklynRestResourceTest { } }); } + + +@SuppressWarnings("deprecation") +@Test +public void testDisplayNameInConfig() { +String symbolicName = "test_config_displayName_id"; +String yaml = Joiner.on("\n").join(ImmutableList.of( +"brooklyn.catalog:", +" version: " + locationVersion, +" items:", +" - id: " +
[1/2] brooklyn-server git commit: Use minimal management context in AbstractYamlTest
Repository: brooklyn-server Updated Branches: refs/heads/master 9fb41938f -> fad6e99b9 Use minimal management context in AbstractYamlTest Speeds tests up a lot. Subclasses can enable OSGi by overriding disableOsgi. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/17be7217 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/17be7217 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/17be7217 Branch: refs/heads/master Commit: 17be721706e0e469360486f06e225935cb011fa6 Parents: 3b746e3 Author: Sam CorbettAuthored: Wed Apr 20 16:21:32 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 16:21:32 2016 +0100 -- .../camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java | 2 +- .../org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java | 8 ++-- .../apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java| 7 ++- .../brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java | 7 ++- .../brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java | 8 .../camp/brooklyn/catalog/CatalogYamlEntityTest.java | 5 + .../camp/brooklyn/catalog/CatalogYamlLocationTest.java | 5 + .../camp/brooklyn/catalog/CatalogYamlPolicyTest.java | 5 + .../camp/brooklyn/catalog/CatalogYamlTemplateTest.java | 5 + .../camp/brooklyn/catalog/SpecParameterParsingTest.java | 7 ++- 10 files changed, 45 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/17be7217/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java -- diff --git a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java index 921615e..1fd0580 100644 --- a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java +++ b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java @@ -46,7 +46,7 @@ public abstract class BrooklynCampPlatformLauncherAbstract { if (getBrooklynMgmt()==null) useManagementContext(newMgmtContext()); - + platform = new BrooklynCampPlatform( PlatformRootSummary.builder().name("Brooklyn CAMP Platform").build(), getBrooklynMgmt()) http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/17be7217/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java -- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java index 4478f2b..ede7812 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java @@ -81,8 +81,12 @@ public abstract class AbstractYamlTest { } protected LocalManagementContext newTestManagementContext() { -// TODO they don't all need osgi, just a few do, so could speed it up by specifying when they do -return LocalManagementContextForTests.newInstanceWithOsgi(); +return LocalManagementContextForTests.builder(true).disableOsgi(disableOsgi()).build(); +} + +/** Override to enable OSGi in the management context for all tests in the class. */ +protected boolean disableOsgi() { +return true; } @AfterMethod(alwaysRun = true) http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/17be7217/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java -- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java index bb0ea90..d05da3e 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java @@ -31,7 +31,12 @@ import org.testng.annotations.Test; import com.google.common.collect.Iterables; public class ReferencedYamlTest extends AbstractYamlTest { - + +@Override +protected boolean disableOsgi() { +return
[2/2] brooklyn-server git commit: Closes #109
Closes #109 Deprecate BashCommands.ifExecutableElse(String, List, List) Deprecate `BashCommands.ifExecutableElse(String, List, List)` misleading name. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/5472c1e8 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/5472c1e8 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/5472c1e8 Branch: refs/heads/master Commit: 5472c1e8df0c257e0ef4d7093db48b2a43a2ad81 Parents: fad6e99 ffa2981 Author: Svetoslav NeykovAuthored: Wed Apr 20 16:44:10 2016 +0100 Committer: Svetoslav Neykov Committed: Wed Apr 20 16:44:10 2016 +0100 -- .../apache/brooklyn/util/ssh/BashCommands.java | 26 1 file changed, 21 insertions(+), 5 deletions(-) --
[2/2] brooklyn-server git commit: Closes #118
Closes #118 Use minimal management context in AbstractYamlTest Speeds tests up a lot. Subclasses can enable OSGi by overriding `disableOsgi`. Build of `camp-brooklyn` took 2:38 before and 1:40 afterwards on my relatively snappy laptop. The improvement should be more noticeable in Jenkins builds. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/fad6e99b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/fad6e99b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/fad6e99b Branch: refs/heads/master Commit: fad6e99b9823ff3d5eaa98ff96493e2e71413cd8 Parents: 9fb4193 17be721 Author: Svetoslav NeykovAuthored: Wed Apr 20 16:40:46 2016 +0100 Committer: Svetoslav Neykov Committed: Wed Apr 20 16:40:46 2016 +0100 -- .../camp/brooklyn/BrooklynCampPlatformLauncherAbstract.java | 2 +- .../org/apache/brooklyn/camp/brooklyn/AbstractYamlTest.java | 8 ++-- .../apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java| 7 ++- .../brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java | 7 ++- .../brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java | 8 .../camp/brooklyn/catalog/CatalogYamlEntityTest.java | 5 + .../camp/brooklyn/catalog/CatalogYamlLocationTest.java | 5 + .../camp/brooklyn/catalog/CatalogYamlPolicyTest.java | 5 + .../camp/brooklyn/catalog/CatalogYamlTemplateTest.java | 5 + .../camp/brooklyn/catalog/SpecParameterParsingTest.java | 7 ++- 10 files changed, 45 insertions(+), 14 deletions(-) --
[4/5] brooklyn-docs git commit: Fixes handling of undefined values in templates
Fixes handling of undefined values in templates Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/80d64295 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/80d64295 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/80d64295 Branch: refs/heads/0.9.0 Commit: 80d642950817f566ac233383d37ebaed4cf17a0f Parents: f2cf3a1 Author: Sam CorbettAuthored: Wed Apr 13 12:37:43 2016 +0100 Committer: Richard Downer Committed: Mon Apr 18 16:04:58 2016 +0100 -- style/js/catalog/common.js | 14 +++--- website/learnmore/catalog/catalog-item.html | 13 + 2 files changed, 16 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/80d64295/style/js/catalog/common.js -- diff --git a/style/js/catalog/common.js b/style/js/catalog/common.js index 4fc5248..c2a2cd3 100644 --- a/style/js/catalog/common.js +++ b/style/js/catalog/common.js @@ -74,9 +74,9 @@ var brooklyn = (function ($, _) { "" + "<%=name%>" + "" + -"description<%=(description||'')%>" + -"value type<%=(type||'')%>" + -"default value<%=(defaultValue||'')%>" + +"description<% if (typeof description !== 'undefined') { %><%= description %><% } else { %><% } %>" + +"value type<% if (typeof type !== 'undefined') { %><%= type %><% } else { %><% } %>" + +"default value<% if (typeof defaultValue !== 'undefined') { %><%= defaultValue %><% } else { %><% } %>" + "" + "" ), @@ -84,8 +84,8 @@ var brooklyn = (function ($, _) { "" + "<%=name%>" + "" + -"description<%=(description||'')%>" + -"value type<%=(type||'')%>" + +"description<% if (typeof description !== 'undefined') { %><%= description %><% } else { %><% } %>" + +"value type<% if (typeof type !== 'undefined') { %><%= type %><% } else { %><% } %>" + "" + "" ), @@ -93,8 +93,8 @@ var brooklyn = (function ($, _) { "" + "<%=name%>" + "" + -"description<%=(description||'')%>" + -"return type<%=(returnType||'')%>" + +"description<% if (typeof description !== 'undefined') { %><%= description %><% } else { %><% } %>" + +"return type<% if (typeof returnType !== 'undefined') { %><%= returnType %><% } else { %><% } %>" + "" + "" ) http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/80d64295/website/learnmore/catalog/catalog-item.html -- diff --git a/website/learnmore/catalog/catalog-item.html b/website/learnmore/catalog/catalog-item.html index f0e0108..0d9f1b5 100644 --- a/website/learnmore/catalog/catalog-item.html +++ b/website/learnmore/catalog/catalog-item.html @@ -90,15 +90,20 @@ under the License. document.title = 'Brooklyn ' + catalog_type + ' - ' + item.name; - item.config.forEach(function (element) { $("#configKeys").append(brooklyn.configKeyCard(element)); }); + item.config.forEach(function (element) { +$("#configKeys").append(brooklyn.configKeyCard(element)); + }); if(args[0] == 'entities') { $("#sensorsTab").show(); $("#effectorsTab").show(); - -item.sensors.forEach(function (element) { $("#sensors").append(brooklyn.sensorCard(element)); }); +item.sensors.forEach(function (element) { + $("#sensors").append(brooklyn.sensorCard(element)); +}); if (item.effectors != undefined) { - item.effectors.forEach(function (element) { $("#effectors").append(brooklyn.effectorCard(element)); }); + item.effectors.forEach(function (element) { +$("#effectors").append(brooklyn.effectorCard(element)); + }); } } else {
[5/5] brooklyn-docs git commit: Fix child page inclusion on publish build
Fix child page inclusion on publish build When building the website the child page inclusions did not work due to path confusion. This commit fixes it. Reviewed by Duncan Godwin. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/e7ef6802 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/e7ef6802 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/e7ef6802 Branch: refs/heads/0.9.0 Commit: e7ef6802a3b1e154f20e4f912cdbd2dd94608a66 Parents: 80d6429 Author: Richard DownerAuthored: Wed Apr 20 16:13:07 2016 +0100 Committer: Richard Downer Committed: Wed Apr 20 16:13:07 2016 +0100 -- _plugins/page_structure.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e7ef6802/_plugins/page_structure.rb -- diff --git a/_plugins/page_structure.rb b/_plugins/page_structure.rb index b1697bd..cb81c93 100644 --- a/_plugins/page_structure.rb +++ b/_plugins/page_structure.rb @@ -7,6 +7,7 @@ require 'rubygems' require 'yaml' require "kramdown" +require 'pathname' module PageStructureUtils @@ -105,7 +106,7 @@ module PageStructureUtils # def self.parseChildYAMLFromParent(page) # get the base directory of the current file - $baseFile = Dir.pwd+page['dir'] + $baseFile = Dir.pwd+"/"+(Pathname(page['path']).dirname.to_s) # list all of the files in that directory $listings = Dir[$baseFile+"/*.md"] $allPages = [] @@ -143,7 +144,7 @@ module PageStructureUtils # def self.parseChildPagesFromParent(page) # get the base directory of the current file - $baseFile = Dir.pwd+page['dir'] + $baseFile = Dir.pwd+"/"+(Pathname(page['path']).dirname.to_s) # list all of the files in that directory $listings = Dir[$baseFile+"/*"] # filter by the key pattern
[2/5] brooklyn-docs git commit: Fix download page in user guide
Fix download page in user guide Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/667b9725 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/667b9725 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/667b9725 Branch: refs/heads/0.9.0 Commit: 667b9725b13929c4796a345cdeaedf8e55cd63c1 Parents: 78f6237 Author: Richard DownerAuthored: Wed Apr 13 08:13:18 2016 +0100 Committer: Richard Downer Committed: Wed Apr 13 08:13:18 2016 +0100 -- _includes/fields.md | 9 --- _plugins/brooklyn_metadata.rb | 4 +- guide/misc/download.md| 114 - 3 files changed, 64 insertions(+), 63 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/667b9725/_includes/fields.md -- diff --git a/_includes/fields.md b/_includes/fields.md index d9e74b7..9d05d8d 100644 --- a/_includes/fields.md +++ b/_includes/fields.md @@ -17,15 +17,6 @@ {% capture this_repo_base_url_content %}{% if SNAPSHOT %}{{ apache_snapshots_repo_groupid_url }}{% else %}{{ apache_releases_repo_groupid_url }}{% endif %}{% endcapture %} {% capture this_dist_url_list %}{{ this_repo_base_url_content }}/brooklyn-dist/{{ site.brooklyn-version }}/{% endcapture %} -{% if SNAPSHOT %} - - {% capture this_dist_url_zip %}{{ this_repo_base_url_artifact }}?r=snapshots={{ brooklyn_group_id }}=brooklyn-dist={{ site.brooklyn-version }}=dist=zip{% endcapture %} - {% capture this_dist_url_tgz %}{{ this_repo_base_url_artifact }}?r=snapshots={{ brooklyn_group_id }}=brooklyn-dist={{ site.brooklyn-version }}=dist=tar.gz{% endcapture %} -{% else %} - {% capture this_dist_url_zip %}{{ this_dist_url_list }}/brooklyn-dist-{{ site.brooklyn-version }}-dist.zip{% endcapture %} - {% capture this_dist_url_tgz %}{{ this_dist_url_list }}/brooklyn-dist-{{ site.brooklyn-version }}-dist.tar.gz{% endcapture %} -{% endif %} - {% capture this_anything_url_search %}{{ this_repo_base_url_search }};gav~{{ brooklyn_group_id }}~~{{ site.brooklyn-version }}~~{% endcapture %} {% capture this_dist_url_search %}{{ this_repo_base_url_search }};gav~{{ brooklyn_group_id }}~brooklyn-dist~{{ site.brooklyn-version }}~~{% endcapture %} http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/667b9725/_plugins/brooklyn_metadata.rb -- diff --git a/_plugins/brooklyn_metadata.rb b/_plugins/brooklyn_metadata.rb index b2e94bd..ebe4234 100644 --- a/_plugins/brooklyn_metadata.rb +++ b/_plugins/brooklyn_metadata.rb @@ -51,7 +51,9 @@ module BrooklynMetadata "is_snapshot" => is_snapshot, "is_release" => !is_snapshot, "url" => url_set, - "git_branch" => git_branch + "git_branch" => git_branch, + "download_prefix" => "https://www.apache.org/dyn/closer.lua?action=download=brooklyn/apache-brooklyn-#{ site.config['brooklyn-stable-version'] }/apache-brooklyn-#{ site.config['brooklyn-stable-version'] }", + "hash_download_prefix" => "https://dist.apache.org/repos/dist/release/brooklyn/apache-brooklyn-#{ site.config['brooklyn-stable-version'] }/apache-brooklyn-#{ site.config['brooklyn-stable-version'] }" } # config is preferred of data, because you can write just {{ site.brooklyn.xxx }}, http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/667b9725/guide/misc/download.md -- diff --git a/guide/misc/download.md b/guide/misc/download.md index d154802..8417aa6 100644 --- a/guide/misc/download.md +++ b/guide/misc/download.md @@ -19,56 +19,78 @@ The latest stable release can be accessed on the [main download page]({{ site.pa checksums (?) - Distro - brooklyn-dist-{{ site.brooklyn-version }}-dist.zip + Binary distributionServer client + apache-brooklyn-{{ site.brooklyn-version }}-bin.tar.gz + + {% if site.brooklyn.is_release %}PGP, {% endif %} + SHA1 + + + apache-brooklyn-{{ site.brooklyn-version }}-bin.zip + + {% if site.brooklyn.is_release %}PGP, {% endif %} + SHA1 + + + RPM packageCentOS7, RHEL7, etc. + apache-brooklyn-{{ site.brooklyn-version }}-1.noarch.rpm + + {% if site.brooklyn.is_release %}PGP, {% endif %} + SHA1 + + + Client CLI only + apache-brooklyn-{{ site.brooklyn-version }}-client-cli-linux.tar.gz + + {% if site.brooklyn.is_release %}PGP, {% endif %} + SHA1 + + + apache-brooklyn-{{ site.brooklyn-version }}-client-cli-linux.zip + + {% if
svn commit: r1740156 [1/4] - in /brooklyn/site/v: 0.9.0/ops/locations/ 0.9.0/style/js/catalog/ latest/ops/locations/ latest/style/js/catalog/
Author: richard Date: Wed Apr 20 15:19:21 2016 New Revision: 1740156 URL: http://svn.apache.org/viewvc?rev=1740156=rev Log: Update Brooklyn website userguide to git branch 0.9.0 latest Modified: brooklyn/site/v/0.9.0/ops/locations/index.html brooklyn/site/v/0.9.0/ops/locations/location-customizers.html brooklyn/site/v/0.9.0/style/js/catalog/items.js brooklyn/site/v/latest/ops/locations/index.html brooklyn/site/v/latest/ops/locations/location-customizers.html brooklyn/site/v/latest/style/js/catalog/items.js Modified: brooklyn/site/v/0.9.0/ops/locations/index.html URL: http://svn.apache.org/viewvc/brooklyn/site/v/0.9.0/ops/locations/index.html?rev=1740156=1740155=1740156=diff == --- brooklyn/site/v/0.9.0/ops/locations/index.html (original) +++ brooklyn/site/v/0.9.0/ops/locations/index.html Wed Apr 20 15:19:21 2016 @@ -395,6 +395,895 @@ or directly in YAML when specifying a lo On some entities, config keys determining maching selection and provisioning behavior can also be set in provisioning.properties`. +Clouds + +For most cloud provisioning tasks, Brooklyn uses +http://jclouds.org;>Apache jclouds. +The identifiers for some of the most commonly used jclouds-supported clouds are +(or http://jclouds.apache.org/reference/providers/;>see the full list): + + + jclouds:aws-ec2:region: Amazon EC2, where :region might be us-east-1 or eu-west-1 (or omitted) + jclouds:softlayer:region: IBM Softlayer, where :region might be dal05 or ams01 (or omitted) + jclouds:google-compute-engine: Google Compute Engine + jclouds:openstack-nova:endpoint: OpenStack, where :endpoint is the access URL (required) + jclouds:cloudstack:endpoint: Apache CloudStack, where :endpoint is the access URL (required) + + +For any of these, of course, Brooklyn needs to be configured with an identity and a credential: + +location: + jclouds:aws-ec2: +identity: ABCDEFGHIJKLMNOPQRST +credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l + +The above YAML can be embedded directly in blueprints, either at the root or on individual services. +If you prefer to keep the credentials separate, you can instead store them as a catalog entry or set them in brooklyn.properties +in the jclouds.provider namespace: + +brooklyn.location.jclouds.aws-ec2.identity=ABCDEFGHIJKLMNOPQRST +brooklyn.location.jclouds.aws-ec2.credential=s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l + +And in this case you can reference the location in YAML with location: jclouds:aws-ec2. + +Alternatively, you can use the location wizard tool available within the web console +to create any cloud location supported by http://jclouds.org;>Apache jclouds. +This location will be saved as a catalog entry for easy reusability. + +Brooklyn irons out many of the differences between clouds so that blueprints run similarly +in a wide range of locations, including setting up access and configuring images and machine specs. +The configuration options are described in more detail below. + +In some cases, cloud providers have special features or unusual requirements. +These are outlined in More Details for Specific Clouds. + +OS Initial Login and Setup + +Once a machine is provisioned, Brooklyn will normally attempt to log in via SSH and configure the machine sensibly. + +The credentials for the initial OS log on are typically discovered from the cloud, +but in some environments this is not possible. +The keys loginUser and either loginUser.password or loginUser.privateKeyFile can be used to force +Brooklyn to use specific credentials for the initial login to a cloud-provisioned machine. + +(This custom login is particularly useful when using a custom image templates where the cloud-side account +management logic is not enabled. For example, a vCloud (vCD) template can have guest customization that will change +the root password. This setting tells AMP to only use the given password, rather than the initial +randomly generated password that vCD returns. Without this property, there is a race for such templates: +does Brooklyn manage to create the admin user before the guest customization changes the login and reboots, +or is the password reset first (the latter means Brooklyn can never ssh to the VM). With this property, +Brooklyn will always wait for guest customization to complete before it is able to ssh at all. In such +cases, it is also recommended to use useJcloudsSshInit=false.) + +Following a successful logon, Brooklyn performs the following steps to configure the machine: + + + +creates a new user with the same name as the user brooklyn is running as locally + (this can be overridden with user, below). + + +install the local userâs ~/.ssh/id_rsa.pub as an authorized_keys on the new machine, +to make it easy for the operator to ssh in +(override with privateKeyFile; or if there is no id_{r,d}sa{,.pub} an ad hoc keypair will
svn commit: r1740156 [3/4] - in /brooklyn/site/v: 0.9.0/ops/locations/ 0.9.0/style/js/catalog/ latest/ops/locations/ latest/style/js/catalog/
Modified: brooklyn/site/v/latest/ops/locations/index.html URL: http://svn.apache.org/viewvc/brooklyn/site/v/latest/ops/locations/index.html?rev=1740156=1740155=1740156=diff == --- brooklyn/site/v/latest/ops/locations/index.html (original) +++ brooklyn/site/v/latest/ops/locations/index.html Wed Apr 20 15:19:21 2016 @@ -395,6 +395,895 @@ or directly in YAML when specifying a lo On some entities, config keys determining maching selection and provisioning behavior can also be set in provisioning.properties`. +Clouds + +For most cloud provisioning tasks, Brooklyn uses +http://jclouds.org;>Apache jclouds. +The identifiers for some of the most commonly used jclouds-supported clouds are +(or http://jclouds.apache.org/reference/providers/;>see the full list): + + + jclouds:aws-ec2:region: Amazon EC2, where :region might be us-east-1 or eu-west-1 (or omitted) + jclouds:softlayer:region: IBM Softlayer, where :region might be dal05 or ams01 (or omitted) + jclouds:google-compute-engine: Google Compute Engine + jclouds:openstack-nova:endpoint: OpenStack, where :endpoint is the access URL (required) + jclouds:cloudstack:endpoint: Apache CloudStack, where :endpoint is the access URL (required) + + +For any of these, of course, Brooklyn needs to be configured with an identity and a credential: + +location: + jclouds:aws-ec2: +identity: ABCDEFGHIJKLMNOPQRST +credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l + +The above YAML can be embedded directly in blueprints, either at the root or on individual services. +If you prefer to keep the credentials separate, you can instead store them as a catalog entry or set them in brooklyn.properties +in the jclouds.provider namespace: + +brooklyn.location.jclouds.aws-ec2.identity=ABCDEFGHIJKLMNOPQRST +brooklyn.location.jclouds.aws-ec2.credential=s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l + +And in this case you can reference the location in YAML with location: jclouds:aws-ec2. + +Alternatively, you can use the location wizard tool available within the web console +to create any cloud location supported by http://jclouds.org;>Apache jclouds. +This location will be saved as a catalog entry for easy reusability. + +Brooklyn irons out many of the differences between clouds so that blueprints run similarly +in a wide range of locations, including setting up access and configuring images and machine specs. +The configuration options are described in more detail below. + +In some cases, cloud providers have special features or unusual requirements. +These are outlined in More Details for Specific Clouds. + +OS Initial Login and Setup + +Once a machine is provisioned, Brooklyn will normally attempt to log in via SSH and configure the machine sensibly. + +The credentials for the initial OS log on are typically discovered from the cloud, +but in some environments this is not possible. +The keys loginUser and either loginUser.password or loginUser.privateKeyFile can be used to force +Brooklyn to use specific credentials for the initial login to a cloud-provisioned machine. + +(This custom login is particularly useful when using a custom image templates where the cloud-side account +management logic is not enabled. For example, a vCloud (vCD) template can have guest customization that will change +the root password. This setting tells AMP to only use the given password, rather than the initial +randomly generated password that vCD returns. Without this property, there is a race for such templates: +does Brooklyn manage to create the admin user before the guest customization changes the login and reboots, +or is the password reset first (the latter means Brooklyn can never ssh to the VM). With this property, +Brooklyn will always wait for guest customization to complete before it is able to ssh at all. In such +cases, it is also recommended to use useJcloudsSshInit=false.) + +Following a successful logon, Brooklyn performs the following steps to configure the machine: + + + +creates a new user with the same name as the user brooklyn is running as locally + (this can be overridden with user, below). + + +install the local userâs ~/.ssh/id_rsa.pub as an authorized_keys on the new machine, +to make it easy for the operator to ssh in +(override with privateKeyFile; or if there is no id_{r,d}sa{,.pub} an ad hoc keypair will be generated +for the regular Brooklyn user; +if there is a passphrase on the key, this must be supplied) + + +give sudo access to the newly created user (override with grantUserSudo: false) + + +disable direct root login to the machine + + + +These steps can be skipped or customized as described below. + +jclouds Config Keys + +The following is a subset of the most commonly used configuration keys used to customize +cloud provisioning. +For more keys and more detail on the keys below, see
[2/3] brooklyn-client git commit: Update recommended version of Go to 1.6.1 due to security issue.
Update recommended version of Go to 1.6.1 due to security issue. See https://groups.google.com/forum/m/#!msg/golang-announce/9eqIHqaWvck/kXsfO0ogLAAJ. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/39af934b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/39af934b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/39af934b Branch: refs/heads/master Commit: 39af934bf9365dfe479ea9a9ea511c9d96721afa Parents: 49fdb46 Author: Geoff MacartneyAuthored: Wed Apr 13 09:16:16 2016 +0100 Committer: Geoff Macartney Committed: Wed Apr 13 09:24:02 2016 +0100 -- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/39af934b/README.md -- diff --git a/README.md b/README.md index a0766d6..7d5cc7b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A command line client for [Apache Brooklyn](https://brooklyn.apache.org). The CLI tool is written in Go and should be obtained and built as a standard Go project. You will need the following tools to build it: -- Go (min version 1.6), with full cross-compiler support (see https://golang.org/dl). +- Go (version 1.6.1 or higher), with full cross-compiler support (see https://golang.org/dl). On Mac, if using Homebrew, use "brew install go --with-cc-all" Optional:
[2/2] brooklyn-server git commit: This closes #117
This closes #117 * github/pr/117: Fix conversion of unsigned bytes to IP addresses Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/9fb41938 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/9fb41938 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/9fb41938 Branch: refs/heads/master Commit: 9fb41938fbd0f4c81a54a0aefcf35c009083510c Parents: 3b746e3 e500b19 Author: Andrew Donald KennedyAuthored: Wed Apr 20 09:38:29 2016 +0100 Committer: Andrew Donald Kennedy Committed: Wed Apr 20 09:38:29 2016 +0100 -- .../apache/brooklyn/util/net/Networking.java| 4 ++-- .../brooklyn/util/net/NetworkingUtilsTest.java | 20 2 files changed, 14 insertions(+), 10 deletions(-) --
[1/2] brooklyn-server git commit: Fix conversion of unsigned bytes to IP addresses
Repository: brooklyn-server Updated Branches: refs/heads/master 3b746e3ec -> 9fb41938f Fix conversion of unsigned bytes to IP addresses Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e500b191 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e500b191 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e500b191 Branch: refs/heads/master Commit: e500b191e58099bf437ae15239e8ad3514177f9d Parents: 3b746e3 Author: Andrew Donald KennedyAuthored: Wed Apr 20 08:20:41 2016 +0100 Committer: Andrew Donald Kennedy Committed: Wed Apr 20 08:20:41 2016 +0100 -- .../apache/brooklyn/util/net/Networking.java| 4 ++-- .../brooklyn/util/net/NetworkingUtilsTest.java | 20 2 files changed, 14 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e500b191/utils/common/src/main/java/org/apache/brooklyn/util/net/Networking.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/net/Networking.java b/utils/common/src/main/java/org/apache/brooklyn/util/net/Networking.java index 85c87a0..00eb06c 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/net/Networking.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/net/Networking.java @@ -332,7 +332,7 @@ public class Networking { StringBuilder name = new StringBuilder(); for (byte part : ip) { if (name.length() > 0) name.append("."); -name.append(part); +name.append(UnsignedBytes.toString(part)); } return InetAddress.getByAddress(name.toString(), ip); } catch (UnknownHostException e) { @@ -375,7 +375,7 @@ public class Networking { String[] parts = hostnameOrIp.split("\\."); assert parts.length == 4 : "val="+hostnameOrIp+"; split="+Arrays.toString(parts)+"; length="+parts.length; for (int i = 0; i < parts.length; i++) { -ip[i] = (byte)Integer.parseInt(parts[i]); +ip[i] = UnsignedBytes.parseUnsignedByte(parts[i]); } return InetAddress.getByAddress(hostnameOrIp, ip); } else { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e500b191/utils/common/src/test/java/org/apache/brooklyn/util/net/NetworkingUtilsTest.java -- diff --git a/utils/common/src/test/java/org/apache/brooklyn/util/net/NetworkingUtilsTest.java b/utils/common/src/test/java/org/apache/brooklyn/util/net/NetworkingUtilsTest.java index 811c712..524d160 100644 --- a/utils/common/src/test/java/org/apache/brooklyn/util/net/NetworkingUtilsTest.java +++ b/utils/common/src/test/java/org/apache/brooklyn/util/net/NetworkingUtilsTest.java @@ -61,28 +61,32 @@ public class NetworkingUtilsTest { assertFalse(Networking.isValidIp4("127.0.0.")); assertFalse(Networking.isValidIp4("127.0.0.9f")); assertFalse(Networking.isValidIp4("127.0.0.1.")); +assertFalse(Networking.isValidIp4("255.255.255.255.")); } - + @Test public void testGetInetAddressWithFixedNameByIpBytes() throws Exception { -InetAddress addr = Networking.getInetAddressWithFixedName(new byte[] {1,2,3,4}); -assertEquals(addr.getAddress(), new byte[] {1,2,3,4}); +InetAddress addr = Networking.getInetAddressWithFixedName(new byte[] { 1, 2, 3, 4 }); +assertEquals(addr.getAddress(), new byte[] { 1, 2, 3, 4 }); assertEquals(addr.getHostName(), "1.2.3.4"); + +InetAddress addr2 = Networking.getInetAddressWithFixedName(new byte[] { (byte) 255, (byte) 255, (byte) 255, (byte) 255 }); +assertEquals(addr2.getAddress(), new byte[] { (byte) 255, (byte) 255, (byte) 255, (byte) 255 }); +assertEquals(addr2.getHostName(), "255.255.255.255"); } @Test public void testGetInetAddressWithFixedNameByIp() throws Exception { InetAddress addr = Networking.getInetAddressWithFixedName("1.2.3.4"); -assertEquals(addr.getAddress(), new byte[] {1,2,3,4}); +assertEquals(addr.getAddress(), new byte[] { 1, 2, 3, 4 }); assertEquals(addr.getHostName(), "1.2.3.4"); - + InetAddress addr2 = Networking.getInetAddressWithFixedName("255.255.255.255"); -assertEquals(addr2.getAddress(), new byte[] {(byte)(int)255,(byte)(int)255,(byte)(int)255,(byte)(int)255}); +assertEquals(addr2.getAddress(), new byte[] { (byte) 255, (byte) 255, (byte) 255, (byte) 255 });