host name is added for any number of devices
authorbrendand
Mon, 02 Nov 2009 15:40:32 +0000
changeset 730 9837304abcc6
parent 729 eaa8962bb979
child 731 052cfe4614d7
host name is added for any number of devices
common/tools/ats/ats_specialise_test_drop.pl
--- a/common/tools/ats/ats_specialise_test_drop.pl	Mon Nov 02 15:28:51 2009 +0000
+++ b/common/tools/ats/ats_specialise_test_drop.pl	Mon Nov 02 15:40:32 2009 +0000
@@ -125,13 +125,15 @@
 $test_drop->{'test'}->{'buildid'}->[0] = $build_id, if $build_id;
 
 if ($host_name) { # Also insert specified host name
-	
-	my $device_properties = $test_drop->{'test'}->{'target'}->[0]->{'device'}->[0]->{'property'};
-	my $num_properties = @{$device_properties};
-	$device_properties->[$num_properties]= { 'name' => "HOST", 'value' => "$host_name" };
-	$test_drop->{'test'}->{'target'}->[0]->{'device'}->[0]->{'property'} = $device_properties;
-    #print Dumper($device_properties);
-    #exit(0);		
+	my $devices = $test_drop->{'test'}->{'target'}->[0]->{'device'};
+    
+    foreach my $device (@{$devices}) {
+        my $device_properties = $device->{'property'};
+        my $num_properties = @{$device_properties};
+        
+        $device_properties->[$num_properties] = { 'name' => "HOST", 'value' => "$host_name" };
+        $device->{'property'} = $device_properties;
+    }
 }
 
 if ($srctype =~ /^\.xml$/i ) { # Input file was XML