Commit 50adda50 by Adam Miller

added version checking, doesn't work in older versions

parent 7ad8f6b1
...@@ -59,7 +59,7 @@ options: ...@@ -59,7 +59,7 @@ options:
default: 0 default: 0
notes: notes:
- Not tested on any debian based system - Not tested on any debian based system
requirements: [ firewalld ] requirements: [ firewalld >= 0.2.11 ]
author: Adam Miller <maxamillion@fedoraproject.org> author: Adam Miller <maxamillion@fedoraproject.org>
''' '''
...@@ -74,6 +74,9 @@ import re ...@@ -74,6 +74,9 @@ import re
import sys import sys
try: try:
import firewall.config
FW_VERSION = firewall.config.VERSION
from firewall.client import FirewallClient from firewall.client import FirewallClient
fw = FirewallClient() fw = FirewallClient()
except ImportError: except ImportError:
...@@ -165,6 +168,10 @@ def main(): ...@@ -165,6 +168,10 @@ def main():
supports_check_mode=True 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 ## Global Vars
changed=False changed=False
msgs = [] msgs = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment