Abstract checking own address into a function
Currently, we check if we have a given ip address (i.e. it's alive on one of our interfaces) but manually calling TcpPing(source=localhost). This works, but having it spread all over the code makes it hard to change the implementation. The patch abstracts this into a separate utils.OwnIpAddress(addr) function. We add a rpc call for it, which we use instead of the (single-use of) call_node_tcp_ping. We leave node_tcp_ping in, as seems useful and eventually it should be removed in a separate patch. Reviewed-by: imsnah
Showing
- daemons/ganeti-noded 7 additions, 0 deletionsdaemons/ganeti-noded
- lib/backend.py 1 addition, 2 deletionslib/backend.py
- lib/bootstrap.py 2 additions, 4 deletionslib/bootstrap.py
- lib/cmdlib.py 2 additions, 5 deletionslib/cmdlib.py
- lib/rpc.py 11 additions, 0 deletionslib/rpc.py
- lib/utils.py 15 additions, 0 deletionslib/utils.py
- test/ganeti.utils_unittest.py 19 additions, 1 deletiontest/ganeti.utils_unittest.py
Loading
Please register or sign in to comment