1
0
Fork 0

Merge pull request #112 from olysonek/tuned-adm

tuned-adm: Fix a traceback when run without action specified
This commit is contained in:
Jaroslav Škarvada 2018-07-10 12:41:12 +02:00 committed by GitHub
commit 1cb0c11ac4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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