Commit c6fb9e8c authored by Marco Mariani's avatar Marco Mariani

also provide single ip values

parent 33142459
...@@ -64,6 +64,10 @@ class Recipe(object): ...@@ -64,6 +64,10 @@ class Recipe(object):
Set of IPv4 addresses. Set of IPv4 addresses.
ipv6 ipv6
Set of IPv6 addresses. Set of IPv6 addresses.
ipv4_random
One of the IPv4 addresses.
ipv6_random
One of the IPv6 addresses.
tap tap
Set of TAP interfaces. Set of TAP interfaces.
configuration configuration
...@@ -109,6 +113,13 @@ class Recipe(object): ...@@ -109,6 +113,13 @@ class Recipe(object):
# XXX: emit warning on unknown address type ? # XXX: emit warning on unknown address type ?
options['ipv4'] = ipv4_set options['ipv4'] = ipv4_set
options['ipv6'] = ipv6_set options['ipv6'] = ipv6_set
# also export single ip values for those recipes that don't support sets.
if ipv4_set:
options['ipv4_random'] = list(ipv4_set)[0]
if ipv6_set:
options['ipv6_random'] = list(ipv6_set)[0]
options['tap'] = tap_set options['tap'] = tap_set
options['configuration'] = parameter_dict options['configuration'] = parameter_dict
match = self.OPTCRE_match match = self.OPTCRE_match
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment