Initial commit
[ta/config-manager.git] / cmframework / src / cmframework / apis / cmupdate.py
1 # Copyright 2019 Nokia
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import logging
16
17 from cmframework.lib.cmupdateimpl import CMUpdateImpl
18
19
20 class CMUpdate(object):
21     def __init__(self, plugins_path, server_ip='config-manager', server_port=61100,
22                  client_lib_impl_module='cmframework.lib.CMClientImpl', verbose_logger=None):
23         logging.info('CMUpdate constructor, plugins_path is %s', plugins_path)
24
25         self._update_lib = CMUpdateImpl(plugins_path,
26                                         server_ip,
27                                         server_port,
28                                         client_lib_impl_module,
29                                         verbose_logger)
30
31     def update(self, confman=None):
32         self._update_lib.update(confman)
33
34     def wait_activation(self):
35         self._update_lib.wait_activation()