CentOS/python-cicoclient

We should be able to "done" a node by hostname or by IP

dmsimard opened this issue · 2 comments

There's nothing preventing us from accepting a hostname or an IP to dispose of a node. We can retrieve the SSID associated to it before submitting the "done".

Worst case, we catch that the API key and the SSID do not match and return an appropriate error.

Hmmm, I was going to implement this but it would be counter-intuitive. cico would find the ssid tied to the server and then release the ssid. This is fine if there is just one server in the ssid but as a user I would not expect this to release the whole ssid if there are multiple servers in the pool. It's better to wait for https://lists.centos.org/pipermail/ci-users/2015-November/000061.html to land and then we can build on that.

Worked around this with a simple bash alias for the time being ...

function destroy() {
  ip=$1
  ssid=$(cico -q inventory -f value -c ip_address -c comment |grep "${ip} " |awk '{print $2}')
  cico node done $ssid
}