Ticket #971 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

ipa-server-install can't cope with blank or erroneous lines in /etc/hosts

Reported by: jcholast Owned by: jcholast
Priority: minor Milestone: FreeIPA 2.0.2 RC2 (bug fixing)
Component: Installation Version:
Keywords: Cc:
Blocked By: Blocking:
Affects Documentation: no Patch posted for review: yes
Red Hat Bugzilla: 0 Patch review by:
External tracker: Design link:
Needs UI design: Fedora test page:
Feature: Source:
Expertise:
Release Notes:

Description

ipa-server-install --setup-dns fails with:

2011-02-15 16:15:47,561 DEBUG list index out of range
  File "/usr/sbin/ipa-server-install", line 948, in <module>
    sys.exit(main())

  File "/usr/sbin/ipa-server-install", line 884, in main
    bind.create_instance()

  File "/usr/lib/python2.7/site-packages/ipaserver/install/bindinstance.py", line 300, in create_instance
    if not installutils.record_in_hosts(self.ip_address, self.fqdn):

  File "/usr/lib/python2.7/site-packages/ipaserver/install/installutils.py", line 162, in record_in_hosts
    hosts_ip = line.split()[0]

Change History

comment:1 Changed 3 years ago by jcholast

Example of said /etc/hosts:

1.2.3.4 host # this comment gets parsed as a hostname too!

# the blank line above causes trouble
someuglystuff
# the line above is erroneous and should be ignored

comment:2 Changed 3 years ago by rcritten

  • Owner changed from rcritten to jcholast

comment:3 Changed 3 years ago by rcritten

  • Owner changed from jcholast to rcritten
  • Patch posted for review set
  • Status changed from new to assigned

comment:4 Changed 3 years ago by rcritten

  • Owner changed from rcritten to jcholast
  • Status changed from assigned to new

comment:5 Changed 3 years ago by rcritten

  • Status changed from new to closed
  • Resolution set to fixed

comment:6 Changed 2 years ago by dpal

  • Red Hat Bugzilla set to 0
Note: See TracTickets for help on using tickets.