This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections.abc import Mapping | |
from collections.abc import Sequence | |
def foo(desire, current): | |
if isinstance(desire, Mapping): | |
return isinstance(current, Mapping) and all( | |
foo(val, current.get(key)) | |
for key, val in desired.items() | |
) | |
elif isinstance(desire, Sequence) and not isinstance( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Laptop2: 198.51.100.1/24 | |
| | |
[Internet] | |
| | |
| [www.example.org eth0: 203.0.113.1/24] | |
+---------------------------------------+ | |
| | | |
| www.example.org (SRV A) | | |
| | | |
+---------------------------------------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
if [[ $1 ]]; then | |
sudo ip link del eth1 | |
sudo ip link del eth2 | |
sudo nmcli c delete eth1 eth2 | |
exit | |
fi | |
sudo ip link add eth1 type veth peer name eth1.ep |
- DNS editing
- Limitations:
- Only support up most 2 name servers
- DNS configure is stored in profile of interface with static default gateway.
- Demos:
- Change DNS setting using examples/dns_edit_eth1.yml
- Remove DNS setting using examples/dns_remove.yml
- Preserve old DNS config with empty state.
- Limitations:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/integration/linux_bridge_test.py b/tests/integration/linux_bridge_test.py | |
index 9609c88..15eae7a 100644 | |
--- a/tests/integration/linux_bridge_test.py | |
+++ b/tests/integration/linux_bridge_test.py | |
@@ -17,6 +17,7 @@ | |
from contextlib import contextmanager | |
from copy import deepcopy | |
+import time | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# _generate_dns_metadata() should be executed before | |
# _generate_route_metadata() as DNS editing might include new interface | |
# into desire_state with name only, the route metadata is required after | |
# that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pytest-3 --log-level=DEBUG --verbose --verbose $@ |