cloudsigma / ansible-cloudsigma

Ansible Dynamic Inventory Sources for CloudSigma
GNU General Public License v3.0
4 stars 0 forks source link

Crash when querying servers with manually configured networking #1

Open ravisorg opened 8 years ago

ravisorg commented 8 years ago

$ ./ansiblecs.py --refreshdb

Refreshing host database...
Adding [redacted] to inventory...
Traceback (most recent call last):
  File "./ansiblecs.py", line 80, in <module>
    refresh_db()
  File "./ansiblecs.py", line 47, in refresh_db
    ipv4 = server['runtime']['nics'][0]['ip_v4']['uuid']
TypeError: 'NoneType' object has no attribute '__getitem__'
miguel-cs commented 8 years ago

Hi @ravisorg, thanks for letting us know about this problem, I'll try to replicate the issue.

Could you please mention which OS are you using and the details of your network configuration?

gcbirzan commented 8 years ago

Since the server has no configured IP as far as the system is concerned, it won't be possible to manage it via the API in this way. A simple fix is to just skip those servers, as well as those with no public IP.

ravisorg commented 8 years ago

That is an absolutely valid point, of course :)

Ideally I could specify the IP address(es) in meta variables attached to the server.