From f2e582be4008633d21ba80a15c20e9748ec011df Mon Sep 17 00:00:00 2001 From: mprahl Date: Jul 18 2019 15:46:25 +0000 Subject: Support integer values in the optional module-build arguments Signed-off-by: mprahl --- diff --git a/pyrpkg/utils.py b/pyrpkg/utils.py index 37a39e2..8513b7c 100644 --- a/pyrpkg/utils.py +++ b/pyrpkg/utils.py @@ -127,6 +127,13 @@ def validate_module_build_optional(optional_arg): raise argparse.ArgumentTypeError( 'The "{0}" optional argument is reserved to built-in arguments'.format(key)) + # If the user passed in an integer such as a module build ID, then the type + # should be an integer when sent to MBS + try: + value = int(value) + except ValueError: + pass + return (key, value)