def start(self, env, upgrade_type=None):
    import params
    env.set_params(params)

    self.configure(env)

    # preparing the WAR file must run after configure since configure writes out
    # oozie-env.sh which is needed to have the right environment directories setup!
    if upgrade_type is not None:
      OozieUpgrade.prepare_warfile()

    oozie_service(action='start', upgrade_type=upgrade_type)
  def start(self, env, rolling_restart=False):
    import params
    env.set_params(params)

    self.configure(env)

    # preparing the WAR file must run after configure since configure writes out
    # oozie-env.sh which is needed to have the right environment directories setup!
    if rolling_restart is True:
      OozieUpgrade.prepare_warfile()

    oozie_service(action='start', rolling_restart=rolling_restart)
  def pre_upgrade_restart(self, env, upgrade_type=None):
    """
    Performs the tasks that should be done before an upgrade of oozie. This includes:
      - backing up configurations
      - running hdp-select and conf-select
      - restoring configurations
      - preparing the libext directory
    :param env:
    :return:
    """
    import params
    env.set_params(params)

    # this function should not execute if the version can't be determined or
    # is not at least HDP 2.2.0.0
    if not params.version or compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') < 0:
      return

    Logger.info("Executing Oozie Server Stack Upgrade pre-restart")

    OozieUpgrade.backup_configuration()

    if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
      conf_select.select(params.stack_name, "oozie", params.version)
      hdp_select.select("oozie-server", params.version)

    OozieUpgrade.restore_configuration()
    OozieUpgrade.prepare_libext_directory()