mirror of
https://github.com/puppetlabs/vmpooler-provider-gce.git
synced 2026-01-26 11:28:41 -05:00
Refactor obtaining and saving ip address
This commit is contained in:
parent
1375093b43
commit
36e9044087
1 changed files with 5 additions and 5 deletions
|
|
@ -206,14 +206,14 @@ module Vmpooler
|
||||||
result = connection.insert_instance(project, zone(pool_name), client)
|
result = connection.insert_instance(project, zone(pool_name), client)
|
||||||
wait_for_operation(project, pool_name, result)
|
wait_for_operation(project, pool_name, result)
|
||||||
created_instance = get_vm(pool_name, new_vmname)
|
created_instance = get_vm(pool_name, new_vmname)
|
||||||
# Exceptions thrown if ip does not exist in preexisting vm? Redis::CommandError: ERR wrong number of arguments for 'hset' command
|
|
||||||
@redis.with_metrics do |redis|
|
|
||||||
ip = created_instance['ip']
|
|
||||||
redis.hset("vmpooler__vm__#{new_vmname}", 'ip', ip)
|
|
||||||
end
|
|
||||||
created_instance
|
created_instance
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_vm_ip_address(vm_name, pool_name)
|
||||||
|
vm_object = get_vm(pool_name, vm_name)
|
||||||
|
return vm_object['ip']
|
||||||
|
end
|
||||||
|
|
||||||
# create_disk creates an additional disk for an existing VM. It will name the new
|
# create_disk creates an additional disk for an existing VM. It will name the new
|
||||||
# disk #{vm_name}-disk#{number_disk} where number_disk is the next logical disk number
|
# disk #{vm_name}-disk#{number_disk} where number_disk is the next logical disk number
|
||||||
# starting with 1 when adding an additional disk to a VM with only the boot disk:
|
# starting with 1 when adding an additional disk to a VM with only the boot disk:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue