Ejemplo n.º 1
0
def __update_offline(model, model_context, aliases):
    """
    Offline update orchestration
    :param model: the model
    :param model_context: the model context
    :param aliases: the aliases object
    :raises: DeployException: if an error occurs
    """
    _method_name = '__update_offline'

    domain_home = model_context.get_domain_home()
    __logger.info("WLSDPLY-09010",
                  domain_home,
                  method_name=_method_name,
                  class_name=_class_name)

    __wlst_helper.read_domain(domain_home)

    topology_updater = TopologyUpdater(model,
                                       model_context,
                                       aliases,
                                       wlst_mode=WlstModes.OFFLINE)
    # deleting servers that are added by templates before set server groups causes mayhem
    topology_updater.update_machines_clusters_and_servers(delete_now=False)

    # update rcu schema password must happen before updating jrf domain
    if model_context.get_update_rcu_schema_pass() is True:
        rcu_helper = RCUHelper(model, model_context, aliases)
        rcu_helper.update_rcu_password()

    __update_offline_domain()

    topology_updater.set_server_groups()

    topology_updater.update()

    # Add resources after server groups are established to prevent auto-renaming
    model_deployer.deploy_model_offline(model,
                                        model_context,
                                        aliases,
                                        wlst_mode=__wlst_mode)

    __update_offline_domain()

    model_deployer.deploy_model_after_update(model,
                                             model_context,
                                             aliases,
                                             wlst_mode=__wlst_mode)

    try:
        __wlst_helper.close_domain()
    except BundleAwareException, ex:
        # All the changes are made so don't raise an error that causes the program to indicate
        # a failure...just log the error since the process is going to exit anyway.
        __logger.warning('WLSDPLY-09011',
                         _program_name,
                         ex.getLocalizedMessage(),
                         error=ex,
                         class_name=_class_name,
                         method_name=_method_name)
Ejemplo n.º 2
0
def __update_offline(model, model_context, aliases):
    """
    Offline update orchestration
    :param model: the model
    :param model_context: the model context
    :param aliases: the aliases object
    :raises: DeployException: if an error occurs
    """
    _method_name = '__update_offline'

    domain_home = model_context.get_domain_home()
    __logger.info("WLSDPLY-09010",
                  domain_home,
                  method_name=_method_name,
                  class_name=_class_name)

    __wlst_helper.read_domain(domain_home)

    topology_updater = TopologyUpdater(model,
                                       model_context,
                                       aliases,
                                       wlst_mode=WlstModes.OFFLINE)
    topology_updater.update()

    model_deployer.deploy_model_offline(model,
                                        model_context,
                                        aliases,
                                        wlst_mode=__wlst_mode)

    try:
        __wlst_helper.update_domain()
    except BundleAwareException, ex:
        __close_domain_on_error()
        raise ex
Ejemplo n.º 3
0
def __update_offline(model, model_context, aliases):
    """
    Offline update orchestration
    :param model: the model
    :param model_context: the model context
    :param aliases: the aliases object
    :raises: DeployException: if an error occurs
    """
    _method_name = '__update_offline'

    domain_home = model_context.get_domain_home()
    __logger.info("WLSDPLY-09010",
                  domain_home,
                  method_name=_method_name,
                  class_name=_class_name)

    __wlst_helper.read_domain(domain_home)

    topology_updater = TopologyUpdater(model,
                                       model_context,
                                       aliases,
                                       wlst_mode=WlstModes.OFFLINE)
    topology_updater.update()

    model_deployer.deploy_model_offline(model,
                                        model_context,
                                        aliases,
                                        wlst_mode=__wlst_mode)
    if model_context.get_update_rcu_schema_pass() is True:
        rcu_helper = RCUHelper(model, model_context, aliases)
        rcu_helper.update_rcu_password()

    __update_offline_domain()

    topology_updater.set_server_groups()

    __update_offline_domain()

    model_deployer.deploy_model_after_update(model,
                                             model_context,
                                             aliases,
                                             wlst_mode=__wlst_mode)

    try:
        __wlst_helper.close_domain()
    except BundleAwareException, ex:
        # All the changes are made so don't raise an error that causes the program to indicate
        # a failure...just log the error since the process is going to exit anyway.
        __logger.warning('WLSDPLY-09011',
                         _program_name,
                         ex.getLocalizedMessage(),
                         error=ex,
                         class_name=_class_name,
                         method_name=_method_name)
Ejemplo n.º 4
0
    # Server or Cluster may be added, this is to make sure they are targeted properly
    topology_updater.set_server_groups()

    # Calling set_server_groups has a side effect, it throws itself out of the edit tree.
    # If it is not in edit tree then save in
    #  __check_update_require_domain_restart will fail
    #  Restart the edit session to compensate

    try:
        __wlst_helper.edit()
        __wlst_helper.start_edit()
    except BundleAwareException, ex:
        raise ex

    try:
        topology_updater.update()
        model_deployer.deploy_resources(model,
                                        model_context,
                                        aliases,
                                        wlst_mode=__wlst_mode)
        deployer_utils.delete_online_deployment_targets(
            model, aliases, __wlst_mode)
    except DeployException, de:
        deployer_utils.release_edit_session_and_disconnect()
        raise de

    exit_code = deployer_utils.online_check_save_activate(model_context)
    # if user requested cancel changes if restart required stops

    if exit_code != CommandLineArgUtil.PROG_CANCEL_CHANGES_IF_RESTART_EXIT_CODE:
        model_deployer.deploy_applications(model,