1 # ============LICENSE_START====================================================
2 # org.onap.vvp/validation-scripts
3 # ===================================================================
4 # Copyright © 2019 AT&T Intellectual Property. All rights reserved.
5 # ===================================================================
7 # Unless otherwise specified, all software contained herein is licensed
8 # under the Apache License, Version 2.0 (the "License");
9 # you may not use this software except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
22 # Unless otherwise specified, all documentation contained herein is licensed
23 # under the Creative Commons License, Attribution 4.0 Intl. (the "License");
24 # you may not use this documentation except in compliance with the License.
25 # You may obtain a copy of the License at
27 # https://creativecommons.org/licenses/by/4.0/
29 # Unless required by applicable law or agreed to in writing, documentation
30 # distributed under the License is distributed on an "AS IS" BASIS,
31 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32 # See the License for the specific language governing permissions and
33 # limitations under the License.
35 # ============LICENSE_END============================================
39 This script will refresh the heat_requirements.json file by pulling the
40 latest version from Nexus.
43 from urllib import request
45 from ice_validator import version
48 f"https://nexus.onap.org/"
49 f"content/sites/raw/org.onap.vnfrqts.requirements/{version.BRANCH}/needs.json"
52 THIS_DIR = os.path.dirname(os.path.abspath(__file__))
55 def get_requirements():
56 """Retrieves the binary JSON content fom REQS_URL"""
57 return request.urlopen(REQS_URL) # nosec
60 def write_file(contents, path):
61 with open(path, "wb") as f:
65 if __name__ == "__main__":
66 reqs = get_requirements().read()
67 write_file(reqs, os.path.join(THIS_DIR, "ice_validator/heat_requirements.json"))