brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Added install resources configura...
Date Wed, 01 Oct 2014 21:22:43 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/165#discussion_r18309024
  
    --- Diff: software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
---
    @@ -332,74 +397,28 @@ public int copyTemplate(File template, String target) {
     
         /**
          * @param template URI of file to template and copy, e.g. file://.., http://.., classpath://..
    -     * @param target Destination on server. Will be prefixed with the entity's
    -     *               {@link #getRunDir() run directory} if relative.
    +     * @param target Destination on server.
          * @return The exit code of the SSH command run.
          */
         public int copyTemplate(String template, String target) {
    -        return copyTemplate(template, target, ImmutableMap.<String, String>of());
    +        return copyTemplate(template, target, false, ImmutableMap.<String, String>of());
         }
     
         /**
          * @param template URI of file to template and copy, e.g. file://.., http://.., classpath://..
    -     * @param target Destination on server. Will be prefixed with the entity's
    -     *               {@link #getRunDir() run directory} if relative.
    +     * @param target Destination on server.
          * @param extraSubstitutions Extra substitutions for the templater to use, for example
          *               "foo" -> "bar", and in a template ${foo}.
          * @return The exit code of the SSH command run.
          */
    -    public int copyTemplate(String template, String target, Map<String, ?> extraSubstitutions)
{
    -        // prefix with runDir if relative target
    -        String dest = target;
    -        if (!Os.isAbsolutish(target)) {
    -            dest = Os.mergePathsUnix(getRunDir(), target);
    -        }
    -        
    +    public int copyTemplate(String template, String target, boolean createParent, Map<String,
?> extraSubstitutions) {
             String data = processTemplate(template, extraSubstitutions);
    -        int result = getMachine().copyTo(new StringReader(data), dest);
    -        if (log.isDebugEnabled())
    -            log.debug("Copied filtered template for {}: {} to {} - result {}", new Object[]
{ entity, template, dest, result });
    -        return result;
    -    }
    -
    -    /**
    -     * Templates all resources in the given map, then copies them to the driver's {@link
#getMachine() machine}.
    -     * @param templates A mapping of resource URI to server destination.
    -     * @see #copyTemplate(String, String)
    -     */
    -    public void copyTemplates(Map<String, String> templates) {
    --- End diff --
    
    I think it's safer not to. The semantics weren't obvious, and I don't believe they were
actually used.


---
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