--- a/pvl/hosts/host.py Thu Feb 26 16:24:00 2015 +0200
+++ b/pvl/hosts/host.py Thu Feb 26 16:36:46 2015 +0200
@@ -112,7 +112,7 @@
forward=None, reverse=None,
down=None,
boot=None,
- **extensions
+ extensions=None,
) :
"""
Return a Host initialized from data attributes.
@@ -134,7 +134,7 @@
reverse = parse_str(reverse),
down = parse_bool(down),
boot = boot,
- extensions = extensions
+ extensions = extensions,
)
def __init__ (self, name, domain,
--- a/pvl/hosts/tests.py Thu Feb 26 16:24:00 2015 +0200
+++ b/pvl/hosts/tests.py Thu Feb 26 16:36:46 2015 +0200
@@ -85,6 +85,22 @@
'ethernet.eth0': 'bar',
})
+ def testApplyHostConfigExtensions(self):
+ host = config.apply_host(self.options, 'foo', 'test', {
+ 'link:50': 'foo@test',
+ 'link:uplink.49': 'bar@test',
+ })
+
+ self.assertHostEqual(host, 'foo@test', dict(
+ extensions = {
+ 'link': {
+ '50': 'foo@test',
+ 'uplink': { '49': 'bar@test' },
+ },
+ },
+ ))
+
+
class TestZoneMixin(object):
def assertZoneEquals(self, rrs, expected):
gather = { }