-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #9480 - multiple NICs integration with compute profiles
From users point of view: - interfaces setup in compute profiles is back - interface related compute attrs get merged into host NICs upon compute profile selection - NIC overview table displays details in the column "Type" - UI for direct creation of VMs fixed - fixed removing interfaces and volumes from compute profiles From technical point of view: - NIC overview table is always built by js - templates for compute resources got more structure (split to partials "base", "interface", "volume") - compute resources can provide custom implementation of 'providerSpecificNICInfo' function
- Loading branch information
Showing
57 changed files
with
521 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
providerSpecificNICInfo = function(form) { | ||
if (form.find('.libvirt_network').val() == 'network') { | ||
return Jed.sprintf(__('physical @ NAT %s'), form.find('.libvirt_nat').val()); | ||
} else { | ||
return Jed.sprintf(__('physical @ bridge %s'), form.find('.libvirt_bridge').val()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
providerSpecificNICInfo = function(form) { | ||
return form.find('.ovirt_name').val() + ' @ ' + form.find('.ovirt_network').val(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
providerSpecificNICInfo = function(form) { | ||
return form.find('.vmware_type').val() + ' @ ' + form.find('.vmware_network').val(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class InterfaceMerge | ||
def run(interfaces, compute_attrs) | ||
return if compute_attrs.nil? | ||
|
||
vm_interfaces = compute_attrs.vm_interfaces | ||
|
||
# merge with existing | ||
interfaces.select(&:physical?).each do |nic| | ||
vm_nic = vm_interfaces.shift | ||
return if vm_nic.nil? | ||
merge(nic, vm_nic, compute_attrs) | ||
end | ||
|
||
# create additional if there are some attributes left | ||
vm_interfaces.each do |vm_nic| | ||
interfaces << merge(Nic::Managed.new, vm_nic, compute_attrs) | ||
end | ||
end | ||
|
||
private | ||
|
||
def merge(nic, vm_nic, compute_attrs) | ||
nic.compute_attributes = vm_nic | ||
nic.compute_attributes['from_profile'] = compute_attrs.compute_profile.name | ||
nic | ||
end | ||
end |
Oops, something went wrong.