Browse Source

Make the SDM and switch renumbering work for all switches.

Joe Clarke 8 years ago
parent
commit
46e1f124b0
1 changed files with 22 additions and 24 deletions
  1. 22 24
      eem/tm_sw_autoconf.tcl

+ 22 - 24
eem/tm_sw_autoconf.tcl

@@ -135,43 +135,41 @@ if { $config != {} } {
         error $result $errorInfo
     }
 
-    if { [regexp {C3750X} $pid] } {
+    if { [catch {cli_exec $cli(fd) "config t"} result] } {
+        error $result $errorInfo
+    }
+
+    if { [catch {cli_exec $cli(fd) "sdm prefer vlan"} result] } {
+        error $result $errorInfo
+    }
+
+    if { [catch {cli_exec $cli(fd) "end"} result] } {
+        error $result $errorInfo
+    }
+
+    if { [catch {cli_exec $cli(fd) "show switch | inc ^\\*"} result] } {
+        error $result $errorInfo
+    }
+
+    if { [regexp {\*([2-9])} $result -> swn] } {
         if { [catch {cli_exec $cli(fd) "config t"} result] } {
             error $result $errorInfo
         }
 
-        if { [catch {cli_exec $cli(fd) "sdm prefer vlan"} result] } {
+        if { [catch {cli_write $cli(fd) "switch $swn renumber 1"} result] } {
             error $result $errorInfo
         }
 
-        if { [catch {cli_exec $cli(fd) "end"} result] } {
+        if { [catch {cli_read_pattern $cli(fd) "confirm"} result] } {
             error $result $errorInfo
         }
 
-        if { [catch {cli_exec $cli(fd) "show switch | inc ^\\*"} result] } {
+        if { [catch {cli_exec $cli(fd) "\r"} result] } {
             error $result $errorInfo
         }
 
-        if { [regexp {\*([2-9])} $result -> swn] } {
-            if { [catch {cli_exec $cli(fd) "config t"} result] } {
-                error $result $errorInfo
-            }
-
-            if { [catch {cli_write $cli(fd) "switch $swn renumber 1"} result] } {
-                error $result $errorInfo
-            }
-
-            if { [catch {cli_read_pattern $cli(fd) "confirm"} result] } {
-                error $result $errorInfo
-            }
-
-            if { [catch {cli_exec $cli(fd) "\r"} result] } {
-                error $result $errorInfo
-            }
-
-            if { [catch {cli_exec $cli(fd) "end"} result] } {
-                error $result $errorInfo
-            }
+        if { [catch {cli_exec $cli(fd) "end"} result] } {
+            error $result $errorInfo
         }
     }