diff options
author | Matthew Flusche <mflusche@redhat.com> | 2016-10-19 18:10:08 +0000 |
---|---|---|
committer | Matthew Flusche <mflusche@redhat.com> | 2016-10-19 22:19:17 +0000 |
commit | 4fdb0a6a2b355750ae8071e53a74b9257b18eeee (patch) | |
tree | 44ea7032fa922ec7dc4181b5512901da5917a99b /os_net_config/objects.py | |
parent | 191a3b042cf303d70df5badefe9defe81ae4bd6d (diff) |
Add route_options parameter
route_options will append additional options
to route definitions.
Change-Id: I2b70efdd9c6df7ea252576e245fbc0e9c46ea4bd
Diffstat (limited to 'os_net_config/objects.py')
-rw-r--r-- | os_net_config/objects.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/os_net_config/objects.py b/os_net_config/objects.py index 3c67ada..0e5ce08 100644 --- a/os_net_config/objects.py +++ b/os_net_config/objects.py @@ -134,17 +134,20 @@ def _mapped_nics(nic_mapping=None): class Route(object): """Base class for network routes.""" - def __init__(self, next_hop, ip_netmask="", default=False): + def __init__(self, next_hop, ip_netmask="", default=False, + route_options=""): self.next_hop = next_hop self.ip_netmask = ip_netmask self.default = default + self.route_options = route_options @staticmethod def from_json(json): next_hop = _get_required_field(json, 'next_hop', 'Route') ip_netmask = json.get('ip_netmask', "") + route_options = json.get('route_options', "") default = strutils.bool_from_string(str(json.get('default', False))) - return Route(next_hop, ip_netmask, default) + return Route(next_hop, ip_netmask, default, route_options) class Address(object): |