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 2014/10/03 14:26:45 UTC
[1/2] git commit: Add location customiser to fix broken sudo/tty
behaviour.
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master fb3c9970d -> 304cf08a8
Add location customiser to fix broken sudo/tty behaviour.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/a21d1e88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/a21d1e88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/a21d1e88
Branch: refs/heads/master
Commit: a21d1e8864f9bf9ec7091cdb9970a933dfc406ad
Parents: fb3c997
Author: Alasdair Hodge <al...@cloudsoftcorp.com>
Authored: Thu Oct 2 10:47:03 2014 +0100
Committer: Alasdair Hodge <al...@cloudsoftcorp.com>
Committed: Thu Oct 2 10:47:03 2014 +0100
----------------------------------------------------------------------
.../jclouds/SudoTtyFixingCustomizer.java | 38 ++++++++++++++++++++
1 file changed, 38 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a21d1e88/locations/jclouds/src/main/java/brooklyn/location/jclouds/SudoTtyFixingCustomizer.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/SudoTtyFixingCustomizer.java b/locations/jclouds/src/main/java/brooklyn/location/jclouds/SudoTtyFixingCustomizer.java
new file mode 100644
index 0000000..a7ac30b
--- /dev/null
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/SudoTtyFixingCustomizer.java
@@ -0,0 +1,38 @@
+package brooklyn.location.jclouds;
+
+import org.jclouds.compute.ComputeService;
+
+import com.google.common.annotations.Beta;
+
+import brooklyn.util.task.DynamicTasks;
+import brooklyn.util.task.ssh.SshTasks;
+import brooklyn.util.task.ssh.SshTasks.OnFailingTask;
+
+/**
+ * Wraps Brooklyn's sudo-tty mitigations in a {@link JcloudsLocationCustomizer} for easy(-ish) consumption
+ * in YAML blueprints:
+ *
+ * <pre>
+ * name: My App
+ * brooklyn.config:
+ * provisioning.properties:
+ * customizerType: brooklyn.location.jclouds.SudoTtyFixingCustomizer
+ * services: ...
+ * </pre>
+ *
+ * <p>This class should be seen as a temporary workaround and might disappear completely if/when Brooklyn takes care of this automatically.
+ *
+ * <p>See
+ * <a href='http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password'>http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password</a>
+ * for background.
+ */
+@Beta
+public class SudoTtyFixingCustomizer extends BasicJcloudsLocationCustomizer {
+
+ @Override
+ public void customize(JcloudsLocation location, ComputeService computeService, JcloudsSshMachineLocation machine) {
+ DynamicTasks.queueIfPossible(SshTasks.dontRequireTtyForSudo(machine, OnFailingTask.FAIL)).orSubmitAndBlock();
+ DynamicTasks.waitForLast();
+ }
+
+}
[2/2] git commit: This closes #209
Posted by he...@apache.org.
This closes #209
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/304cf08a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/304cf08a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/304cf08a
Branch: refs/heads/master
Commit: 304cf08a8e9df08882fcc23e6a342af797a87f9c
Parents: fb3c997 a21d1e8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Oct 3 13:26:33 2014 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Oct 3 13:26:33 2014 +0100
----------------------------------------------------------------------
.../jclouds/SudoTtyFixingCustomizer.java | 38 ++++++++++++++++++++
1 file changed, 38 insertions(+)
----------------------------------------------------------------------