brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Fix KafkaIntegrationTest tests
Date Thu, 16 Jul 2015 10:45:55 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/742#discussion_r34775372
  
    --- Diff: software/messaging/src/main/java/brooklyn/entity/messaging/kafka/KafkaZooKeeperSshDriver.java
---
    @@ -60,4 +67,12 @@ public Integer getZookeeperPort() {
             return getEntity().getAttribute(KafkaZooKeeper.ZOOKEEPER_PORT);
         }
     
    +    @Override
    +    public void createTopic(String topic) {
    +        String zookeeperUrl = getEntity().getAttribute(Attributes.HOSTNAME) + ":" + getZookeeperPort();
    +        newScript(CUSTOMIZING)
    +                .failOnNonZeroResultCode()
    +                .body.append(String.format("./bin/%s  --create --zookeeper %s --replication-factor
1 --partitions 1 --topic %s", getTopicsScriptName(), zookeeperUrl, topic))
    --- End diff --
    
    `getTopicsScriptName()` is coming from the user, right? Should be bash-escaped, see `BashStringEscapes`.
Otherwise will let the user execute arbitrary commands (or fail when special characters are
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