def METHOD_NAME(cmd, env=None, timeout_secs=60, ignore_error=False):
    '''Helper function to execute command and return stripped output'''
    cmd = [str(c) for c in cmd]
    p = sp.run(cmd, env=env, timeout=timeout_secs, encoding='UTF-8', stdout=sp.PIPE, stderr=sp.PIPE)
    if p.returncode != 0 and not ignore_error:
        raise CommandError(cmd, p)
    elif p.returncode != 0:
        return ''
    return p.stdout.strip()