summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-08-19 21:11:52 +0000
committerHolger Levsen <holger@layer-acht.org>2015-08-19 23:17:53 +0200
commitb033ad579894fb9178c9d6690a246d433d767639 (patch)
tree8adc02b251804b7e23c8a3af5663d487142316fb /bin
parent3dfdc40bf58e17b33e384f5f73d110953d659285 (diff)
downloadjenkins.debian.net-b033ad579894fb9178c9d6690a246d433d767639.tar.xz
reproducible: remote_scheduler: rearrange the argparse bits to really print all option in -h
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_remote_scheduler.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index 7faab162..19f92fa4 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -21,16 +21,9 @@ parser = argparse.ArgumentParser(
' issue AND that status AND that date". Blacklisted package '
"can't be selected by a filter, but needs to be explitely listed"
' in the package list.')
+parser.add_argument('--dry-run', action='store_true')
parser.add_argument('--null', action='store_true', help='The arguments are '
'considered null-separated and coming from stding')
-
-null_args = parser.parse_known_args()[0]
-if null_args.null:
- input_args = sys.stdin.read().split('\0')
-else:
- input_args = sys.argv
-
-parser.add_argument('--dry-run', action='store_true')
parser.add_argument('-k', '--keep-artifacts', action='store_true',
help='Save artifacts (for further offline study)')
parser.add_argument('-n', '--notify', action='store_true',
@@ -55,7 +48,9 @@ parser.add_argument('-s', '--suite', required=False,
help='Specify the suite to schedule in')
parser.add_argument('packages', metavar='package', nargs='*',
help='list of packages to reschedule')
-scheduling_args = parser.parse_known_args(args=input_args)[0]
+scheduling_args = parser.parse_known_args()[0]
+if scheduling_args.null:
+ scheduling_args = parser.parse_lmown_args(sys.stdin.read().split('\0'))
# these are here as an hack to be able to parse the command line
from reproducible_common import *