summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrewsh@debian.org>2015-04-29 10:23:28 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:32 +0200
commit9e1d6b8df50286fafca112491d26589e780b6c35 (patch)
tree439615da9f875b6a8609635ef5eb9805122515b8
parent12b25dc3c2a1420b32246e38d7bf1458661454a1 (diff)
parent1e93e1498efdfd85a599a7e831f4a3a55f78aa75 (diff)
Imported Debian patch 0.1.69+git20150226-1
-rw-r--r--debian/changelog6
-rw-r--r--debian/copyright4
-rw-r--r--reconfigure/__init__.py2
-rw-r--r--reconfigure/items/netatalk.py4
-rw-r--r--reconfigure/items/samba.py12
-rw-r--r--reconfigure/parsers/bind9.py2
-rw-r--r--reconfigure/parsers/exports.py4
-rw-r--r--reconfigure/parsers/iniparse/ini.py4
-rw-r--r--reconfigure/parsers/nginx.py2
-rw-r--r--reconfigure/tests/configs/base_test.py1
-rw-r--r--reconfigure/tests/configs/exports_tests.py4
-rw-r--r--reconfigure/tests/configs/netatalk_tests.py4
-rw-r--r--reconfigure/tests/configs/samba_tests.py24
-rw-r--r--reconfigure/tests/parsers/bind9_tests.py5
-rw-r--r--reconfigure/tests/parsers/exports_tests.py6
15 files changed, 64 insertions, 20 deletions
diff --git a/debian/changelog b/debian/changelog
index adecfc2..90aadc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-reconfigure (0.1.69+git20150226-1) unstable; urgency=medium
+
+ * New upstream snapshot.
+
+ -- Andrew Shadura <andrewsh@debian.org> Wed, 29 Apr 2015 10:23:28 +0200
+
python-reconfigure (0.1.59+git20140824-1) unstable; urgency=medium
* New upstream snapshot.
diff --git a/debian/copyright b/debian/copyright
index 28774f6..b6e98d5 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -4,11 +4,11 @@ Upstream-Contact: Eugeny Pankov <john.pankov@gmail.com>
Source: http://eugeny.github.io/reconfigure/
License: LGPL-3
Copyright:
- (c) 2012-2013 The Ajenti Team
+ (c) 2012-2015 The Ajenti Team
Eugeny Pankov <john.pankov@gmail.com> & contributors
Files: debian/*
-Copyright: 2013, Andrew Shadura <andrewsh@debian.org>
+Copyright: 2013-2015 Andrew Shadura <andrewsh@debian.org>
License: LGPL-3
License: LGPL-3
diff --git a/reconfigure/__init__.py b/reconfigure/__init__.py
index 12867ba..69f79d2 100644
--- a/reconfigure/__init__.py
+++ b/reconfigure/__init__.py
@@ -1 +1 @@
-__version__ = "0.1.59"
+__version__ = "0.1.67"
diff --git a/reconfigure/items/netatalk.py b/reconfigure/items/netatalk.py
index c4230d9..7989220 100644
--- a/reconfigure/items/netatalk.py
+++ b/reconfigure/items/netatalk.py
@@ -12,8 +12,8 @@ class GlobalData (BoundData):
class ShareData (BoundData):
- fields = ['path', 'appledouble', 'valid users', 'cnid scheme', 'ea', 'password']
- defaults = ['', 'ea', '', 'dbd', 'none', '']
+ fields = ['path', 'appledouble', 'valid users', 'cnid scheme', 'ea', 'password', 'file perm', 'directory perm']
+ defaults = ['', 'ea', '', 'dbd', 'none', '', '', '']
def template(self):
return Node(
diff --git a/reconfigure/items/samba.py b/reconfigure/items/samba.py
index 7d9308d..3288b2e 100644
--- a/reconfigure/items/samba.py
+++ b/reconfigure/items/samba.py
@@ -16,17 +16,23 @@ class ShareData (BoundData):
'comment', 'path', 'guest ok', 'browseable', 'create mask', 'directory mask', 'read only',
'follow symlinks', 'wide links', 'fstype', 'write list', 'veto files',
'force create mode', 'force directory mode', 'dfree command', 'force user', 'force group',
- 'valid users', 'read list', 'dfree cache time',
+ 'valid users', 'read list', 'dfree cache time', 'oplocks', 'locking',
+ 'preopen:names', 'preopen:num_bytes', 'preopen:helpers', 'preopen:queuelen',
+ 'vfs objects', 'recycle:repository', 'recycle:keeptree', 'recycle:exclude',
]
defaults = [
'', '', 'no', 'yes', '0744', '0755', 'yes',
'yes', 'no', 'NTFS', '', '', '000', '000', '',
- '', '', '', '', '',
+ '', '', '', '', '', 'yes', 'yes',
+ '', '', '', '',
+ '', '', 'no', '',
]
default_values = [
'', '', False, True, '0744', '0755', True,
True, False, '', '', '', '000', '000', '',
- '', '', '', '', '',
+ '', '', '', '', '', True, True,
+ '', '', '', '',
+ '', '', False, '',
]
def template(self):
diff --git a/reconfigure/parsers/bind9.py b/reconfigure/parsers/bind9.py
index ab089c4..e31a433 100644
--- a/reconfigure/parsers/bind9.py
+++ b/reconfigure/parsers/bind9.py
@@ -8,7 +8,7 @@ class BIND9Parser (NginxParser):
"""
tokens = [
- (r"(acl|key|masters|server|trusted-keys|managed-keys|controls|logging|lwres|options|view|zone|inet|channel|category|listen-on|search|avoid-v4-udp-ports|avoid-v6-udp-ports|blackhole|listen-on|listen-on-v6|allow-recursion|allow-recursion-on|sortlist|topology|rrset-order|dual-stack-servers|disable-algorithms|dns64|forwarders|rrset-order|update-policy|also-notify|allow-notify|rate-limit)\s+?([^\s{}]*\s*)*{", lambda s, t: ('section_start', t)),
+ (r"(acl|key|masters|server|trusted-keys|managed-keys|controls|logging|lwres|options|view|zone|channel|category|listen-on|search|avoid-v4-udp-ports|avoid-v6-udp-ports|blackhole|listen-on|listen-on-v6|allow-recursion|allow-recursion-on|sortlist|topology|rrset-order|dual-stack-servers|disable-algorithms|dns64|forwarders|rrset-order|update-policy|also-notify|allow-notify|rate-limit)\s+?([^\s{}]*\s*)*{", lambda s, t: ('section_start', t)),
(r"\#.*?\n", lambda s, t: ('comment', t)),
(r"//.*?\n", lambda s, t: ('comment', t)),
(r"/\*.*?\*/", lambda s, t: ('comment', t)),
diff --git a/reconfigure/parsers/exports.py b/reconfigure/parsers/exports.py
index 1941f61..75e680d 100644
--- a/reconfigure/parsers/exports.py
+++ b/reconfigure/parsers/exports.py
@@ -16,7 +16,7 @@ class ExportsParser (BaseParser):
tree = self.inner.parse(content)
root = RootNode()
for export in tree:
- export_node = Node(export[0].get('value').value)
+ export_node = Node(export[0].get('value').value.strip('"'))
export_node.comment = export.comment
clients_node = Node('clients')
export_node.append(clients_node)
@@ -37,7 +37,7 @@ class ExportsParser (BaseParser):
root = RootNode()
for export in tree:
export_node = Node('line', comment=export.comment)
- export_node.append(Node('token', PropertyNode('value', export.name)))
+ export_node.append(Node('token', PropertyNode('value', '"%s"' % export.name)))
for client in export['clients']:
s = client.name
if client['options'].value:
diff --git a/reconfigure/parsers/iniparse/ini.py b/reconfigure/parsers/iniparse/ini.py
index 84611ba..aeba8e9 100644
--- a/reconfigure/parsers/iniparse/ini.py
+++ b/reconfigure/parsers/iniparse/ini.py
@@ -127,8 +127,8 @@ class OptionLine(LineType):
out = out + self.comment_separator + self.comment
return out
- regex = re.compile(r'^(?P<name>[^:=\s[][^:=]*)'
- r'(?P<sep>[:=]\s*)'
+ regex = re.compile(r'^(?P<name>[^=\s[][^=]*)'
+ r'(?P<sep>[=]\s*)'
r'(?P<value>.*)$')
def parse(cls, line):
diff --git a/reconfigure/parsers/nginx.py b/reconfigure/parsers/nginx.py
index f0fe202..421a483 100644
--- a/reconfigure/parsers/nginx.py
+++ b/reconfigure/parsers/nginx.py
@@ -23,7 +23,7 @@ class NginxParser (BaseParser):
scanner = re.Scanner(self.tokens)
tokens, remainder = scanner.scan(' '.join(filter(None, content.split(' '))))
if remainder:
- raise Exception('Invalid tokens: %s' % remainder)
+ raise Exception('Invalid tokens: %s. Tokens: %s' % (remainder, tokens))
node = RootNode()
node.parameter = None
diff --git a/reconfigure/tests/configs/base_test.py b/reconfigure/tests/configs/base_test.py
index aefb13c..ff0fc78 100644
--- a/reconfigure/tests/configs/base_test.py
+++ b/reconfigure/tests/configs/base_test.py
@@ -19,6 +19,7 @@ class BaseConfigTest (unittest.TestCase):
if config.includer:
config.includer.content_map = self.sources
config.load()
+ #print config.tree._node
#print 'RESULT', config.tree.to_dict()
#print 'SOURCE', self.__class__.result
#self.assertTrue(self.__class__.result== config.tree.to_dict())
diff --git a/reconfigure/tests/configs/exports_tests.py b/reconfigure/tests/configs/exports_tests.py
index 28b53d1..bb44006 100644
--- a/reconfigure/tests/configs/exports_tests.py
+++ b/reconfigure/tests/configs/exports_tests.py
@@ -5,9 +5,9 @@ from reconfigure.tests.configs.base_test import BaseConfigTest
class ExportsConfigTest (BaseConfigTest):
sources = {
None: """
-/another/exported/directory 192.168.0.3(rw,sync) \
+"/another/exported/directory" 192.168.0.3(rw,sync) \
192.168.0.4(ro) # test
-/one 192.168.0.1 # comment
+"/one" 192.168.0.1 # comment
"""
}
result = {
diff --git a/reconfigure/tests/configs/netatalk_tests.py b/reconfigure/tests/configs/netatalk_tests.py
index 7d6d563..d844e9c 100644
--- a/reconfigure/tests/configs/netatalk_tests.py
+++ b/reconfigure/tests/configs/netatalk_tests.py
@@ -12,7 +12,7 @@ afp port=123
path=/home ;comment
valid users=root
ea=sys
-password=
+file perm=0755
"""
}
@@ -33,6 +33,8 @@ password=
"cnid_scheme": "dbd",
"path": "/home",
"password": '',
+ "file_perm": '0755',
+ "directory_perm": '',
}
]
}
diff --git a/reconfigure/tests/configs/samba_tests.py b/reconfigure/tests/configs/samba_tests.py
index 2604639..35a7e02 100644
--- a/reconfigure/tests/configs/samba_tests.py
+++ b/reconfigure/tests/configs/samba_tests.py
@@ -16,6 +16,10 @@ security=user
[homes]
comment=Home Directories
browseable=no
+preopen:names=/*.frm/
+preopen:num_bytes=123
+preopen:helpers=2
+preopen:queuelen=20
[profiles]
comment=Users profiles
@@ -59,6 +63,16 @@ directory mask=0700
"valid_users": "",
"read_list": "",
"dfree_cache_time": "",
+ "oplocks": True,
+ "locking": True,
+ "preopen:queuelen": "20",
+ "preopen:names": "/*.frm/",
+ "preopen:num_bytes": "123",
+ "preopen:helpers": "2",
+ "vfs_objects": "",
+ "recycle:keeptree": False,
+ "recycle:repository": "",
+ "recycle:exclude": '',
},
{
"name": "profiles",
@@ -82,6 +96,16 @@ directory mask=0700
"valid_users": "",
"read_list": "",
"dfree_cache_time": "",
+ "oplocks": True,
+ "locking": True,
+ "preopen:queuelen": "",
+ "preopen:names": "",
+ "preopen:num_bytes": "",
+ "preopen:helpers": "",
+ "vfs_objects": "",
+ "recycle:keeptree": False,
+ "recycle:repository": "",
+ "recycle:exclude": '',
}
]
}
diff --git a/reconfigure/tests/parsers/bind9_tests.py b/reconfigure/tests/parsers/bind9_tests.py
index 3892319..b3dc8dd 100644
--- a/reconfigure/tests/parsers/bind9_tests.py
+++ b/reconfigure/tests/parsers/bind9_tests.py
@@ -61,6 +61,11 @@ import unittest
class BIND9ParserHangTest (unittest.TestCase):
source = """
+
+controls {
+ inet * port 953 allow { 5.231.55.113; 127.0.0.1; } keys { "rndc-key"; };
+};
+
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
diff --git a/reconfigure/tests/parsers/exports_tests.py b/reconfigure/tests/parsers/exports_tests.py
index e83552a..a9f1f80 100644
--- a/reconfigure/tests/parsers/exports_tests.py
+++ b/reconfigure/tests/parsers/exports_tests.py
@@ -6,7 +6,7 @@ from reconfigure.nodes import *
class ExportsParserTest (BaseParserTest):
parser = ExportsParser()
source = """
-/another/exported/directory 192.168.0.3(rw,sync) \
+"/another/exported/directory" 192.168.0.3(rw,sync) \
192.168.0.4(ro)
# comment
/one 192.168.0.1
@@ -42,8 +42,8 @@ class ExportsParserTest (BaseParserTest):
@property
def stringified(self):
- return """/another/exported/directory\t192.168.0.3(rw,sync)\t192.168.0.4(ro)
-/one\t192.168.0.1\t# comment
+ return """"/another/exported/directory"\t192.168.0.3(rw,sync)\t192.168.0.4(ro)
+"/one"\t192.168.0.1\t# comment
"""