ifstate 1.11.5__tar.gz → 1.11.7__tar.gz

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.
Files changed (41) hide show
  1. {ifstate-1.11.5 → ifstate-1.11.7}/PKG-INFO +1 -1
  2. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate.egg-info/PKG-INFO +1 -1
  3. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/__init__.py +1 -1
  4. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/link/base.py +10 -8
  5. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/netns/__init__.py +4 -1
  6. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/wireguard/__init__.py +8 -1
  7. {ifstate-1.11.5 → ifstate-1.11.7}/LICENSE +0 -0
  8. {ifstate-1.11.5 → ifstate-1.11.7}/README.md +0 -0
  9. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate/__init__.py +0 -0
  10. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate/ifstate.py +0 -0
  11. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate/shell.py +0 -0
  12. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate/vrrp.py +0 -0
  13. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate.egg-info/SOURCES.txt +0 -0
  14. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate.egg-info/dependency_links.txt +0 -0
  15. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate.egg-info/entry_points.txt +0 -0
  16. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate.egg-info/requires.txt +0 -0
  17. {ifstate-1.11.5 → ifstate-1.11.7}/ifstate.egg-info/top_level.txt +0 -0
  18. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/address/__init__.py +0 -0
  19. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/bpf/__init__.py +0 -0
  20. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/bpf/ctypes.py +0 -0
  21. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/bpf/map.py +0 -0
  22. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/brport/__init__.py +0 -0
  23. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/exception.py +0 -0
  24. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/fdb/__init__.py +0 -0
  25. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/link/__init__.py +0 -0
  26. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/link/physical.py +0 -0
  27. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/link/tun.py +0 -0
  28. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/link/veth.py +0 -0
  29. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/log.py +0 -0
  30. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/neighbour/__init__.py +0 -0
  31. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/parser/__init__.py +0 -0
  32. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/parser/base.py +0 -0
  33. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/parser/yaml.py +0 -0
  34. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/routing/__init__.py +0 -0
  35. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/sysctl/__init__.py +0 -0
  36. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/tc/__init__.py +0 -0
  37. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/util.py +0 -0
  38. {ifstate-1.11.5 → ifstate-1.11.7}/libifstate/xdp/__init__.py +0 -0
  39. {ifstate-1.11.5 → ifstate-1.11.7}/schema/ifstate.conf.schema.json +0 -0
  40. {ifstate-1.11.5 → ifstate-1.11.7}/setup.cfg +0 -0
  41. {ifstate-1.11.5 → ifstate-1.11.7}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ifstate
3
- Version: 1.11.5
3
+ Version: 1.11.7
4
4
  Summary: Manage host interface settings in a declarative manner
5
5
  Home-page: https://ifstate.net/
6
6
  Author: Thomas Liske
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ifstate
3
- Version: 1.11.5
3
+ Version: 1.11.7
4
4
  Summary: Manage host interface settings in a declarative manner
5
5
  Home-page: https://ifstate.net/
6
6
  Author: Thomas Liske
@@ -47,7 +47,7 @@ import json
47
47
  import errno
48
48
  import logging
49
49
 
50
- __version__ = "1.11.5"
50
+ __version__ = "1.11.7"
51
51
 
52
52
 
53
53
  class IfState():
@@ -572,20 +572,22 @@ class Link(ABC):
572
572
  # set sysctl settings if required
573
573
  sysctl.apply(self.settings['ifname'], do_apply)
574
574
 
575
+ # set master if required
576
+ if master is not None:
577
+ try:
578
+ self.netns.ipr.link('set', index=self.idx, master=master)
579
+ except Exception as err:
580
+ if not isinstance(err, netlinkerror_classes):
581
+ raise
582
+ excpts.add('set', err, master=master)
583
+
575
584
  # set brport settings if required
576
585
  if self.brport:
577
586
  if self.brport.has_changes(self.idx):
578
587
  self.brport.apply(do_apply, self.idx, excpts)
579
588
 
580
- # set master and state if required
589
+ # set state if required
581
590
  if not excpts.has_op('brport'):
582
- if master is not None:
583
- try:
584
- self.netns.ipr.link('set', index=self.idx, master=master)
585
- except Exception as err:
586
- if not isinstance(err, netlinkerror_classes):
587
- raise
588
- excpts.add('set', err, master=master)
589
591
  if state is not None:
590
592
  try:
591
593
  self.netns.ipr.link('set', index=self.idx, state=state)
@@ -66,7 +66,10 @@ class NetNameSpace():
66
66
  memo[id(self)] = result
67
67
  for k, v in self.__dict__.items():
68
68
  if k == 'ipr':
69
- setattr(result, k, v)
69
+ if self.netns is None:
70
+ setattr(result, k, IPRouteExt())
71
+ else:
72
+ setattr(result, k, NetNSExt(self.netns))
70
73
  else:
71
74
  setattr(result, k, deepcopy(v, memo))
72
75
  return result
@@ -38,7 +38,14 @@ class WireGuard():
38
38
  memo[id(self)] = result
39
39
  for k, v in self.__dict__.items():
40
40
  if k == 'wg':
41
- setattr(result, k, v)
41
+ if self.netns.netns is not None:
42
+ pyroute2.netns.pushns(self.netns.netns)
43
+
44
+ try:
45
+ setattr(result, k, WG())
46
+ finally:
47
+ if self.netns.netns is not None:
48
+ pyroute2.netns.popns()
42
49
  else:
43
50
  setattr(result, k, deepcopy(v, memo))
44
51
  return result
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes