| | 155 | |
|---|
| | 156 | # Show information about this bridge group |
|---|
| | 157 | |
|---|
| | 158 | def show_bridge_group |
|---|
| | 159 | |
|---|
| | 160 | |
|---|
| | 161 | # Check that we've been given a valid root bridge ID |
|---|
| | 162 | |
|---|
| | 163 | if !params[:root_bridge] |
|---|
| | 164 | flash[:notice] = "No root bridge was specified." |
|---|
| | 165 | redirect_to :back and return |
|---|
| | 166 | end |
|---|
| | 167 | |
|---|
| | 168 | |
|---|
| | 169 | # Retrieve all the bridges in this bridge group |
|---|
| | 170 | |
|---|
| | 171 | begin |
|---|
| | 172 | @bridges = Bridge.find(:all, :conditions => { :dot1d_stp_designated_root => params[:root_bridge] }) |
|---|
| | 173 | rescue ActiveRecord::RecordNotFound |
|---|
| | 174 | flash[:notice] = "The bridge specified was not found, or you are not allowed to view its information." |
|---|
| | 175 | redirect_to :back and return |
|---|
| | 176 | end |
|---|
| | 177 | |
|---|
| | 178 | |
|---|
| | 179 | # Retrieve the root bridge |
|---|
| | 180 | |
|---|
| | 181 | begin |
|---|
| | 182 | @root_bridge = Bridge.find(:first, :conditions => { :dot1d_base_bridge_address => parse_stp_root_bridge_address(params[:root_bridge])[2] }) |
|---|
| | 183 | end |
|---|
| | 184 | |
|---|
| | 185 | end |
|---|
| | 186 | |
|---|