From 3cf243ec3e6469cee1b1bd5993451fd09206a98d Mon Sep 17 00:00:00 2001 From: Chris Gardner Date: Thu, 30 May 2013 08:39:11 +0100 Subject: [PATCH] TODO: Separate IPv4 and IPv6 --- system/setup | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/system/setup b/system/setup index 9244f120cc6..fb50bbfb47a 100644 --- a/system/setup +++ b/system/setup @@ -1403,22 +1403,6 @@ class DarwinNetwork(GenericBsdIfconfigNetwork, Network): current_if['media_options'] = self.get_options(words[3]) -class SunOSNetwork(GenericBsdIfconfigNetwork, Network): - """ - This is the SunOS Network Class. - It uses the GenericBsdIfconfigNetwork unchanged - """ - platform = 'SunOS' - - # Solaris displays single digit octets in MAC addresses e.g. 0:1:2:d:e:f - # Add leading zero to each octet where needed. - def parse_ether_line(self, words, current_if, ips): - macaddress = '' - for octet in words[1].split(':'): - octet = ('0' + octet)[-2:None] - macaddress += (octet + ':') - current_if['macaddress'] = macaddress[0:-1] - class FreeBSDNetwork(GenericBsdIfconfigNetwork, Network): """ This is the FreeBSD Network Class. @@ -1437,6 +1421,29 @@ class OpenBSDNetwork(GenericBsdIfconfigNetwork, Network): def parse_lladdr_line(self, words, current_if, ips): current_if['macaddress'] = words[1] +class SunOSNetwork(GenericBsdIfconfigNetwork, Network): + """ + This is the SunOS Network Class. + It uses the GenericBsdIfconfigNetwork unchanged + """ + platform = 'SunOS' + + # TODO: + # Solaris 10 duplicates entries with 'ifconfig -a' so IPv6 clobbers IPv4. + # Override get_interfaces_info() and run it twice for IPv4 and IPv6 like + # in get_default_interfaces(). + # Need to push FLAGS inside ipv4[] and ipv6[] facts as they may differ. + # Possibly others too (e.g. mtu). + + # Solaris displays single digit octets in MAC addresses e.g. 0:1:2:d:e:f + # Add leading zero to each octet where needed. + def parse_ether_line(self, words, current_if, ips): + macaddress = '' + for octet in words[1].split(':'): + octet = ('0' + octet)[-2:None] + macaddress += (octet + ':') + current_if['macaddress'] = macaddress[0:-1] + class Virtual(Facts): """ This is a generic Virtual subclass of Facts. This should be further