brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Riak updates
Date Tue, 04 Nov 2014 00:41:24 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/292#discussion_r19778743
  
    --- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
---
    @@ -101,32 +108,36 @@ public void install() {
             }
             newScript(INSTALLING)
                     .body.append(commands)
    +                .failIfBodyEmpty()
    +                .failOnNonZeroResultCode()
                     .execute();
         }
     
         private List<String> installLinux(String expandedInstallDir) {
    -        LOG.info("Ignoring version config ({}) and installing from package manager",
getEntity().getConfig(RiakNode.SUGGESTED_VERSION));
    -        OsDetails osDetails = getMachine().getMachineDetails().getOsDetails();
    -        String osVersion = osDetails.getVersion();
    -        String osMajorVersion = osVersion.contains(".") ? osVersion.substring(0, osVersion.indexOf("."))
: osVersion;
    -        String fullVersion = getEntity().getConfig(RiakNode.SUGGESTED_VERSION);
    -        String majorVersion = fullVersion.substring(0, 3);
    +        DynamicTasks.queueIfPossible(SshTasks.dontRequireTtyForSudo(getMachine(), SshTasks.OnFailingTask.WARN_OR_IF_DYNAMIC_FAIL_MARKING_INESSENTIAL)).orSubmitAndBlock();
    +
             String installBin = Urls.mergePaths(expandedInstallDir, "bin");
    +        String saveAsYum = "riak.rpm";
    +        String saveAsApt = "riak.deb";
    +        OsDetails osDetails = getMachine().getOsDetails();
             String apt = chainGroup(
                     //debian fix
                     "export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                     "which apt-get",
                     ok(sudo("apt-get -y --allow-unauthenticated install logrotate libpam0g-dev
libssl0.9.8")),
    +                "export OS_NAME=" + Strings.toLowerCase(osDetails.getName()),
                     // TODO: Debian support (default debian image fails with 'sudo: command
not found')
    -                "[[ \"lucid natty precise\" =~ (^| )`lsb_release -sc`($| )  ]] &&
export OS_RELEASE=`lsb_release -sc` || export OS_RELEASE=precise",
    -                String.format("wget http://s3.amazonaws.com/downloads.basho.com/riak/%s/%s/ubuntu/$OS_RELEASE/riak_%<s-1_amd64.deb",
majorVersion, fullVersion),
    -                sudo(String.format("dpkg -i riak_%s-1_amd64.deb", fullVersion)),
    -                sudo("apt-get -y --allow-unauthenticated -f install"));
    +                "debian".equals(osDetails.getName()) ?
    +                    "export OS_RELEASE=" + osDetails.getVersion().substring(0, osDetails.getVersion().indexOf("."))
:
    +                    "export OS_RELEASE=`lsb_release -sc` && " +
    +                    "export OS_RELEASE=`([[ \"lucid natty precise\" =~ (^| )\\$OS_RELEASE($|
) ]] && echo $OS_RELEASE || echo precise)`",
    +                String.format("wget -O %s %s", saveAsApt, entity.getAttribute(RiakNode.DOWNLOAD_URL_UBUNTU_DEBIAN)),
    --- End diff --
    
    See https://github.com/apache/incubator-brooklyn/pull/293


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message