Esempio n. 1
0
def main():
    set_fabric_common_env()
    env.eagerly_disconnect = True
    logger = logging.getLogger(__name__)
    logger.setLevel(logging.INFO)
    # create a file handler

    handler = logging.FileHandler('task_coredump.log')
    handler.setLevel(logging.INFO)
    # create a logging format

    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    handler.setFormatter(formatter)
    # add the handlers to the logger

    logger.addHandler(handler)
    # game_server = 'gcmob_feiliu_10001'
    beanstalk_ip = '10.6.199.35'
    async_task = task(beanstalk_ip)

    # 创建子进程重连
    # p = Process(target=async_task.reconnect, args=(logger,))
    # p.start()
    # 创建子线程重连
    # t = threading.Thread(target=async_task.reconnect,
                         args=(logger,), name='LoopThread')
Esempio n. 2
0
def main(args):
    global REGION

    set_fabric_common_env()
    game = args.game
    REGION = args.language

    if args.s_server and args.t_server and args.sequence and args.restart:
        sequence = args.sequence
        restart = args.restart

        s_server = '{}_{}'.format(game, args.s_server)
        t_server = '{}_{}'.format(game, args.t_server)

        source_server = GameServer(s_server)
        target_server = GameServer(t_server)

        single_merge(source_server, target_server, sequence, restart=restart)

        print('Done!')

    elif args.file:
        file = args.file
        bundle_merge(file)

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 3
0
def main():
    set_fabric_common_env()
    env.eagerly_disconnect = True
    parser = argparse.ArgumentParser(description='每日审计新服,并发送报告.')
    parser.add_argument('-g', dest='game', help='game; eg: gcmob')
    args = parser.parse_args()
    html_all = audit_new(args)
    send_mail(html_all)
Esempio n. 4
0
def dns(args):
    set_fabric_common_env()

    if args.detail:
        print_help()

    elif args.game and args.action and args.domain and args.line and args.ip:
        dnsapi(args.game, args.action, args.domain, args.line, args.ip)

    else:
        print_help()
Esempio n. 5
0
def dns(args):
    set_fabric_common_env()
    
    if args.detail:
        print_help()
    
    elif args.game and args.action and args.domain and args.line and args.ip:
        dnsapi(args.game, args.action, args.domain, args.line, args.ip)

    else:
        print_help()
def main(args):
    if args.game and args.language:
        set_fabric_common_env()

        game = args.game
        region = args.language
        sync(game, region)
        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 7
0
def main(args):
    if args.game and args.language:
        set_fabric_common_env()

        game = args.game
        region = args.language
        sync(game, region)
        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 8
0
def main(args):
    if args.game and args.language and args.version:
        set_fabric_common_env()

        game = args.game
        region = args.language
        version = args.version
        web_www_incremental_update(game, region, version)
        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
def main(args):
    if args.game and args.language and args.version:
        set_fabric_common_env()

        game = args.game
        region = args.language
        version = args.version
        web_www_incremental_update(game, region, version)
        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 10
0
def main(args):
    if args.game and args.language and args.version and args.type:
        set_fabric_common_env()

        game = args.game
        region = args.language
        version = args.version
        type = args.type
        update_exec(game, region, version, type)
        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 11
0
def main(args):
    if args.game and args.language and args.component and args.game_env:
        set_fabric_common_env()

        game = args.game
        region = args.language
        component = args.component.strip()
        game_env = args.game_env

        mobile_static_resources(game, region, component, game_env)

        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 12
0
def main(args):
    if args.game and args.language and args.component and args.game_env:
        set_fabric_common_env()

        game = args.game
        region = args.language
        component = args.component.strip()
        game_env = args.game_env

        mobile_static_resources(game, region, component, game_env)

        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 13
0
def main(args):
    if args.game and args.language and args.version and args.scope and args.game_env and args.mode:
        set_fabric_common_env()

        game = args.game
        region = args.language
        version = args.version.strip()
        scopes = args.scope.strip().split(',')
        game_env = args.game_env
        mode = args.mode

        mobile_www_release(game, region, version, scopes, game_env, mode=mode)

        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
def main(args):
    if args.game and args.language and args.filename and args.scope and args.key and args.value:
        set_fabric_common_env()

        gateway = args.gateway
        if gateway != 'No':
            env.gateway = gateway

        game = args.game
        region = args.language
        scopes = args.scope.strip().split(',')
        filename = args.filename.strip()
        option_name = args.key
        option_value = args.value

        modify_mobile_www_config(game, region, scopes, filename, option_name, option_value)

        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
Esempio n. 15
0
def main(args):
    if args.game and args.language and args.version:
        set_fabric_common_env()

        game = args.game
        region = args.language
        version = args.version.strip()
        #TODO
        print('Done!')

    elif args.game and args.language:
        set_fabric_common_env()

        game = args.game
        region = args.language

        clean_up_diff_packages(game, region)
        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)
def main(args):
    if args.game and args.language and args.filename and args.scope and args.key and args.value:
        set_fabric_common_env()

        gateway = args.gateway
        if gateway != 'No':
            env.gateway = gateway

        game = args.game
        region = args.language
        scopes = args.scope.strip().split(',')
        filename = args.filename.strip()
        option_name = args.key
        option_value = args.value

        modify_mobile_www_config(game, region, scopes, filename, option_name,
                                 option_value)

        print('Done!')

    else:
        print('Use "-h" to see the command-line options')
        sys.exit(1)