blob: e56f799f70cd5fd3d0e6bbeec690f3cad218d5f5 [file] [log] [blame]
Enbo Wang818f76a2020-03-04 00:42:31 +08001#!/usr/bin/python3
2# ============LICENSE_START=======================================================
3# ONAP - SO
4# ================================================================================
5# Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
6# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END=========================================================
Enbo Wang6ab8b622019-04-23 13:42:21 +000019
20import sys
21import argparse
22import json
Enbo Wang6ab8b622019-04-23 13:42:21 +000023
24import conf
Enbo Wang818f76a2020-03-04 00:42:31 +080025import install_n_e_sw
Enbo Wang6ab8b622019-04-23 13:42:21 +000026
27
28def main():
29 parser = argparse.ArgumentParser()
30
31 parser.add_argument("--swToBeInstalled", help="The NE software to be installed", required=True)
32 parser.add_argument("--neIdentifier", help="The NE where the software can be installed", required=True)
33
34 args = parser.parse_args()
35
Enbo Wang818f76a2020-03-04 00:42:31 +080036 _, ret_value = install_n_e_sw.install(args.swToBeInstalled, args.neIdentifier)
37 print(json.dumps(ret_value))
Enbo Wang6ab8b622019-04-23 13:42:21 +000038
39 if ret_value["result"] == conf.REQ_SUCCESS:
40 sys.exit(conf.RET_CODE_SUCCESS)
41 else:
42 sys.exit(conf.RET_CODE_FAILURE)
43
44
45if __name__ == '__main__':
46 main()