Changeset 210

Show
Ignore:
Timestamp:
08/01/08 16:51:50 (4 months ago)
Author:
pwh
Message:
  • Handle the case where the specified bridge was not found - and don't overwrite variables
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/controllers/bridge_management_controller.rb

    r200 r210  
    6161    # Parse the STP root bridge address and pick out the bridge address 
    6262     
    63     root_bridge = parse_stp_root_bridge_address(params[:stp_root]) 
     63    root_bridge_params = parse_stp_root_bridge_address(params[:stp_root]) 
    6464 
    6565 
    6666    # Find the root bridge 
    6767     
    68     logger.debug "Searching for root bridge with base address='#{root_bridge[2]}'" 
    69     root_bridge = Bridge.find(:first, :conditions => { :dot1d_base_bridge_address => root_bridge[2] }) 
     68    logger.debug "Searching for root bridge with base address='#{root_bridge_params[2]}'" 
     69    root_bridge = Bridge.find(:first, :conditions => { :dot1d_base_bridge_address => root_bridge_params[2] }) 
    7070 
    7171    if root_bridge.nil? 
    72       logger.debug "Root bridge #{root_bridge[2]} not found" 
    73       flash[:notice] = "Spanning Tree root bridge <strong>#{root_bridge[2]}</strong> cannot be found, or you do not have rights to manage." 
     72      logger.debug "Root bridge #{root_bridge_params[2]} not found" 
     73      flash[:notice] = "Spanning Tree root bridge <strong>#{root_bridge_params[2]}</strong> cannot be found, or you do not have rights to manage." 
    7474      redirect_to :back and return 
    7575    end