def read_master_urls()

in tools/jenkins-slave-creation-unix/scripts/deploy/slave-autoconnect.py [0:0]


def read_master_urls(args) -> (str,str):
    try:
        if args.master is not None:
            master = args.master
        else:
            if args.master_file is not None:
                master = read_file_content(file_path=args.master_file,
                                           timeout_seconds=CLOUD_INIT_MAX_WAIT_SECONDS)
                if not master:
                    raise ValueError('{} is empty'.format(args.master_file))
            else:
                raise ValueError('--master_file not specified')

        if args.master_private is not None:
            master_private = args.master_private
        else:
            if args.master_private_file is not None:
                master_private = read_file_content(file_path=args.master_private_file,
                                                   timeout_seconds=CLOUD_INIT_MAX_WAIT_SECONDS)
                if not master_private:
                    raise ValueError('{} is empty'.format(args.master_private_file))
            else:
                raise ValueError('--master_private_file not specified')

        logging.debug('Master: {}    Private: {}'.format(master, master_private))
        return master, master_private
    except:
        logging.exception('Error during reading master URLs')
        rename_instance('read-master-config-error')
        raise