Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/531#discussion_r25416645
  
    --- Diff: 
software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java 
---
    @@ -156,6 +157,34 @@ public void install() {
                     .add("ln -s `which riak-admin` " + 
Urls.mergePaths(installBin, "riak-admin"))
                     .build();
         }
    +    
    +    private List<String> installPackageCloud() {
    +        return ifExecutable0Else1("yum", installDebianBased(), 
installRpmBased());
    +    }
    +
    +    private ImmutableList<String> installDebianBased() {
    +        ImmutableList.Builder<String> commands = 
ImmutableList.<String>builder();
    +        commands.add("curl 
https://packagecloud.io/install/repositories/basho/riak/script.deb | sudo 
bash");
    +        commands.add("sudo apt-get install --assume-yes riak");
    +        return commands.build();
    +    }
    +    
    +    private ImmutableList<String> installRpmBased() {
    +        ImmutableList.Builder<String> commands = 
ImmutableList.<String>builder();
    +        commands.add("curl 
https://packagecloud.io/install/repositories/basho/riak/script.rpm | sudo 
bash");
    +        commands.add("sudo yum install -y riak");
    --- End diff --
    
    Suggest you use `.add(BashCommands.sudo("yum install -y riak"))`. If 
running as the root user, then on some VMs it causes problems to try to execute 
`sudo`. The `sudo(...)` method gets around that by checking if the user is 
already root.
    
    Same applies for other uses of sudo.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to