[Python-modules-commits] [python-netfilter] 01/03: Imported Upstream version 0.6.3
Jeremy Lainé
sharky at moszumanska.debian.org
Thu Oct 22 15:01:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
sharky pushed a commit to branch master
in repository python-netfilter.
commit 8c90fbc9ef8d65e5b26ffbaed0aa6723d025a59e
Author: Jeremy Lainé <jeremy.laine at m4x.org>
Date: Thu Oct 22 17:00:00 2015 +0200
Imported Upstream version 0.6.3
---
ChangeLog | 7 +++++++
netfilter/table.py | 13 ++++++++++++-
setup.py | 12 ++++++++++--
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ff16af6..3231d73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+python-netfilter 0.6.3 (2015-10-22)
+ * Invoke iptables with --wait option if supported.
+
+python-netfilter 0.6.2 (2015-05-28)
+ * Add PyPI classifiers.
+ * Rename from 'python-netfilter' to 'netfilter'.
+
python-netfilter 0.6.1 (2015-05-26)
* Python3 compatibility fixes.
diff --git a/netfilter/table.py b/netfilter/table.py
index 3400f9d..ee95a42 100644
--- a/netfilter/table.py
+++ b/netfilter/table.py
@@ -36,6 +36,9 @@ class IptablesError(Exception):
class Table:
"""The Table class represents a netfilter table (IPv4 or IPv6).
"""
+
+ __iptables_wait_option = None
+
def __init__(self, name, auto_commit = True, ipv6 = False):
"""Constructs a new netfilter Table.
@@ -138,7 +141,15 @@ class Table:
return netfilter.parser.parse_chains(data)
def __run_iptables(self, args):
- cmd = [self.__iptables, '-t', self.__name] + args
+ if Table.__iptables_wait_option is None:
+ # check whether iptables supports --wait
+ try:
+ self.__run([self.__iptables, '-L', '-n', '--wait'])
+ Table.__iptables_wait_option = ['--wait']
+ except:
+ Table.__iptables_wait_option = []
+
+ cmd = [self.__iptables] + Table.__iptables_wait_option + ['-t', self.__name] + args
if self.auto_commit:
self.__run(cmd)
else:
diff --git a/setup.py b/setup.py
index 80de701..fd7a648 100755
--- a/setup.py
+++ b/setup.py
@@ -3,8 +3,8 @@
from setuptools import setup
setup(
- name='python-netfilter',
- version='0.6.1',
+ name='netfilter',
+ version='0.6.3',
description='Python modules for manipulating netfilter rules',
url='https://github.com/jlaine/python-netfilter',
author='Jeremy Laine',
@@ -14,7 +14,15 @@ setup(
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
+ 'Operating System :: POSIX :: Linux',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
+ 'Topic :: Software Development :: Libraries',
+ 'Topic :: System :: Networking :: Firewalls',
+ 'Topic :: System :: Systems Administration',
],
test_suite='tests',
)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-netfilter.git
More information about the Python-modules-commits
mailing list