mirror of
https://github.com/puppetlabs/vmpooler-provider-gce.git
synced 2026-01-26 03:18:41 -05:00
in the upstream vmpooler code, we use the global domain parameter, so naming that parameter the same in GCE. This parameter can be optionally set in the provider config, and overwrites the global parameter. It is used to infer the FQDN as .
38 lines
799 B
Ruby
38 lines
799 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'simplecov'
|
|
SimpleCov.start do
|
|
add_filter '/spec/'
|
|
end
|
|
require 'helpers'
|
|
require 'rspec'
|
|
require 'vmpooler'
|
|
require 'redis'
|
|
require 'vmpooler/metrics'
|
|
require 'computeservice_helper'
|
|
require 'dnsservice_helper'
|
|
|
|
def project_root_dir
|
|
File.dirname(File.dirname(__FILE__))
|
|
end
|
|
|
|
def fixtures_dir
|
|
File.join(project_root_dir, 'spec', 'fixtures')
|
|
end
|
|
|
|
def create_google_client_error(status_code, message, reason = 'notFound')
|
|
Google::Apis::ClientError.new(Google::Apis::ClientError, status_code: status_code, body: '{
|
|
"error": {
|
|
"code": ' + status_code.to_s + ',
|
|
"message": "' + message + '",
|
|
"errors": [
|
|
{
|
|
"message": "' + message + '",
|
|
"domain": "global",
|
|
"reason": "' + reason + '"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
')
|
|
end
|