X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tools%2Ftic-core;h=0bc0f7fe9bd7c0d477a0726adae6cf3f95c5099a;hb=2f62aa0447d31804018059837e012c783b003c42;hp=176313edbac2aa31a11b060abd77b61705af5939;hpb=25bf2d440f8de0e7648e7c937e0f998d0a46504a;p=archive%2F20170607%2Ftools%2Ftic-core.git diff --git a/tools/tic-core b/tools/tic-core index 176313e..0bc0f7f 100644 --- a/tools/tic-core +++ b/tools/tic-core @@ -1,14 +1,11 @@ #!/usr/bin/python -# Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved. +# Copyright (c) 2016 Samsung Electronics Co., Ltd # -# Contact: -# @author Chulwoo Shin -# -# Licensed under the Apache License, Version 2.0 (the "License"); +# Licensed under the Flora License, Version 1.1 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://floralicense.org/license/ # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -30,6 +27,7 @@ from tic.utils import log from tic.utils import file from tic.utils import error from tic.server import tic_server +from tic.config import configmgr __version__ = 0.1 __date__ = '2016-11-07' @@ -63,8 +61,8 @@ def create_parser(): parser_create.add_argument('-k', "--ks", dest="kickstart", metavar="kickstart", help="ks file to be used for image creation") parser_create.add_argument('-o', "--outdir", dest="outdir", action="store", help="image output directory", default=os.getcwd()) - parser_start = subparsers.add_parser('start', help='start the tic-core demon on system. port 8082 is used by default ') - parser_start.add_argument('-p', "--port", dest="port", action="store", help="port number", default=8082) + parser_start = subparsers.add_parser('start', help='start the tic-core demon on system.') + parser_start.add_argument('-p', "--port", dest="port", action="store", help="port number") return parser @@ -92,6 +90,8 @@ def main(argv): else: logger.info('kickstart or recipes file is required') elif args.subparser_name == 'start': + if not args.port: + args.port = configmgr.server['port'] tic_server.start(args.port) return 0 except KeyboardInterrupt: @@ -99,9 +99,9 @@ def main(argv): return 0 except error.TICError as err: logger.error(err) -# except Exception as ex: -# logger.error(ex) -# return 2 + except Exception as ex: + logger.error(ex) + return 2 if __name__ == "__main__": log.setup('tic')