]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/mass_migrate.py
Flesh out research errors, fix bad merge commit.
[wizard.git] / wizard / command / mass_migrate.py
index a304ff5de6d8d6c73fb31d74c671d75dbc14b937..b3198dcbef2cb9a9f89395bd94f70e5746462453 100644 (file)
@@ -6,6 +6,7 @@ import pwd
 import hashlib
 import errno
 import time
+import itertools
 
 import wizard
 from wizard import deploy, util, shell, sset, command
@@ -23,11 +24,10 @@ def main(argv, baton):
     errors = {}
     i = 0
     # [] needed to workaround subtle behavior of frozenset("")
-    for d in deploy.parse_install_lines([app], options.versions_path):
+    deploys = deploy.parse_install_lines([app], options.versions_path)
+    requested_deploys = itertools.islice(deploys, options.limit)
+    for i, d in enumerate(requested_deploys, 1)
         # check if we want to punt due to --limit
-        i += 1
-        if options.limit and i > options.limit:
-            break
         if d.location in seen:
             continue
         if is_root and not security_check_homedir(d):