You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/07/07 09:33:26 UTC

[1/3] brooklyn-server git commit: Fix setting the hostname on non-centos machines

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 84fb623d1 -> 257926534


Fix setting the hostname on non-centos machines

Failure in the command will abort machine obtain, so make sure the command reports successfull result on non-centos machines.


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

Branch: refs/heads/master
Commit: 65eea3c6068dbadae8ce97a58ce8cf8e06fb30d6
Parents: 4b11f50
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Jul 5 21:07:15 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Wed Jul 6 12:52:14 2016 +0300

----------------------------------------------------------------------
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/65eea3c6/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 51e9d6a..cd9053e 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
@@ -924,10 +924,10 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                         executeCommandThrowingOnError(
                                 (SshMachineLocation)machineLocation,
                                 "Generate hostname " + node.getName(),
-                                Arrays.asList("sudo hostname " + node.getName(),
-                                        "sudo sed -i \"s/HOSTNAME=.*/HOSTNAME=" + node.getName() + "/g\" /etc/sysconfig/network",
-                                        "sudo bash -c \"echo 127.0.0.1   `hostname` >> /etc/hosts\"")
-                        );
+                                ImmutableList.of(BashCommands.chainGroup(
+                                        String.format("echo '127.0.0.1 %s' | ( %s )", node.getName(), BashCommands.sudo("tee -a /etc/hosts")),
+                                        "{ " + BashCommands.sudo("sed -i \"s/HOSTNAME=.*/HOSTNAME=" + node.getName() + "/g\" /etc/sysconfig/network") + " || true ; }",
+                                        BashCommands.sudo("hostname " + node.getName()))));
                     }
                 }
 


[2/3] brooklyn-server git commit: This closes #230

Posted by he...@apache.org.
This closes #230


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

Branch: refs/heads/master
Commit: f92180a07324753bf53498ca9f39c944bd276902
Parents: 84fb623 65eea3c
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Thu Jul 7 10:31:09 2016 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Thu Jul 7 10:31:09 2016 +0100

----------------------------------------------------------------------
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f92180a0/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------


[3/3] brooklyn-server git commit: added TODO comments re https://github.com/apache/brooklyn-server/pull/230

Posted by he...@apache.org.
added TODO comments re https://github.com/apache/brooklyn-server/pull/230


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

Branch: refs/heads/master
Commit: 257926534101749280853455dd7e0684eaa56c27
Parents: f92180a
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Thu Jul 7 10:33:09 2016 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Thu Jul 7 10:33:09 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java  | 1 +
 .../org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java   | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/25792653/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 5c554a1..572a0bf 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
@@ -921,6 +921,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                     } else {
                         customisationForLogging.add("configure hostname");
 
+                        // also see TODO in SetHostnameCustomizer - ideally we share code between here and there
                         executeCommandThrowingOnError(
                                 (SshMachineLocation)machineLocation,
                                 "Generate hostname " + node.getName(),

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/25792653/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java b/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java
index 54ffa72..28f97ee 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java
@@ -52,6 +52,7 @@ import com.google.common.reflect.TypeToken;
  * The customizer can be configured with a hard-coded hostname, or with a freemarker template
  * whose value (after substitutions) will be used for the hostname. 
  */
+// TODO basic hostname setting is done by JcloudsLocation, combine that code with this
 public class SetHostnameCustomizer extends BasicMachineLocationCustomizer {
 
     public static final Logger log = LoggerFactory.getLogger(SetHostnameCustomizer.class);