Changeset 6463 in genesis for nodes/genesis-to-py.pl
- Timestamp:
- Dec 16, 2008, 9:57:39 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/genesis-to-py.pl
r6439 r6463 13 13 do($ARGV[0]) || die; 14 14 15 my %status_labels = ( up => 'up', down => 'dw', planned => 'pl' ); 16 15 17 $interfaces = join(',',keys %config); 16 18 if ( ($X =~ /\d+/) and ($Y =~ /\d+/) and ($X > 10) and ($Y > 10)) { … … 19 21 $lat = $lon = $h = 0; 20 22 } 23 24 $status = $status_labels{$status} || 'up'; # ensure reporting a correct status 21 25 22 26 print <<EOF; … … 29 33 x = $X 30 34 y = $Y 31 master _ip = $master_ip35 masterip = $master_ip 32 36 nodetype = $nodetype 33 n odename = $nodename37 name = $nodename 34 38 configtype = node 35 39 … … 45 49 'dhcp' => 'no', 46 50 'polar' => 'ver', 47 'type' => ' wireless',51 'type' => '11b', 48 52 'antenna' => 'omni', 49 53 'essid' => 'essid-unused', … … 53 57 if ($key and (lc($key) =~ /^[a-z].*/)) { 54 58 #print "$key : $value\n"; 55 $tmp{lc($key)} = lc($value); 59 $value = lc($value); 60 if ($key =~ /^type$/i) { 61 if ($value eq 'ethernet') { 62 $value = 'eth'; 63 } else { 64 $value = '11b'; 65 } 66 } elsif ($key =~ /^mode$/i) { 67 if ($value eq 'master') { 68 $value = 'ms'; 69 } else { # managed 70 $value = 'mn'; 71 } 72 } 73 $tmp{lc($key)} = $value; 56 74 } 57 75 }
Note:
See TracChangeset
for help on using the changeset viewer.