MCPcopy Create free account
hub / github.com/ForgeRock/forgeops / run_condfail

Function run_condfail

lib/python/utils.py:201–209  ·  view source on GitHub ↗

Wrapper function for run() that ignores failures if selected.

(cmd, *cmdArgs, stdin=None, cstdout=False, cstderr=False, cwd=None, env=None, ignoreFail=False)

Source from the content-addressed store, hash-verified

199 raise(e)
200
201def run_condfail(cmd, *cmdArgs, stdin=None, cstdout=False, cstderr=False, cwd=None, env=None, ignoreFail=False):
202 """Wrapper function for run() that ignores failures if selected."""
203 try:
204 _, rstdout, rstderr = run(cmd, *cmdArgs, stdin=stdin, cstdout=cstdout, cstderr=cstderr, cwd=cwd, env=env)
205 return True, rstdout, rstderr
206 except Exception as e:
207 if ignoreFail:
208 return False, None, None
209 raise(e)
210
211def _waitforresource(ns, resource_type, resource_name):
212 """

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected