'NOTE: this code only applies if cobbler is *NOT* set to generate
a dhcp.conf file
Check that dhcpd *appears* to be configured for pxe booting.
We can\'t assure file correctness.  Since a cobbler user might
have dhcp on another server, it\'s okay if it\'s not there and/or
not configured correctly according to automated scans.'

def check_dhcpd_conf(self, status):

    if (not (self.settings.manage_dhcp == 0)):
        return
    if os.path.exists(self.settings.dhcpd_conf):
        match_next = False
        match_file = False
        f = open(self.settings.dhcpd_conf)
        for line in f.readlines():
            if (line.find('next-server') != (-1)):
                match_next = True
            if (line.find('filename') != (-1)):
                match_file = True
        if (not match_next):
            status.append((_('expecting    next-server    entry    in    %(file)s') % {'file': self.settings.dhcpd_conf}))
        if (not match_file):
            status.append((_('missing    file:    %(file)s') % {'file': self.settings.dhcpd_conf}))
    else:
        status.append((_('missing    file:    %(file)s') % {'file': self.settings.dhcpd_conf}))
