[APACHE] Add Apache CNF use case files
[demo.git] / tutorials / ApacheCNF / automation / update_connectivity_info.py
1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2021 Orange
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # ============LICENSE_END=========================================================
17
18 import logging
19
20 from config import Config, VariablesDict
21 from create_cloud_regions import update_connectivity_info, is_k8s_region
22
23 logger = logging.getLogger()
24 logger.setLevel(logging.DEBUG)
25
26
27 def main():
28     config = Config(env_dict=VariablesDict.env_variable)
29     for region in config.cloud_regions:
30         if is_k8s_region(region):
31             update_connectivity_info(region)
32
33
34 if __name__ == "__main__":
35     sh = logging.StreamHandler()
36     sh_formatter = logging.Formatter('%(asctime)s %(levelname)s %(lineno)d:%(filename)s(%(process)d) - %(message)s')
37     sh.setFormatter(sh_formatter)
38     logger.addHandler(sh)
39
40     main()