PAL: Clean the code 54/10454/8
authorTibor Frank <tifrank@cisco.com>
Thu, 8 Feb 2018 08:46:20 +0000 (09:46 +0100)
committerTibor Frank <tifrank@cisco.com>
Thu, 1 Mar 2018 12:39:10 +0000 (12:39 +0000)
Change-Id: I7aa196cdc7bf4d34c1313f8f811ab3f6dd8f10f2
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/input_data_parser.py
resources/tools/presentation/static_content.py

index e1763b9..203a3bf 100644 (file)
@@ -866,7 +866,7 @@ class InputData(object):
 
         except (KeyError, IndexError, ValueError) as err:
             logging.error("   Missing mandatory parameter in the element "
-                          "specification.", err)
+                          "specification: {0}".format(err))
             return None
         except AttributeError:
             return None
index fe2d072..a02330c 100644 (file)
@@ -34,8 +34,11 @@ def prepare_static_content(spec):
     content.
     """
 
-    src = spec.static["src-path"]
-    dst = spec.static["dst-path"]
+    src = spec.static.get("src-path", None)
+    dst = spec.static.get("dst-path", None)
+    if src is None or dst is None:
+        logging.warning("No static content specified, skipping")
+        return
 
     # Copy all the static content to the build directory:
     logging.info("Copying the static content ...")

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.