INNER CODE UNIT · Ruby

validate

devopsgroup-io/vagrant-digitalocean · lib/vagrant-digitalocean/config.rb:55

      def validate(machine)
        errors = []
        errors << I18n.t('vagrant_digital_ocean.config.token') if !@token

        key = machine.config.ssh.private_key_path
        key = key[0] if key.is_a?(Array)
        if !key
          errors << I18n.t('vagrant_digital_ocean.config.private_key')
        elsif !File.file?(File.expand_path("#{key}.pub", machine.env.root_path))
          errors << I18n.t('vagrant_digital_ocean.config.public_key', {
            :key => "#{key}.pub"
          })
        end

        { 'DigitalOcean Provider' => errors }
      end
    end
  end

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…