Skip to content

Commit

Permalink
perftune.py: make sure config file existing before write
Browse files Browse the repository at this point in the history
Currently if the config file to set mask is invalid, the script won't
exit, and irq won't be set as expected. This patch added a sanity check
before writing config file.

Signed-off-by: Amos Kong <[email protected]>
Message-Id: <fda5d5425c819252060b28e495ff94989d53fb2a.1526630708.git.amos@scylladb.com>
  • Loading branch information
amoskong authored and tgrabiec committed May 24, 2018
1 parent 772ba66 commit a8f5b85
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/perftune.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def fwriteln_and_log(fname, line):
double_commas_pattern = re.compile(',,')

def set_one_mask(conf_file, mask):
if not os.path.exists(conf_file):
raise Exception("Configure file to set mask doesn't exist: {}".format(conf_file))
mask = re.sub('0x', '', mask)

while double_commas_pattern.search(mask):
Expand Down

0 comments on commit a8f5b85

Please sign in to comment.