Project

General

Profile

« Previous | Next » 

Revision ff61accf

Added by Ohad Levy almost 12 years ago

  • ID ff61accf873d0920258da126caea1ef72e45924b

fixes #1752 - fixes clone from keeping internal data (such as vm external uuid).

View differences:

app/models/host.rb
read_attribute(:root_pass) || hostgroup.try(:root_pass) || Setting[:root_pass]
end
def clone
new = super
new.puppetclasses = puppetclasses
# Clone any parameters as well
host_parameters.each{|param| new.host_parameters << HostParameter.new(:name => param.name, :value => param.value, :nested => true)}
# clear up the system specific attributes
[:name, :mac, :ip, :uuid, :certname, :last_report, :sp_mac, :sp_ip, :sp_name, :puppet_status, ].each do |attr|
new.send "#{attr}=", nil
end
new
end
private
# align common mac and ip address input
def normalize_addresses

Also available in: Unified diff