<commit_before>class ServiceTemplateAnsibleTower < ServiceTemplate
  include ServiceConfigurationMixin

  before_save :remove_invalid_resource

  alias_method :job_template, :configuration_script
  alias_method :job_template=, :configuration_script=

  def self.create_catalog_item(options, _auth_user = nil)
    transaction do
      create(options.except(:config_info)) do |service_template|
        config_info = validate_config_info(options)

        service_template.job_template = if config_info[:configuration_script_id]
                                          ConfigurationScript.find(config_info[:configuration_script_id])
                                        else
                                          config_info[:configuration]
                                        end

        service_template.create_resource_actions(config_info)
      end
    end
  end

  def remove_invalid_resource
    # remove the resource from both memory and table
    service_resources.to_a.delete_if { |r| r.destroy unless r.resource(true) }
  end

  def create_subtasks(_parent_service_task, _parent_service)
    # no sub task is needed for this service
    []
  end

  def self.default_provisioning_entry_point(_service_type)
    '/ConfigurationManagement/AnsibleTower/Service/Provisioning/StateMachines/Provision/provision_from_bundle'
  end

  def self.default_reconfiguration_entry_point
    nil
  end

  def self.default_retirement_entry_point
    nil
  end
<commit_msg>Change default provisioning entry point for AutomationManagement.<commit_after>class ServiceTemplateAnsibleTower < ServiceTemplate
  include ServiceConfigurationMixin

  before_save :remove_invalid_resource

  alias_method :job_template, :configuration_script
  alias_method :job_template=, :configuration_script=

  def self.create_catalog_item(options, _auth_user = nil)
    transaction do
      create(options.except(:config_info)) do |service_template|
        config_info = validate_config_info(options)

        service_template.job_template = if config_info[:configuration_script_id]
                                          ConfigurationScript.find(config_info[:configuration_script_id])
                                        else
                                          config_info[:configuration]
                                        end

        service_template.create_resource_actions(config_info)
      end
    end
  end

  def remove_invalid_resource
    # remove the resource from both memory and table
    service_resources.to_a.delete_if { |r| r.destroy unless r.resource(true) }
  end

  def create_subtasks(_parent_service_task, _parent_service)
    # no sub task is needed for this service
    []
  end

  def self.default_provisioning_entry_point(_service_type)
    '/AutomationManagement/AnsibleTower/Service/Provisioning/StateMachines/Provision/provision_from_bundle'
  end

  def self.default_reconfiguration_entry_point
    nil
  end

  def self.default_retirement_entry_point
    nil
  end

{'fraction_non_alphanumeric': 0.051649450183272244, 'fraction_numerical': 0.0, 'mean_word_length': 2.898701298701299, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2548426', 'n_tokens_mistral': 783, 'n_tokens_neox': 756, 'n_words': 156}