2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 03:37:47 +00:00

Have ipv6 addresses always be represented as list

IPv6 interfaces tend to emphasize more open ended
use of aliases.  To support this, have ipv6_addresses
manifest as a list, to allow for implementations to
extend to represent more complex situations.

Change-Id: Ia5727ff4830da58f847a7090e45dc819d4f216b2
This commit is contained in:
Jarrod Johnson 2016-03-21 16:42:49 -04:00
parent 69266bc95f
commit ddbbe53f78

View File

@ -541,4 +541,5 @@ class OEMHandler(generic.OEMHandler):
# fall back to a dumber, but more universal formatter
ipv6str = binascii.b2a_hex(ipv6_addr)
ipv6str = ':'.join([ipv6str[x:x+4] for x in xrange(0, 32, 4)])
netdata['ipv6_address'] = '{0}/{1}'.format(ipv6str, ipv6_prefix)
netdata['ipv6_addresses'] = [
'{0}/{1}'.format(ipv6str, ipv6_prefix)]