search for: is_destroy

Displaying 7 results from an estimated 7 matches for "is_destroy".

Did you mean: io_destroy
2009 Aug 05
1
[PATCH server] associated nics w/ network base class as it is in the db
...work.rb b/src/app/models/physical_network.rb index 52a748a..f50eeff 100644 --- a/src/app/models/physical_network.rb +++ b/src/app/models/physical_network.rb @@ -17,8 +17,6 @@ # also available at http://www.gnu.org/copyleft/gpl.html. class PhysicalNetwork < Network - has_many :nics - def is_destroyable? nics.empty? end diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb index 217a89c..e34dddc 100644 --- a/src/app/models/vlan.rb +++ b/src/app/models/vlan.rb @@ -19,8 +19,6 @@ class Vlan < Network has_many :bondings - has_many :nics - validates_presence_of :number...
2009 Nov 03
0
[PATCH server] suggest ip address for nics/bondings on edit host/vm network forms
...ble_address(used_addresses) + end end diff --git a/src/app/models/physical_network.rb b/src/app/models/physical_network.rb index f50eeff..17a325e 100644 --- a/src/app/models/physical_network.rb +++ b/src/app/models/physical_network.rb @@ -20,4 +20,10 @@ class PhysicalNetwork < Network def is_destroyable? nics.empty? end + + # generate an ip address for this network based on associated ip and + # addresses already associated w/ nics + def gen_address + super(nics.collect { |n| n.ip_address}) + end end diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb index e34dddc..ca...
2009 Jun 30
0
[PATCH server] permit many-to-many vms / networks relationship
.../app/models/vlan.rb index 2f6acba..cce897d 100644 --- a/src/app/models/vlan.rb +++ b/src/app/models/vlan.rb @@ -19,11 +19,24 @@ class Vlan < Network has_many :bondings + has_many :nics + validates_presence_of :number, :message => 'A number must be specified.' def is_destroyable? - bondings.empty? + bondings.empty? && nics.empty? end + protected + def validate + # ensure that any assigned nics only belong to vms, not hosts + nics.each{ |nic| + if nic.parent.class == Host + errors.add("nics", "must only be assig...
2009 May 15
0
[PATCH server] use service layer for Network controller.
...nd + end + + end diff --git a/src/app/models/physical_network.rb b/src/app/models/physical_network.rb index 6923e40..52a748a 100644 --- a/src/app/models/physical_network.rb +++ b/src/app/models/physical_network.rb @@ -18,4 +18,8 @@ class PhysicalNetwork < Network has_many :nics + + def is_destroyable? + nics.empty? + end end diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb index f7889f4..2f6acba 100644 --- a/src/app/models/vlan.rb +++ b/src/app/models/vlan.rb @@ -21,4 +21,9 @@ class Vlan < Network validates_presence_of :number, :message => 'A number must...
2009 May 15
0
[PATCH server] final cleanup for service layer refactoring.
...VmService # === Required permissions # [<tt>Privilege::MODIFY</tt>] for the Vm's VmResourcePool def svc_destroy(id) - # from before_filter - @vm = Vm.find(id) - authorized!(Privilege::MODIFY, @vm.vm_resource_pool) + lookup(id,Privilege::MODIFY) unless @vm.is_destroyable? raise ActionError.new("Virtual Machine must be stopped to delete it") @@ -205,8 +200,7 @@ module VmService # === Required permissions # [<tt>Privilege::MODIFY</tt>] for the Vm's VmResourcePool def svc_cancel_queued_tasks(id) - @vm = Vm.find(id) -...
2009 Jul 24
1
permit many-to-many vms / networks relationship redux
redux patchset permitting a vm to be associated with multiple networks and vice-versa. updated patchset so as to be applicable against current oVirt server HEAD these patches may be applied in any order, they all need to be pushed together
2009 Jul 09
2
permit many-to-many vms / networks relationship
This patchset contains changes to the ovirt server frontend, backend, and tests components, permitting vms to be associated with multiple networks and vice versa. Also included are two patches which are required for the frontend bits; a patch adding collapsable sections to the vm form, which in itself depends on the second patch that provides default values for the cpu and memory vm table fields