def proc_info(pid, attrs=None):
    '''
    Return a dictionary of information for a process id (PID).

    CLI Example:

    .. code-block:: bash

        salt '*' ps.proc_info 2322
        salt '*' ps.proc_info 2322 attrs='["pid", "name"]'

    pid
        PID of process to query.

    attrs
        Optional list of desired process attributes.  The list of possible
        attributes can be found here:
        http://pythonhosted.org/psutil/#psutil.Process
    '''
    try:
        proc = psutil.Process(pid)
        return proc.as_dict(attrs)
    except (psutil.NoSuchProcess, psutil.AccessDenied, __HOLE__) as exc:
        raise CommandExecutionError(exc)
dataset/ETHPy150Open saltstack/salt/salt/modules/ps.py/proc_info