def getsid(name):
    '''
    Return the sid for this windows service

    CLI Example:

    .. code-block:: bash

        salt '*' service.getsid <service name>
    '''
    cmd = ['sc', 'showsid', name]
    lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
    for line in lines:
        if line in 'SERVICE SID:':
            comps = line.split(':', 1)
            try:
                return comps[1].strip()
            except (AttributeError, IndexError):
                return None
dataset/ETHPy150Open saltstack/salt/salt/modules/win_service.py/getsid/swapped operands of `in`