Skip to content

Commit

Permalink
Fix syntax issue for python3
Browse files Browse the repository at this point in the history
In python3, dict.keys() returns a 'dict_keys' object which
does not support indexing.

JIRA: COMPOSE-3732
  • Loading branch information
hlin committed Aug 2, 2019
1 parent b7b36c5 commit 6155b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions product_listings_manager/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ def getProductListings(productLabel, buildInfo):
listings.setdefault(variant, {}).setdefault(rpm['nvr'], {}).setdefault(rpm['arch'], []).append(dest_arch)

for variant in listings.keys():
nvrs = listings[variant].keys()
nvrs = list(listings[variant].keys())
# BREW-260: Read allow_src_only flag for the product/version
allow_src_only = Products.get_srconly_flag(productLabel, version)
if len(nvrs) == 1:
maps = listings[variant][nvrs[0]].keys()
maps = list(listings[variant][nvrs[0]].keys())
# BREW-260: check for allow_src_only flag added
if len(maps) == 1 and maps[0] == 'src' and not allow_src_only:
del listings[variant]
Expand Down

0 comments on commit 6155b94

Please sign in to comment.