Provide grains from the SmartOS metadata

def mdata():
    '''
    Provide grains from the SmartOS metadata
    '''
    grains = {}
    mdata_list = salt.utils.path.which('mdata-list')
    mdata_get = salt.utils.path.which('mdata-get')

    grains = salt.utils.dictupdate.update(grains, _user_mdata(mdata_list, mdata_get), merge_lists=True)
    grains = salt.utils.dictupdate.update(grains, _sdc_mdata(mdata_list, mdata_get), merge_lists=True)
    ## remove _legacy_grains in Neon
    grains = _legacy_grains(grains)

    return grains