Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give easyblocks the possibility to choose maxhits for run_cmd_qa #1417

Merged
merged 2 commits into from Oct 8, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions easybuild/tools/run.py
Expand Up @@ -130,7 +130,7 @@ def run_cmd(cmd, log_ok=True, log_all=False, simple=False, inp=None, regexp=True
return parse_cmd_output(cmd, stdouterr, ec, simple, log_all, log_ok, regexp)


def run_cmd_qa(cmd, qa, no_qa=None, log_ok=True, log_all=False, simple=False, regexp=True, std_qa=None, path=None):
def run_cmd_qa(cmd, qa, no_qa=None, log_ok=True, log_all=False, simple=False, regexp=True, std_qa=None, path=None, maxhits=50):
"""
Executes a command cmd
- looks for questions and tries to answer based on qa dictionary
Expand Down Expand Up @@ -227,7 +227,7 @@ def check_answers_list(answers):
else:
runLog = None

maxHitCount = 50
maxHitCount = maxhits
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mind renaming this to max_hit_count while you're at it (we're trying to get rid of CamelCase throughout the whole codebase)?

or rather, just use maxhits wherever maxHitCount is used now, there's no need to define another variable for the same thing (since the value doesn't change afaik?)


try:
p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT, stdin=PIPE, close_fds=True, executable="/bin/bash")
Expand Down