ifstate 2.0.0rc6__py3-none-any.whl → 2.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ifstate/ifstate.py +1 -1
- {ifstate-2.0.0rc6.dist-info → ifstate-2.0.1.dist-info}/METADATA +1 -1
- {ifstate-2.0.0rc6.dist-info → ifstate-2.0.1.dist-info}/RECORD +9 -9
- libifstate/__init__.py +14 -15
- libifstate/schema/2/ifstate.conf.schema.json +1 -1
- {ifstate-2.0.0rc6.dist-info → ifstate-2.0.1.dist-info}/WHEEL +0 -0
- {ifstate-2.0.0rc6.dist-info → ifstate-2.0.1.dist-info}/entry_points.txt +0 -0
- {ifstate-2.0.0rc6.dist-info → ifstate-2.0.1.dist-info}/licenses/LICENSE +0 -0
- {ifstate-2.0.0rc6.dist-info → ifstate-2.0.1.dist-info}/top_level.txt +0 -0
ifstate/ifstate.py
CHANGED
@@ -131,7 +131,7 @@ def main():
|
|
131
131
|
parser.add_argument('--version', action='version',
|
132
132
|
version='%(prog)s {version}'.format(version=__version__))
|
133
133
|
group.add_argument("-v", "--verbose", action="count", default=0,
|
134
|
-
help="be more verbose")
|
134
|
+
help="be more verbose (twice for very verbose)")
|
135
135
|
group.add_argument("-q", "--quiet", action="store_true",
|
136
136
|
help="be more quiet, print only warnings and errors")
|
137
137
|
parser.add_argument("-s", "--soft-schema", action="store_true",
|
@@ -1,9 +1,9 @@
|
|
1
1
|
ifstate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
ifstate/ifstate.py,sha256=
|
2
|
+
ifstate/ifstate.py,sha256=Vot_Bo0MGT_5MUKD5-pt2xB-fLLkjwvJo24KgtETtR8,9329
|
3
3
|
ifstate/shell.py,sha256=7_JFpi4icr9MijynDzbb0v5mxhFsng6PCC4m3uQ255A,2177
|
4
4
|
ifstate/vrrp.py,sha256=FJ9b1eJseTtZFfknHU-xV68Qz7cPrRrc5PTcjUVj-fY,5953
|
5
|
-
ifstate-2.0.
|
6
|
-
libifstate/__init__.py,sha256=
|
5
|
+
ifstate-2.0.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
+
libifstate/__init__.py,sha256=j_ELThVxr4gMe1iROCuRbvv3xoU73F01UQ9Pp-yhJL8,33972
|
7
7
|
libifstate/exception.py,sha256=NmKqD9O8dRWBgO__Pt0_wGSR5GWZ1RHXZZEUI3ArVLo,2360
|
8
8
|
libifstate/log.py,sha256=rG0ISWyeGGlC_jRREoSpkdySc5EmyhOQIgSfvRqlaZA,4651
|
9
9
|
libifstate/util.py,sha256=DqYyFzNqRceJxxGqTg94gT8OTHQQ2gZxQOo5Gzx6-6s,11555
|
@@ -27,13 +27,13 @@ libifstate/parser/__init__.py,sha256=uzv5U-6RPy-SSIyxR6H_F0SvAOQQF8x5ygErpUhsa7Y
|
|
27
27
|
libifstate/parser/base.py,sha256=v0S_R_aMZBdHJPI3zdelv5G0Xha-pUV2DRdmxhD7390,6624
|
28
28
|
libifstate/parser/yaml.py,sha256=MC0kmwqt3P45z61fb_wfUqoj0iZyhFYkdPyr0UqMSZA,1415
|
29
29
|
libifstate/routing/__init__.py,sha256=O4lbaCJvLgx-iQUa0WDgRmSPR4AKvveqPgxxb4HwYQ4,25305
|
30
|
-
libifstate/schema/2/ifstate.conf.schema.json,sha256=
|
30
|
+
libifstate/schema/2/ifstate.conf.schema.json,sha256=WYjy0BoRPCK59Fv7Z-rMu4-RVPT1v_9w7yVIlQVxros,221181
|
31
31
|
libifstate/sysctl/__init__.py,sha256=_QNmH0CirbBy8VAupTm6UhIhB88fGWqUy9TnfmS0j5I,3637
|
32
32
|
libifstate/tc/__init__.py,sha256=T8LEBxiHZH4sayPn9lK5hK8eB8dskuw6-kw81W_aMWU,12097
|
33
33
|
libifstate/wireguard/__init__.py,sha256=VSn3PzQXwZeRV1qf5nOc_RbeePQlXu8FUh2Lg356-ZA,8869
|
34
34
|
libifstate/xdp/__init__.py,sha256=X1xhEIGng7R5d5F4KsChykT2g6H-XBRWbWABijoYDQA,7208
|
35
|
-
ifstate-2.0.
|
36
|
-
ifstate-2.0.
|
37
|
-
ifstate-2.0.
|
38
|
-
ifstate-2.0.
|
39
|
-
ifstate-2.0.
|
35
|
+
ifstate-2.0.1.dist-info/METADATA,sha256=SHtdea2vsqaFqD70x23z2B08VsrUXOsvGgCJeMg4kYw,1604
|
36
|
+
ifstate-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
37
|
+
ifstate-2.0.1.dist-info/entry_points.txt,sha256=HF6jX7Uu_nF1Ly-J9uEPeiRapOxnM6LuHsb2y6Mt-k4,52
|
38
|
+
ifstate-2.0.1.dist-info/top_level.txt,sha256=A7peI7aKBaM69fsiSPvMbL3rzTKZZr5qDxKC-pHMGdE,19
|
39
|
+
ifstate-2.0.1.dist-info/RECORD,,
|
libifstate/__init__.py
CHANGED
@@ -54,7 +54,7 @@ import json
|
|
54
54
|
import errno
|
55
55
|
import logging
|
56
56
|
|
57
|
-
__version__ = "2.0.
|
57
|
+
__version__ = "2.0.1"
|
58
58
|
|
59
59
|
class IfState():
|
60
60
|
def __init__(self):
|
@@ -136,16 +136,15 @@ class IfState():
|
|
136
136
|
self.link_registry = LinkRegistry(self.ignore.get('ifname', []), self.root_netns)
|
137
137
|
|
138
138
|
self._update(self.root_netns, ifstates)
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
self._update(self.namespaces[netns_name], netns_ifstates)
|
139
|
+
self.namespaces = {}
|
140
|
+
self.new_namespaces = []
|
141
|
+
for netns_name, netns_ifstates in ifstates.get('namespaces', {}).items():
|
142
|
+
is_new = netns_name not in pyroute2.netns.listnetns()
|
143
|
+
self.namespaces[netns_name] = NetNameSpace(netns_name)
|
144
|
+
if is_new:
|
145
|
+
self.new_namespaces.append(netns_name)
|
146
|
+
self.link_registry.inventory_netns(self.namespaces[netns_name])
|
147
|
+
self._update(self.namespaces[netns_name], netns_ifstates)
|
149
148
|
|
150
149
|
def _update(self, netns, ifstates):
|
151
150
|
# parse network sysctl settings
|
@@ -320,15 +319,15 @@ class IfState():
|
|
320
319
|
|
321
320
|
# add routing from config
|
322
321
|
if 'routing' in ifstates:
|
322
|
+
if netns.tables is None:
|
323
|
+
netns.tables = Tables(netns)
|
323
324
|
if 'routes' in ifstates['routing']:
|
324
|
-
if netns.tables is None:
|
325
|
-
netns.tables = Tables(netns)
|
326
325
|
for route in ifstates['routing']['routes']:
|
327
326
|
netns.tables.add(route)
|
328
327
|
|
328
|
+
if netns.rules is None:
|
329
|
+
netns.rules = Rules(netns)
|
329
330
|
if 'rules' in ifstates['routing']:
|
330
|
-
if netns.rules is None:
|
331
|
-
netns.rules = Rules(netns)
|
332
331
|
for rule in ifstates['routing']['rules']:
|
333
332
|
netns.rules.add(rule)
|
334
333
|
|
@@ -1757,7 +1757,7 @@
|
|
1757
1757
|
"additionalProperties": false,
|
1758
1758
|
"properties": {
|
1759
1759
|
"script": {
|
1760
|
-
"description": "filename to be executed on interface configuration: the hook name will be used by default; relatives file are based on `/etc/
|
1760
|
+
"description": "filename to be executed on interface configuration: the hook name will be used by default; relatives file are based on `/etc/ifstate/hooks`",
|
1761
1761
|
"type": "string",
|
1762
1762
|
"minLength": 1
|
1763
1763
|
},
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|