def get_hardware_info():
    """Uses system profiler to get hardware info for this machine."""
    cmd = ["/usr/sbin/system_profiler", "SPHardwareDataType", "-xml"]
    proc = subprocess.Popen(
        cmd,
        shell=False,
        bufsize=-1,
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )
    (output, dummy_error) = proc.communicate()
    try:
        plist = FoundationPlist.readPlistFromString(output)
        # system_profiler xml is an array
        sp_dict = plist[0]
        items = sp_dict["_items"]
        sp_hardware_dict = items[0]
        return sp_hardware_dict
    except BaseException:
        return {}