From 19de74773d1e946c73161ac0d819812613463e47 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Wed, 6 Jun 2012 18:47:53 -0400 Subject: [PATCH 03/22] in taginfo command, avoid passing (recently added) event opts unless needed (otherwise we get an error from older servers on plain taginfo commands) --- cli/koji | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cli/koji b/cli/koji index c292f0f..01ca322 100755 --- a/cli/koji +++ b/cli/koji @@ -4104,13 +4104,15 @@ def anon_handle_taginfo(options, session, args): parser.error(_("Please specify a tag")) assert False activate_session(session) - event = koji.util.eventFromOpts(session, options) or {} + event = koji.util.eventFromOpts(session, options) + event_opts = {} if event: event['timestr'] = time.asctime(time.localtime(event['ts'])) print "Querying at event %(id)i (%(timestr)s)" % event + event_opts['event'] = event['id'] perms = dict([(p['id'], p['name']) for p in session.getAllPerms()]) for tag in args: - info = session.getTag(tag, event=event.get('id')) + info = session.getTag(tag, **event_opts) if info is None: print "No such tag: %s\n" % tag continue @@ -4124,8 +4126,8 @@ def anon_handle_taginfo(options, session, args): if session.mavenEnabled(): print "Maven support?: %s" % (info['maven_support'] and 'yes' or 'no') print "Include all Maven archives?: %s" % (info['maven_include_all'] and 'yes' or 'no') - dest_targets = session.getBuildTargets(destTagID=info['id'], event=event.get('id')) - build_targets = session.getBuildTargets(buildTagID=info['id'], event=event.get('id')) + dest_targets = session.getBuildTargets(destTagID=info['id'], **event_opts) + build_targets = session.getBuildTargets(buildTagID=info['id'], **event_opts) repos = {} if not event: for target in dest_targets + build_targets: @@ -4149,13 +4151,13 @@ def anon_handle_taginfo(options, session, args): print "Targets that build from this tag:" for target in build_targets: print " %s" % target['name'] - external_repos = session.getTagExternalRepos(tag_info=info['id'], event=event.get('id')) + external_repos = session.getTagExternalRepos(tag_info=info['id'], **event_opts) if external_repos: print "External repos:" for rinfo in external_repos: print " %(priority)3i %(external_repo_name)s (%(url)s)" % rinfo print "Inheritance:" - for parent in session.getInheritanceData(tag, event=event.get('id')): + for parent in session.getInheritanceData(tag, **event_opts): flags = '' for code,expr in ( ('M',parent['maxdepth'] is not None), -- 1.7.11.4