Skip to content

Commit

Permalink
Python 2/3 agnostic dict iteration in update_ks_app.py (#3107)
Browse files Browse the repository at this point in the history
* python 2/3 agnostic dict iteration

* use dict.items instead of keys
  • Loading branch information
JohnPaton authored and k8s-ci-robot committed Apr 26, 2019
1 parent 0d9d435 commit 0446fac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/upgrade_ks_app.py
Expand Up @@ -57,12 +57,12 @@ def main():
registries = app['registries']
libraries = app['libraries']

for name in registries.iterkeys():
for name, reg in registries.items():
if name != registry_name:
logging.info("Skipping registry %s", name)
continue

if registries[name]["uri"].startswith("file"):
if reg["uri"].startswith("file"):
# File registries are not stored in .ksonnet
# TODO(jlewi): This messes with bootstrapper because we might want to
# switch from using the file URI to using the git location.
Expand All @@ -75,8 +75,8 @@ def main():
shutil.rmtree(target)

libs_to_remove = []
for name in libraries.iterkeys():
lib_registry = libraries[name]["registry"]
for name, lib in libraries.items():
lib_registry = lib["registry"]
if lib_registry != registry_name:
continue
libs_to_remove.append(name)
Expand Down

0 comments on commit 0446fac

Please sign in to comment.