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

    https://github.com/apache/brooklyn-server/pull/1003#discussion_r221687382
  
    --- Diff: 
utils/common/src/main/java/org/apache/brooklyn/util/ssh/IptablesCommands.java 
---
    @@ -130,8 +130,8 @@ public static String firewalldServiceIsActive() {
          *
          */
         public static String saveIptablesRules() {
    -        return alternatives(sudo("service iptables save"),
    -                            chain(installPackage("iptables-persistent"), 
sudo("/etc/init.d/iptables-persistent save")));
    +        return alternatives("if [ ${UID} -eq 0 ] ; then iptables–save > 
/etc/sysconfig/iptables ; else sudo iptables-save | sudo tee 
/etc/sysconfig/iptables ; fi",
    --- End diff --
    
    Maybe surround this with `BashCommands.ifExecutableElse1("iptables-save", 
...)` to ensure the command exists


---

Reply via email to