Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def bash_transform(code, content):
return execute_bash(code, content)
def fetch_by_script(conf):
code = conf['script']
try:
python_code = code['python']
except (KeyError, TypeError):
# Not a python script
pass
else:
return fetch_by_python(python_code, conf)
try:
# Explicit notation:
bash_script = code['bash']
except (KeyError, TypeError):
bash_script = code
# Pass something to stdin to disable sanity check:
return execute_bash(
bash_script,
conf.get('name', 'dummy'),
)
def __call__(self, report):
execute_bash(self.code, report)