backend.helpers¶
-
backend.helpers.
run_cmd
(cmd)[source]¶ Runs given command in a subprocess.
- cmd: list(str)
- command to be executed and its arguments
- munch.Munch(stdout, stderr, returncode)
- executed cmd, standard output, error output, and the return code
-
backend.helpers.
run_ssh
(cmd, user, ip)[source]¶ Runs given command through ssh on a remote machine.
- cmd : list(str)
- command to be executed with ssh
- user: str
- user to connect with
- ip: str
- ip address of the remote machine
- munch.Munch(stdout, stderr, returncode)
- standard output, error output, and the return code from ssh
-
backend.helpers.
wait_log
(log, reason=u"I don't know why.", timeout=5)[source]¶ We need to wait a while, this should happen only when copr converges to boot-up/restart/..
-
class
backend.helpers.
SortedOptParser
(usage=None, option_list=None, option_class=<class optparse.Option>, version=None, conflict_handler='error', description=None, formatter=None, add_help_option=True, prog=None, epilog=None)[source]¶ Optparser which sorts the options by opt before outputting –help
-
backend.helpers.
_get_conf
(cp, section, option, default, mode=None)[source]¶ To make returning items from config parser less irritating
Parameters: mode – convert obtained value, possible modes: - None (default): do nothing - “bool” or “boolean” - “int” - “float”
-
backend.helpers.
chroot_to_branch
(chroot)[source]¶ Get a git branch name from chroot. Follow the fedora naming standard.
-
backend.helpers.
register_build_result
(opts=None, failed=False)[source]¶ Remember fails to redis. Successful build resets counter to zero.
Parameters: - opts – BackendConfig, when opts not provided default config location will be used
- failed (boolean) – failure flag
- origin (str) – name of component produced failure, default: builder
-
backend.helpers.
get_redis_connection
(opts)[source]¶ Creates redis client object using backend config
Return type: StrictRedis