~freyes/ubuntu/precise/serverstack-dns/index-out-of-range

Viewing all changes in revision 17.

  • Committer: Felipe Reyes
  • Date: 2016-09-13 17:03:17 UTC
  • Revision ID: felipe.reyes@canonical.com-20160913170317-jjl1z70nfs1hzvp4
Skip empty lines when iterating hosts file

If the hosts file contains empty lines a list index out of range exception
is raised

Traceback (most recent call last):
  File "/usr/bin/serverstack-tenant-dns", line 256, in <module>
    add_current_instances()
  File "/usr/bin/serverstack-tenant-dns", line 144, in add_current_instances
    add_host_entry(hostname, ip_addr, "")
  File "/usr/bin/serverstack-tenant-dns", line 81, in add_host_entry
    hn = _hostname[1]
IndexError: list index out of range

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: