Modify

Ticket #1026 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

Chkconfig.Inventory() fails on Fedora15

Reported by: http://jmk226.myopenid.com/ Owned by: desai
Priority: major Milestone: Bcfg2 1.2.0 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc:

Description

Fedora15 client gives this message persistently when running verbose/debug mode:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Bcfg2/Client/Frame.py", line 323, in Install
    tool.Inventory(self.states, [bundle])
  File "/usr/lib/python2.7/site-packages/Bcfg2/Client/Tools/__init__.py", line 143, in Inventory
    self.extra = self.FindExtra()
  File "/usr/lib/python2.7/site-packages/Bcfg2/Client/Tools/Chkconfig.py", line 92, in FindExtra
    self.cmd.run("/sbin/chkconfig --list|grep :on")[1]]
IndexError: list index out of range

Attachments

Change History

comment:1 Changed 12 years ago by http://jmk226.myopenid.com/

chkconfig --list returns:

[[email protected] ~]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
bcfg2           0:off   1:off   2:on    3:on    4:on    5:on    6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:off   3:off   4:off   5:off   6:off
nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off
nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off
nginx           0:off   1:off   2:off   3:off   4:off   5:off   6:off
php-fpm         0:off   1:off   2:off   3:off   4:off   5:off   6:off
postfix         0:off   1:off   2:on    3:on    4:on    5:on    6:off
psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
rpcbind         0:off   1:off   2:on    3:on    4:on    5:on    6:off
rpcgssd         0:off   1:off   2:on    3:on    4:on    5:on    6:off
rpcidmapd       0:off   1:off   2:on    3:on    4:on    5:on    6:off
rpcsvcgssd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

comment:2 Changed 12 years ago by http://jmk226.myopenid.com/

Looks like this is because Fedora puts that lovely note on STDERR so it's not filtered by the grep. Changing the FindExtra? function at the end of Chkconfig.py to the following:

 def FindExtra(self):
        """Locate extra chkconfig Services."""
        allsrv = [line.split()[0] for line in \
                  self.cmd.run("/sbin/chkconfig --list 2>/dev/null|grep :on")[1]]

Prevents the error.

comment:3 Changed 12 years ago by solj

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

Added your fix in 9ecf23244aa27efd2e3e6924a0009ef12bf9fc37. Thanks!

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.