From 50adda50962cf1a3d1b6aacc94d669df80be97a6 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Fri, 16 Aug 2013 17:29:57 -0500 Subject: [PATCH] added version checking, doesn't work in older versions --- library/net_infrastructure/firewalld | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/library/net_infrastructure/firewalld b/library/net_infrastructure/firewalld index 5e16ac4734f..531e48a539c 100644 --- a/library/net_infrastructure/firewalld +++ b/library/net_infrastructure/firewalld @@ -59,7 +59,7 @@ options: default: 0 notes: - Not tested on any debian based system -requirements: [ firewalld ] +requirements: [ firewalld >= 0.2.11 ] author: Adam Miller ''' @@ -74,6 +74,9 @@ import re import sys try: + import firewall.config + FW_VERSION = firewall.config.VERSION + from firewall.client import FirewallClient fw = FirewallClient() except ImportError: @@ -165,6 +168,10 @@ def main(): supports_check_mode=True ) + ## Pre-run version checking + if FW_VERSION < "0.2.11": + module.fail_json(msg='unsupported version of firewalld, requires >= 2.0.11') + ## Global Vars changed=False msgs = []