<commit_before>module VagrantPlugins
  module OpenNebulaProvider
    class Config < Vagrant.plugin('2', :config)
      attr_accessor :endpoint
      attr_accessor :auth
      attr_accessor :username
      attr_accessor :password
      attr_accessor :os_tpl
      attr_accessor :resource_tpl
      attr_accessor :title

      def initialize
        @endpoint = UNSET_VALUE
        @auth = UNSET_VALUE
        @username = ENV['ONE_USER'] || UNSET_VALUE
        @password = ENV['<PASSWORD>'] || UNSET_VALUE
        @os_tpl = UNSET_VALUE
        @resource_tpl = UNSET_VALUE
        @title = UNSET_VALUE
      end

      def finalize!
        @endpoint = nil if @endpoint == UNSET_VALUE
        @auth = 'basic' if @auth == UNSET_VALUE
        @username = nil if @username == UNSET_VALUE
        @password = nil if @password == UNSET_VALUE
        @os_tpl = nil if @os_tpl == UNSET_VALUE
        @resource_tpl = 'small' if @resource_tpl == UNSET_VALUE
        @title = nil if @title == UNSET_VALUE
      end

      def validate(machine)
        errors = []
        errors << I18n.t('opennebula_provider.config.endpoint') unless @endpoint
        errors << I18n.t('opennebula_provider.config.username') unless @username
        errors << I18n.t('opennebula_provider.config.password') unless @password
        errors << I18n.t('opennebula_provider.config.os_tpl') unless @os_tpl

        { 'OpenNebula provider' => errors }
      end
    end
  end
end
<commit_msg>endpoint from env<commit_after>module VagrantPlugins
  module OpenNebulaProvider
    class Config < Vagrant.plugin('2', :config)
      attr_accessor :endpoint
      attr_accessor :auth
      attr_accessor :username
      attr_accessor :password
      attr_accessor :os_tpl
      attr_accessor :resource_tpl
      attr_accessor :title

      def initialize
        @endpoint = ENV['ONE_ENDPOINT'] || UNSET_VALUE
        @auth = UNSET_VALUE
        @username = ENV['ONE_USER'] || UNSET_VALUE
        @password = ENV['<PASSWORD>'] || UNSET_VALUE
        @os_tpl = UNSET_VALUE
        @resource_tpl = UNSET_VALUE
        @title = UNSET_VALUE
      end

      def finalize!
        @endpoint = nil if @endpoint == UNSET_VALUE || @endpoint.empty?
        @auth = 'basic' if @auth == UNSET_VALUE
        @username = nil if @username == UNSET_VALUE
        @password = nil if @password == UNSET_VALUE
        @os_tpl = nil if @os_tpl == UNSET_VALUE
        @resource_tpl = 'small' if @resource_tpl == UNSET_VALUE
        @title = nil if @title == UNSET_VALUE
      end

      def validate(machine)
        errors = []
        errors << I18n.t('opennebula_provider.config.endpoint') unless @endpoint
        errors << I18n.t('opennebula_provider.config.username') unless @username
        errors << I18n.t('opennebula_provider.config.password') unless @password
        errors << I18n.t('opennebula_provider.config.os_tpl') unless @os_tpl

        { 'OpenNebula provider' => errors }
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09631632308212233, 'fraction_numerical': 0.006083136194660358, 'mean_word_length': 2.6185819070904643, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2994133', 'n_tokens_mistral': 924, 'n_tokens_neox': 947, 'n_words': 214}