1 # ============LICENSE_START=======================================================
2 # csit-dcaegen2-collectors-hv-ves
3 # ================================================================================
4 # Copyright (C) 2018 NOKIA
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18 from robot.api import logger
21 CONSUL_NAME = "Consul"
25 def publish_hv_ves_configuration_in_consul(self, consul_url, consul_configuration_filepath):
26 logger.info("Reading consul configuration file from: " + consul_configuration_filepath)
27 file = open(consul_configuration_filepath, "rb")
31 logger.info("PUT at: " + consul_url)
32 resp = HttpRequests.session_without_env().put(consul_url, data=data, timeout=5)
33 HttpRequests.checkStatusCode(resp.status_code, CONSUL_NAME)