Skip to content

Commit

Permalink
powertop2tuned: use default user profile path from the consts
Browse files Browse the repository at this point in the history
Fixes redhat-performance#701

Signed-off-by: Jaroslav Škarvada <[email protected]>
  • Loading branch information
yarda committed Nov 3, 2024
1 parent 35eed3c commit 83e2c88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions experiments/powertop2tuned.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
except ImportError:
from HTMLParser import HTMLParser
from htmlentitydefs import name2codepoint
import tuned.consts as consts


SCRIPT_SH = """#!/bin/bash
Expand Down Expand Up @@ -319,7 +320,7 @@ def generate(self, new_profile, merge_profile, enable_tunings):
parser = argparse.ArgumentParser(description='Creates TuneD profile from Powertop HTML output.')
parser.add_argument('profile', metavar='profile_name', type=str, nargs='?', help='Name for the profile to be written.')
parser.add_argument('-i', '--input', metavar='input_html', type=str, help='Path to Powertop HTML report. If not given, it is generated automatically.')
parser.add_argument('-o', '--output', metavar='output_directory', type=str, help='Directory where the profile will be written, default is /etc/tuned/profile_name directory.')
parser.add_argument('-o', '--output', metavar='output_directory', type=str, help='Directory where the profile will be written, default is %s/profile_name directory.' % consts.USER_PROFILES_DIR)
parser.add_argument('-n', '--new-profile', action='store_true', help='Creates new profile, otherwise it merges (include) your current profile.')
parser.add_argument('-m', '--merge-profile', action = 'store', help = 'Merges (includes) the specified profile (can be suppressed by -n option).')
parser.add_argument('-f', '--force', action='store_true', help='Overwrites the output directory if it already exists.')
Expand All @@ -333,7 +334,7 @@ def generate(self, new_profile, merge_profile, enable_tunings):
sys.exit(-1)

if not args['output']:
args['output'] = "/etc/tuned"
args['output'] = consts.USER_PROFILES_DIR

if args['profile']:
args['output'] = os.path.join(args['output'], args['profile'])
Expand Down

0 comments on commit 83e2c88

Please sign in to comment.