diff --git a/IM/tosca/Tosca.py b/IM/tosca/Tosca.py index 9f7b426f..f4f00802 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 bffc28f8..60573b55 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 86d4cb48..5a4e24ff 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'] )