From 57c80e59a9f3b38c4c1dc00fd3e8001b5e2b4283 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 5 Feb 2008 20:56:25 +0000 Subject: Allow listing targets through SSH submit host It required to add a option --list on create-srpm and change repsys submit to use this option. --- RepSys/commands/submit.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'RepSys/commands') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index bd6e01c..f1726dc 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -55,7 +55,7 @@ def parse_options(): parser = OptionParser(help=HELP) parser.defaults["revision"] = "" parser.add_option("-t", dest="target", default="Cooker") - parser.add_option("-l", dest="list", action="store_true") + parser.add_option("-l", action="callback", callback=list_targets) parser.add_option("-r", dest="revision", type="string", nargs=1) parser.add_option("-s", dest="submithost", type="string", nargs=1, default=None) @@ -77,6 +77,16 @@ def parse_options(): raise Error, "provide -l or a revision number" return opts +def list_targets(option, opt, val, parser): + host = config.get("submit", "host") + if host is None: + raise Error, "no submit host defined in repsys.conf" + createsrpm = get_helper("create-srpm") + #TODO make it configurable + command = "ssh %s %s --list" % (host, createsrpm) + execcmd(command, show=True) + sys.exit(0) + def submit(pkgdirurl, revision, target, list=0, define=[], submithost=None): #if not NINZ: # raise Error, "you must have NINZ installed to use this command" -- cgit v1.2.1