From 44296915aa9a97ddfcfc3b8ff161826232a18852 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Mon, 18 Sep 2023 12:14:28 +0200 Subject: [PATCH] Implements: #1505 --- IM/tosca/Tosca.py | 2 ++ requirements-tests.txt | 3 ++- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/IM/tosca/Tosca.py b/IM/tosca/Tosca.py index 9f7b426fe..f4f008026 100644 --- a/IM/tosca/Tosca.py +++ b/IM/tosca/Tosca.py @@ -4,6 +4,7 @@ import copy import operator import requests +import requests_cache import json import re from toscaparser.nodetemplate import NodeTemplate @@ -41,6 +42,7 @@ class Tosca: logger = logging.getLogger('InfrastructureManager') def __init__(self, yaml_str, verify=True): + requests_cache.install_cache('tosca_cache', cache_control=True) Tosca.logger.debug("TOSCA: %s" % yaml_str) self.yaml = yaml.safe_load(yaml_str) if not verify: diff --git a/requirements-tests.txt b/requirements-tests.txt index bffc28f8c..60573b552 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -33,4 +33,5 @@ psutil scar nose mock -coverage \ No newline at end of file +coverage +requests-cache \ No newline at end of file diff --git a/setup.py b/setup.py index 86d4cb48e..5a4e24ffa 100644 --- a/setup.py +++ b/setup.py @@ -70,5 +70,5 @@ install_requires=["ansible >=2.4", "paramiko >= 1.14", "PyYAML", suds_pkg, sqlite_pkg, "cheroot", "boto >= 2.29", "apache-libcloud >= 3.2.0", "RADL >= 1.1.5", "bottle", "netaddr", "requests >= 2.19", "scp", "tosca-parser", 'defusedxml', 'urllib3>=1.23', 'hvac', - 'psutil', 'scar'] + 'psutil', 'scar', 'requests-cache >= 1.0.0'] )