/usr/lib/ruby/vendor_ruby/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb is in ruby-fog-ecloud 0.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | module Fog
module Compute
class Ecloud
class VirtualMachineAssignedIp < Fog::Ecloud::Model
identity :href
attribute :network, :aliases => :Networks
attribute :address
def id
href.scan(/\d+/)[0]
end
def network=(network)
network = network.dup
network_address = network[:Network]
@network = self.service.networks.new(network_address)
network_id = @network.href.match(/(\d+)$/)[1]
address_ip = network_address[:IpAddresses][:IpAddress]
@address = self.service.ip_addresses.new(
:href => "#{service.base_path}/ipaddresses/networks/#{network_id}/#{address_ip}",
:name => address_ip
)
end
attr_reader :network
def address=(address); end
attr_reader :address
end
end
end
end
|