소스 검색

Merge pull request #107 from danwinship/IsNotExist

Add another pattern to IsNotExist
Casey Callendrello 1 년 전
부모
커밋
5dc28b746f
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      iptables/iptables.go

+ 2 - 1
iptables/iptables.go

@@ -52,7 +52,8 @@ func (e *Error) IsNotExist() bool {
 	}
 	msgNoRuleExist := "Bad rule (does a matching rule exist in that chain?).\n"
 	msgNoChainExist := "No chain/target/match by that name.\n"
-	return strings.Contains(e.msg, msgNoRuleExist) || strings.Contains(e.msg, msgNoChainExist)
+	msgENOENT := "No such file or directory"
+	return strings.Contains(e.msg, msgNoRuleExist) || strings.Contains(e.msg, msgNoChainExist) || strings.Contains(e.msg, msgENOENT)
 }
 
 // Protocol to differentiate between IPv4 and IPv6