Skip empty lines in batch text files
authorMatthews <oliver.matthews@hpe.com>
Wed, 5 Feb 2020 14:20:40 +0000 (14:20 +0000)
committerMatthews <oliver.matthews@hpe.com>
Wed, 5 Feb 2020 14:20:40 +0000 (14:20 +0000)
thingy_grabber.py

index 3e3e4ef..2689021 100755 (executable)
@@ -416,6 +416,9 @@ def do_batch(batch_file, download_dir):
     with open(batch_file) as handle:
         for line in handle:
             line = line.strip()
+            if not line:
+                # Skip empty lines
+                continue
             logging.info("Handling instruction {}".format(line))
             command_arr = line.split()
             if command_arr[0] == "thing":