Merge pull request #112 from olysonek/tuned-adm
tuned-adm: Fix a traceback when run without action specified
This commit is contained in:
commit
1cb0c11ac4
1 changed files with 5 additions and 4 deletions
|
|
@ -94,16 +94,17 @@ if __name__ == "__main__":
|
|||
parser_profile_mode = subparsers.add_parser("profile_mode", help="show current profile selection mode")
|
||||
parser_profile_mode.set_defaults(action="profile_mode")
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
parser.print_usage(file = sys.stderr)
|
||||
sys.exit(1)
|
||||
args = parser.parse_args(sys.argv[1:])
|
||||
|
||||
options = vars(args)
|
||||
debug = options.pop("debug")
|
||||
asynco = options.pop("async")
|
||||
timeout = options.pop("timeout")
|
||||
action_name = options.pop("action")
|
||||
try:
|
||||
action_name = options.pop("action")
|
||||
except KeyError:
|
||||
parser.print_usage(file = sys.stderr)
|
||||
sys.exit(1)
|
||||
log_level = options.pop("loglevel")
|
||||
result = False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue