You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by sjcorbett <gi...@git.apache.org> on 2016/11/09 15:27:59 UTC

[GitHub] brooklyn-server pull request #422: SshCommandEffector + shell.env

GitHub user sjcorbett opened a pull request:

    https://github.com/apache/brooklyn-server/pull/422

    SshCommandEffector + shell.env

    SshCommandEffector resolves shell.env against the target entity rather than always resolving it against the entity the effector is attached to. This also fixes the resolution of the execution directory.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sjcorbett/brooklyn-server ssh-eff-shell-env

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/422.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #422
    
----
commit 5b9af64cb9278fd8581c88d317145b66efbc5176
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-11-07T18:26:36Z

    Typos

commit 02bc3123fdf805cddcacfa5cd06a5926ebd65671
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-11-07T18:28:04Z

    XmlSerialiserTest logs at debug
    
    \u001b in testIllegalXmlCharacter breaks tmux when it's printed

commit ad17113f2cd35c511154fe299050ef6409f3010d
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-11-08T17:54:39Z

    Delete duplicate dependency on jackson-datatype-guava

commit 14349d1972811162b49a2db1515c7405a1bc29ac
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-11-08T19:22:26Z

    Fix Debian 7 live test
    
    ami-5586a43c is not unavailable.

commit fc3394c2705ec7e945172c3170c0a37e4401c5f6
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-11-09T15:26:18Z

    SshCommandEffector resolves shell.env against the target entity
    
    Rather than always resolving it against the entity the effector is
    attached to. This also fixes the resolution of the execution directory.

----


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

[GitHub] brooklyn-server issue #422: SshCommandEffector + shell.env

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-server/pull/422
  
    \U0001f44d changes look good to me at a read through.


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

[GitHub] brooklyn-server issue #422: SshCommandEffector + shell.env

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the issue:

    https://github.com/apache/brooklyn-server/pull/422
  
    Thanks @geomacy and @aledsage. I'll write a test for the new behaviour. Is there any way to inject a mock SSH tool? Would be neat if the test could be a unit test rather than an integration test.


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

[GitHub] brooklyn-server pull request #422: SshCommandEffector + shell.env

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/422


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

[GitHub] brooklyn-server issue #422: SshCommandEffector + shell.env

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the issue:

    https://github.com/apache/brooklyn-server/pull/422
  
    Resolution of shell environments is badly affected by the problem #385 fixes. For example when you invoke the effector created in this bluerint:
    
    ```yaml
    location: localhost
    services:
    - type: brooklyn.entity.group.DynamicCluster
      id: cluster
      brooklyn.config:
        initialSize: 3
        memberSpec:
          $brooklyn:entitySpec:
            type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
            brooklyn.config:
              shell.env:
                MEMBER_CFG: $brooklyn:config("cluster.member.id")
                MEMBER_ID: $brooklyn:attributeWhenReady("entity.id")
    
      - type: brooklyn.entity.software.ssh.SshCommandEffector
        brooklyn.config:
          name: test-effector
          shell.env:
            CLUSTER_ID: $brooklyn:attributeWhenReady("entity.id")
          command: 'echo "cluster=${CLUSTER_ID}, memberId=${MEMBER_ID}, member=${MEMBER_CFG}" >> /tmp/echo'
          executionTarget: members
    ```
    You generally observe output like:
    ```
    cluster=hgnwhpehtq, memberId=h0ea5qzz4k, member=1
    cluster=hgnwhpehtq, memberId=hgnwhpehtq, member=
    cluster=hgnwhpehtq, memberId=hgnwhpehtq, member=
    ```
    In two of the three cases the entries in the member's `shell.env` were resolved against the cluster, not the member.


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

[GitHub] brooklyn-server issue #422: SshCommandEffector + shell.env

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-server/pull/422
  
    LGTM; merging.
    
    @sjcorbett I've also merged #385 - do we want to add any more tests (similar to your example yaml, that it gets the right entity id)?


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

[GitHub] brooklyn-server issue #422: SshCommandEffector + shell.env

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-server/pull/422
  
    @sjcorbett you can use `RecordingSshTool`. For example https://github.com/apache/brooklyn-server/blob/master/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java#L452-L493 for how that can be used in a YAML blueprint.


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