'Switches between active connections using an index or an alias.
Aliases can be given to `Open Connection` keyword which also always
returns the connection index.
This keyword returns the index of previous active connection.
Example:
| `Open Connection`   | myhost.net              |          |           |
| `Login`             | john                    | secret   |           |
| `Write`             | some command            |          |           |
| `Open Connection`   | yourhost.com            | 2nd conn |           |
| `Login`             | root                    | password |           |
| `Write`             | another cmd             |          |           |
| ${old index}=       | `Switch Connection`     | 1        | # index   |
| `Write`             | something               |          |           |
| `Switch Connection` | 2nd conn                |          | # alias   |
| `Write`             | whatever                |          |           |
| `Switch Connection` | ${old index}            | | # back to original |
| [Teardown]          | `Close All Connections` |          |           |
The example above expects that there were no other open
connections when opening the first one, because it used index
``1`` when switching to the connection later. If you are not
sure about that, you can store the index into a variable as
shown below.
| ${index} =          | `Open Connection` | myhost.net |
| `Do Something`      |                   |            |
| `Switch Connection` | ${index}          |            |'

def switch_connection(self, index_or_alias):

    old_index = self._cache.current_index
    self._conn = self._cache.switch(index_or_alias)
    return old_index
