diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-05-11 15:14:13 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-05-14 08:09:34 +0200 |
commit | 5646509aea6b43ef1efb282aad908289cc005b26 (patch) | |
tree | 12084133502bee8855a5c8deedf113f3e04cb8fa /resources/tools/presentation/specification_parser.py | |
parent | 632c598ddc0e2a4586c85a3cd627f8c1eaee981a (diff) |
CSIT-1078: Optimize input data files download and processing
Change-Id: Id1b0af996c4b77878621cfc8c262795f51e537fc
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/specification_parser.py')
-rw-r--r-- | resources/tools/presentation/specification_parser.py | 53 |
1 files changed, 2 insertions, 51 deletions
diff --git a/resources/tools/presentation/specification_parser.py b/resources/tools/presentation/specification_parser.py index af4d707613..ebd84530a3 100644 --- a/resources/tools/presentation/specification_parser.py +++ b/resources/tools/presentation/specification_parser.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Cisco and/or its affiliates. +# Copyright (c) 2018 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -49,7 +49,6 @@ class Specification(object): self._specification = {"environment": dict(), "configuration": dict(), - "debug": dict(), "static": dict(), "input": dict(), "output": dict(), @@ -95,15 +94,6 @@ class Specification(object): return self._specification["static"] @property - def debug(self): - """Getter - debug - - :returns: Debug specification - :rtype: dict - """ - return self._specification["debug"] - - @property def is_debug(self): """Getter - debug mode @@ -425,43 +415,6 @@ class Specification(object): self.configuration["data-sets"][set_name][job] = builds logging.info("Done.") - def _parse_debug(self): - """Parse debug specification in the specification YAML file. - """ - - if int(self.environment["configuration"]["CFG[DEBUG]"]) != 1: - return None - - logging.info("Parsing specification file: debug ...") - - idx = self._get_type_index("debug") - if idx is None: - self.environment["configuration"]["CFG[DEBUG]"] = 0 - return None - - try: - for key, value in self._cfg_yaml[idx]["general"].items(): - self._specification["debug"][key] = value - - self._specification["input"]["builds"] = dict() - for job, builds in self._cfg_yaml[idx]["builds"].items(): - if builds: - self._specification["input"]["builds"][job] = list() - for build in builds: - self._specification["input"]["builds"][job].\ - append({"build": build["build"], - "status": "downloaded", - "file-name": self._replace_tags( - build["file"], - self.environment["paths"])}) - else: - logging.warning("No build is defined for the job '{}'. " - "Trying to continue without it.". - format(job)) - - except KeyError: - raise PresentationError("No data to process.") - def _parse_input(self): """Parse input specification in the specification YAML file. @@ -664,9 +617,7 @@ class Specification(object): self._parse_env() self._parse_configuration() - self._parse_debug() - if not self.debug: - self._parse_input() + self._parse_input() self._parse_output() self._parse_static() self._parse_elements() |