Mercurial > hg > bzconsole
changeset 51:7189c647270a
make version choosing a bit more resilient
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 19 Dec 2012 16:16:26 -0800 |
parents | 935f8991ebb6 |
children | f961f2002d4e |
files | bzconsole/api.py setup.py |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/bzconsole/api.py Mon Dec 17 12:12:14 2012 -0800 +++ b/bzconsole/api.py Wed Dec 19 16:16:26 2012 -0800 @@ -97,17 +97,17 @@ assert self.username and self.password, "Must be authenticated" # infer version if not given + versions = set(self._configuration['product'][product]['version']) if version is None: - versions = self._configuration['product'][product]['version'] if len(versions) == 1: - version = versions[0] + version = list(versions)[0] else: default_versions = ('unspecified', 'Trunk') for ver in default_versions: - version = ver - if version in self._configuration['product'][product]['version']: + if ver in versions: + version = ver break - assert version in self._configuration['product'][product]['version'], 'Version not found' + assert version in versions, 'Version not found (Available versions for product "%s": %s)' % (product, versions) # create the needed data structure request = dict(product=product, component=component,