From 650d62b6fe37c4c9244a920ea32484ea143a5135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 7 Feb 2013 18:34:46 +0100 Subject: [PATCH] Feature #1483: Fix automatic requirements --- src/vm/VirtualMachine.cc | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 890c7088d5..3ef427b906 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -896,8 +896,6 @@ int VirtualMachine::automatic_requirements(string& error_str) vector v_attributes; VectorAttribute * vatt; - vector::iterator it; - ostringstream oss; string requirements; string cluster_id = ""; @@ -907,12 +905,7 @@ int VirtualMachine::automatic_requirements(string& error_str) // Get cluster id from all DISK vector attributes (IMAGE Datastore) - num_vatts = user_obj_template->remove("DISK",v_attributes); - - for (it=v_attributes.begin(); it != v_attributes.end(); it++) - { - obj_template->set(*it); - } + num_vatts = obj_template->get("DISK",v_attributes); for(int i=0; iremove("OS",v_attributes); - - for (it=v_attributes.begin(); it != v_attributes.end(); it++) - { - obj_template->set(*it); - } + num_vatts = obj_template->get("OS",v_attributes); if ( num_vatts > 0 ) { @@ -967,12 +955,7 @@ int VirtualMachine::automatic_requirements(string& error_str) // Get cluster id from all NIC vector attributes v_attributes.clear(); - num_vatts = user_obj_template->remove("NIC",v_attributes); - - for (it=v_attributes.begin(); it != v_attributes.end(); it++) - { - obj_template->set(*it); - } + num_vatts = obj_template->get("NIC",v_attributes); for(int i=0; i