'Static method to get all PVs on a system.
:param root_helper: root_helper to use for execute
:param vg_name: optional, gathers info for only the specified VG
:returns: List of Dictionaries with PV info'

@staticmethod
def get_all_physical_volumes(root_helper, vg_name=None):

    field_sep = '|'
    cmd = (LVM.LVM_CMD_PREFIX + ['pvs', '--noheadings', '--unit=g', '-o', 'vg_name,name,size,free', '--separator', field_sep, '--nosuffix'])
    if LVM.supports_pvs_ignoreskippedcluster(root_helper):
        cmd.append('--ignoreskippedcluster')
    (out, _err) = putils.execute(root_helper=root_helper, run_as_root=True, *cmd)
    pvs = out.split()
    if (vg_name is not None):
        pvs = [pv for pv in pvs if (vg_name == pv.split(field_sep)[0])]
    pv_list = []
    for pv in pvs:
        fields = pv.split(field_sep)
        pv_list.append({'vg': fields[0], 'name': fields[1], 'size': float(fields[2]), 'available': float(fields[3])})
    return pv_list
