'Read information and transform it
The values that are returned by BIG-IP in the f5-sdk can have encoding
attached to them as well as be completely missing in some cases.
Therefore, this method will transform the data from the BIG-IP into a
format that is more easily consumable by the rest of the class and the
parameters that are supported by the module.
:return: List of values currently stored in BIG-IP, formatted for use
in this class.'

def read(self):

    p = dict()
    name = self.params['name']
    partition = self.params['partition']
    r = self.api.tm.net.selfips.selfip.load(name=name, partition=partition)
    if hasattr(r, 'address'):
        p['route_domain'] = str(None)
        if ('%' in r.address):
            ipaddr = []
            ipaddr = r.address.split('%', 1)
            rdmask = ipaddr[1].split('/', 1)
            r.address = ('%s/%s' % (ipaddr[0], rdmask[1]))
            p['route_domain'] = str(rdmask[0])
        ipnet = IPNetwork(r.address)
        p['address'] = str(ipnet.ip)
        p['netmask'] = str(ipnet.netmask)
    if hasattr(r, 'trafficGroup'):
        p['traffic_group'] = str(r.trafficGroup)
    if hasattr(r, 'vlan'):
        p['vlan'] = str(r.vlan)
    if hasattr(r, 'allowService'):
        if (r.allowService == 'all'):
            p['allow_service'] = set(['all'])
        else:
            p['allow_service'] = set([str(x) for x in r.allowService])
    else:
        p['allow_service'] = set(['none'])
    p['name'] = name
    return p
