Class: Fog::HP::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/hp.rb

Class Method Summary collapse

Class Method Details

.etagObject



230
231
232
# File 'lib/fog/hp.rb', line 230

def self.etag
  Fog::Mock.random_hex(32)
end

.instance_idObject



252
253
254
# File 'lib/fog/hp.rb', line 252

def self.instance_id
  Fog::Mock.random_numbers(6)
end

.ip_addressObject



256
257
258
259
260
261
262
# File 'lib/fog/hp.rb', line 256

def self.ip_address
  ip = []
  4.times do
    ip << Fog::Mock.random_numbers(rand(3) + 1).to_i.to_s # remove leading 0
  end
  ip.join('.')
end

.key_fingerprintObject



234
235
236
237
238
239
240
# File 'lib/fog/hp.rb', line 234

def self.key_fingerprint
  fingerprint = []
  20.times do
    fingerprint << Fog::Mock.random_hex(2)
  end
  fingerprint.join(':')
end

.key_materialObject



242
243
244
245
246
# File 'lib/fog/hp.rb', line 242

def self.key_material
  private_key = OpenSSL::PKey::RSA.generate(1024)
  public_key = private_key.public_key
  return private_key.to_s, public_key.to_s
end

.user_idObject



248
249
250
# File 'lib/fog/hp.rb', line 248

def self.user_id
  "dev_" + Fog::Mock.random_numbers(14)
end