proc AssignPorts {ixChassisIp {portList None}} { # This Proc assigns physical ports to vpors. # # With the ixChassis IP, this proc discover all the ports or # you could pass in a portList. # # If there is no vports discovered in your configuration, this Proc # expected you to pass in a portList. # # portList: A list of ports in a list format: [list "$ixChassisIp $card $port" ...] set vportList [ixNet getList [ixNet getRoot] vport] if {$vportList == "" && $portList == "None"} { puts "\nError: AssignPorts: The configuration has no vports created and you did not pass" puts "\tin a portList. Don't know how to assign ports. If it's a blank config, you need" puts "\tto pass in a portList" return 1 } puts "\nAssignPorts" if {$vportList == ""} { # vports will be automatically created by ixTclNet::AssignPorts set vportList {} } puts "\tPortList: [list $portList]" puts "\tVportList: [list $vportList]" if {[catch {ixTclNet::AssignPorts $portList {} $vportList true} errMsg]} { puts "\nError: AssignPorts: Port assigning to vport failed or ports not booting up." return 1 } return 0 }