aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/objects.py
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2014-06-09 16:38:34 -0400
committerDan Prince <dprince@redhat.com>2014-06-09 16:38:34 -0400
commitaf110352f8f61f68c4758f2c8c0846f9691e6bf1 (patch)
tree80b11a4f75873f4b6eb4aaf2235c979357cf4d46 /os_net_config/objects.py
parent846e00d0072533e817c3d2248834e3b3ac5cae98 (diff)
Initial ifcfg implementation for interfaces/routes
Ifcfg formatted persistence for interfaces and routes.
Diffstat (limited to 'os_net_config/objects.py')
-rw-r--r--os_net_config/objects.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/os_net_config/objects.py b/os_net_config/objects.py
index 8c1fcd5..455e55f 100644
--- a/os_net_config/objects.py
+++ b/os_net_config/objects.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@@ -20,9 +22,10 @@ class NetworkObjectException(Exception):
class Route(object):
"""Base class for network routes."""
- def __init__(self, netmask_cidr, gateway):
- self.netmask_cidr = netmask_cidr
- self.gateway = gateway
+ def __init__(self, next_hop, ip_netmask="", default=False):
+ self.next_hop = next_hop
+ self.ip_netmask = ip_netmask
+ self.default = default
class Address(object):
@@ -41,10 +44,11 @@ class Interface(object):
"""Base class for network interfaces."""
def __init__(self, name, use_dhcp=False, use_dhcpv6=False, addresses=[],
- mtu=1500):
+ routes=[], mtu=1500):
self.name = name
self.mtu = mtu
self.use_dhcp = use_dhcp
+ self.use_dhcpv6 = use_dhcpv6
self.addresses = addresses
self.bridge = None
self.type = None