[brooklyn-server] Git Push Summary
Repository: brooklyn-server Updated Branches: refs/heads/frogfather_amend_iptables_save [deleted] c474231af
[2/2] brooklyn-server git commit: review comments and add test
review comments and add test Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c474231a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c474231a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c474231a Branch: refs/heads/frogfather_amend_iptables_save Commit: c474231af219212336b647f3cc138d6ff58a8f47 Parents: 77b50be Author: frogfather Authored: Tue Oct 2 14:42:23 2018 +0100 Committer: frogfather Committed: Tue Oct 2 14:42:23 2018 +0100 -- .../brooklyn/util/ssh/IptablesCommands.java | 20 +++- .../brooklyn/util/ssh/IptablesCommandsTest.java | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c474231a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java index c584d33..7012528 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java @@ -20,6 +20,7 @@ package org.apache.brooklyn.util.ssh; import static org.apache.brooklyn.util.ssh.BashCommands.alternatives; import static org.apache.brooklyn.util.ssh.BashCommands.chain; +import static org.apache.brooklyn.util.ssh.BashCommands.ifExecutableElse1; import static org.apache.brooklyn.util.ssh.BashCommands.installPackage; import static org.apache.brooklyn.util.ssh.BashCommands.sudo; @@ -94,7 +95,7 @@ public class IptablesCommands { @Beta // implementation not portable across distros public static String firewalldService(String cmd) { return sudo(alternatives( -BashCommands.ifExecutableElse1("systemctl", "systemctl " + cmd + " firewalld"), +ifExecutableElse1("systemctl", "systemctl " + cmd + " firewalld"), "/usr/bin/systemctl " + cmd + " firewalld")); } @@ -130,7 +131,8 @@ public class IptablesCommands { * */ public static String saveIptablesRules() { -return alternatives("if [ ${UID} -eq 0 ] ; then iptablesâsave > /etc/sysconfig/iptables ; else sudo iptables-save | sudo tee /etc/sysconfig/iptables ; fi", +return alternatives( +ifExecutableElse1("iptablesâsave", "if [ ${UID} -eq 0 ] ; then iptablesâsave > /etc/sysconfig/iptables ; else sudo iptables-save | sudo tee /etc/sysconfig/iptables ; fi"), chain(installPackage("iptables-persistent"), sudo("/etc/init.d/iptables-persistent save"))); } @@ -140,7 +142,7 @@ public class IptablesCommands { * @return Returns the command that cleans up iptables rules. */ public static String cleanUpIptablesRules() { - return sudo("/sbin/iptables -F"); +return sudo("/sbin/iptables -F"); } /** @@ -149,7 +151,7 @@ public class IptablesCommands { * @return Returns the command that list all the iptables rules. */ public static String listIptablesRule() { - return sudo("/sbin/iptables -L -v -n"); +return sudo("/sbin/iptables -L -v -n"); } /** @@ -213,7 +215,7 @@ public class IptablesCommands { public static String addFirewalldRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) { return addFirewalldRule(chain, Optional.absent(), protocol, port, policy); } - + /** * Returns the command that adds firewalld direct rule. * @@ -222,12 +224,12 @@ public class IptablesCommands { public static String addFirewalldRule(Chain chain, Optional networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) { String command = new String("/usr/bin/firewall-cmd"); String commandPermanent = new String("/usr/bin/firewall-cmd --permanent"); - + String interfaceParameter = String.format("%s", networkInterface.isPresent() ? " -i " + networkInterface.get() : ""); - -String commandParameters = String.format(" --direct --add-rule ipv4 filter %s 0 %s -p %s --dport %d -j %s", + +String commandParameters = String.format(" --direct --add-rule ipv4 filter %s 0 %s -p %s --dport %d -j %s", chain, interfaceParameter, protocol, port, policy); - + return sudo(chain(command + commandParameters, commandPermanent + commandParameters)); } } http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c474231a/utils/common/src/test
[1/2] brooklyn-server git commit: Update IPTables save method
Repository: brooklyn-server Updated Branches: refs/heads/frogfather_amend_iptables_save [created] c474231af Update IPTables save method Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/77b50be9 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/77b50be9 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/77b50be9 Branch: refs/heads/frogfather_amend_iptables_save Commit: 77b50be911148c7414dbb1b30364b495b4c8f363 Parents: 97a922d Author: frogfather Authored: Mon Oct 1 14:23:15 2018 +0100 Committer: frogfather Committed: Mon Oct 1 14:23:15 2018 +0100 -- .../main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/77b50be9/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java index d504544..c584d33 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java @@ -130,8 +130,8 @@ public class IptablesCommands { * */ public static String saveIptablesRules() { -return alternatives(sudo("service iptables save"), -chain(installPackage("iptables-persistent"), sudo("/etc/init.d/iptables-persistent save"))); +return alternatives("if [ ${UID} -eq 0 ] ; then iptablesâsave > /etc/sysconfig/iptables ; else sudo iptables-save | sudo tee /etc/sysconfig/iptables ; fi", +chain(installPackage("iptables-persistent"), sudo("/etc/init.d/iptables-persistent save"))); } /**
[1/2] brooklyn-ui git commit: Composer palette: search entity tags
Repository: brooklyn-ui Updated Branches: refs/heads/master 6de1f6730 -> c4eb263fa Composer palette: search entity tags Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/0b098749 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/0b098749 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/0b098749 Branch: refs/heads/master Commit: 0b098749f6ce1d1f055b4667c1bae1400b5edd54 Parents: 6de1f67 Author: Aled Sage Authored: Fri Sep 28 13:25:19 2018 +0100 Committer: Aled Sage Committed: Fri Sep 28 13:25:19 2018 +0100 -- .../app/components/catalog-selector/catalog-selector.directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0b098749/ui-modules/blueprint-composer/app/components/catalog-selector/catalog-selector.directive.js -- diff --git a/ui-modules/blueprint-composer/app/components/catalog-selector/catalog-selector.directive.js b/ui-modules/blueprint-composer/app/components/catalog-selector/catalog-selector.directive.js index 733a2ce..32fdd1c 100644 --- a/ui-modules/blueprint-composer/app/components/catalog-selector/catalog-selector.directive.js +++ b/ui-modules/blueprint-composer/app/components/catalog-selector/catalog-selector.directive.js @@ -22,7 +22,7 @@ import template from './catalog-selector.template.html'; const ITEMS_PER_PAGE = 30; // fields in either bundle or type record: -const FIELDS_TO_SEARCH = ['name', 'displayName', 'symbolicName', 'version', 'type', 'supertypes', 'containingBundle', 'description', 'displayTags']; +const FIELDS_TO_SEARCH = ['name', 'displayName', 'symbolicName', 'version', 'type', 'supertypes', 'containingBundle', 'description', 'displayTags', 'tags']; export function catalogSelectorDirective() { return {
[2/2] brooklyn-ui git commit: This closes #76
This closes #76 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/c4eb263f Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/c4eb263f Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/c4eb263f Branch: refs/heads/master Commit: c4eb263fa9778951b08324581791af1546e7e74e Parents: 6de1f67 0b09874 Author: Thomas Bouron Authored: Tue Oct 2 13:10:20 2018 +0100 Committer: Thomas Bouron Committed: Tue Oct 2 13:10:20 2018 +0100 -- .../app/components/catalog-selector/catalog-selector.directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[2/2] brooklyn-server git commit: This closes #1004
This closes #1004 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c3d71a2e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c3d71a2e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c3d71a2e Branch: refs/heads/master Commit: c3d71a2e9fde3383e8ed7af0a444981b7e31073a Parents: 97a922d eafd8d0 Author: Aled Sage Authored: Tue Oct 2 09:24:18 2018 +0100 Committer: Aled Sage Committed: Tue Oct 2 09:24:18 2018 +0100 -- .../camp/brooklyn/ConfigParametersYamlTest.java | 65 +++ .../brooklyn/core/objs/BasicSpecParameter.java | 10 ++- .../resources/BundleAndTypeResourcesTest.java | 86 3 files changed, 159 insertions(+), 2 deletions(-) --
[1/2] brooklyn-server git commit: BROOKLYN-602: fix config key order for yaml overrides
Repository: brooklyn-server Updated Branches: refs/heads/master 97a922d6c -> c3d71a2e9 BROOKLYN-602: fix config key order for yaml overrides Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/eafd8d04 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/eafd8d04 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/eafd8d04 Branch: refs/heads/master Commit: eafd8d047f0746c953ebc42385c332591a515ecc Parents: 97a922d Author: Aled Sage Authored: Mon Oct 1 15:49:20 2018 +0100 Committer: Aled Sage Committed: Tue Oct 2 09:22:24 2018 +0100 -- .../camp/brooklyn/ConfigParametersYamlTest.java | 65 +++ .../brooklyn/core/objs/BasicSpecParameter.java | 10 ++- .../resources/BundleAndTypeResourcesTest.java | 86 3 files changed, 159 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/eafd8d04/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java -- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java index 7770270..5f277ee 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java @@ -29,13 +29,17 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; +import org.apache.brooklyn.api.catalog.CatalogConfig; import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.entity.EntitySpec; import org.apache.brooklyn.api.entity.ImplementedBy; import org.apache.brooklyn.api.internal.AbstractBrooklynObjectSpec; import org.apache.brooklyn.api.location.Location; import org.apache.brooklyn.api.location.PortRange; +import org.apache.brooklyn.api.objs.SpecParameter; +import org.apache.brooklyn.api.typereg.RegisteredType; import org.apache.brooklyn.camp.brooklyn.catalog.SpecParameterUnwrappingTest; import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog; @@ -49,6 +53,7 @@ import org.apache.brooklyn.core.entity.Dumper; import org.apache.brooklyn.core.location.PortRanges; import org.apache.brooklyn.core.sensor.Sensors; import org.apache.brooklyn.core.test.entity.TestEntity; +import org.apache.brooklyn.core.test.entity.TestEntityImpl; import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess; import org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess; import org.apache.brooklyn.entity.stock.BasicApplication; @@ -1194,6 +1199,66 @@ public class ConfigParametersYamlTest extends AbstractYamlRebindTest { } } +@Test +public void testConfigParameterPinnedOrder() throws Exception { +addCatalogItems( +"brooklyn.catalog:", +" version: " + TEST_VERSION, +" itemType: entity", +" items:", +"- id: entity-without-keys", +" item:", +"type: "+TestEntityWithPinnedConfig.class.getName(), +"- id: entity-with-keys-redeclared", +" item:", +"type: "+TestEntityWithPinnedConfig.class.getName(), +"brooklyn.parameters:", +" - name: pinned2", +" - name: unpinned2"); + +for (String symbolicName : ImmutableList.of("entity-without-keys", "entity-with-keys-redeclared")) { +// Mimicking the code in REST api's TypeResource, for getting the config keys +RegisteredType item = mgmt().getTypeRegistry().get(symbolicName, TEST_VERSION); +AbstractBrooklynObjectSpec spec = mgmt().getTypeRegistry().createSpec(item, null, null); +List> params = spec.getParameters(); +SpecParameter pinned2 = Iterables.find(params, (p) -> p.getConfigKey().getName().equals("pinned2")); +SpecParameter unpinned2 = Iterables.find(params, (p) -> p.getConfigKey().getName().equals("unpinned2")); + +assertEquals(pinned2.getLabel(), "mylabel-pinned2", "item="+symbolicName); +assertEquals(pinned2.isPinned(), true, "item="+symbolicName); + +assertEquals(unpinned2.getLabel(), "mylabel-unpinned2", "item="+symbolicName); +assertEquals(unpinned2.isPinned(), false, "item="+symbolicName); + +List