Revision f1a2c140
Added by Dominic Cleal over 8 years ago
app/models/host/managed.rb | ||
---|---|---|
|
||
def clone
|
||
# do not copy system specific attributes
|
||
host = self.deep_clone(:include => [:host_config_groups, :host_classes, :host_parameters],
|
||
host = self.deep_clone(:include => [:config_groups, :host_config_groups, :host_classes, :host_parameters, :lookup_values],
|
||
:except => [:name, :mac, :ip, :uuid, :certname, :last_report])
|
||
self.interfaces.each do |nic|
|
||
host.interfaces << nic.clone
|
Also available in: Unified diff
fixes #8521 - fix classes accessors, copy overrides on host clone
The various 'classes' accessors that are used in the UI for displaying
the Puppet classes tab only really worked for saved objects, so they're
changed to work better on an unsaved cloned object. Tests now check
all associations and UI accessors return consistent results for various
types of class associations.