Returns a dictionary with a distributed virutal portgroup data


    pg_ref
        Portgroup reference

def _get_dvportgroup_dict(pg_ref):
    '''
    Returns a dictionary with a distributed virutal portgroup data


    pg_ref
        Portgroup reference
    '''
    props = salt.utils.vmware.get_properties_of_managed_object(
        pg_ref, ['name', 'config.description', 'config.numPorts',
                 'config.type', 'config.defaultPortConfig'])
    pg_dict = {'name': props['name'],
               'description': props.get('config.description'),
               'num_ports': props['config.numPorts'],
               'type': props['config.type']}
    if props['config.defaultPortConfig']:
        dpg = props['config.defaultPortConfig']
        if dpg.vlan and \
           isinstance(dpg.vlan,
                      vim.VmwareDistributedVirtualSwitchVlanIdSpec):

            pg_dict.update({'vlan_id': dpg.vlan.vlanId})
        pg_dict.update({'out_shaping':
                        _get_dvportgroup_out_shaping(
                            props['name'],
                            props['config.defaultPortConfig'])})
        pg_dict.update({'security_policy':
                        _get_dvportgroup_security_policy(
                            props['name'],
                            props['config.defaultPortConfig'])})
        pg_dict.update({'teaming':
                        _get_dvportgroup_teaming(
                            props['name'],
                            props['config.defaultPortConfig'])})
    return pg_dict