Modify

Ticket #915 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

lock file does not work with python >= 2.5

Reported by: https://me.yahoo.com/a/2SlxL.p_rsQD.KxOt3q32tWWsQ--#39bec Owned by: desai
Priority: major Milestone: Bcfg2 1.1.0 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc:

Description

The bcfg2 agent uses fatal_error, which raises a SystemExit? exception, to abort after finding a lock file. This code is wrapped in a general try...except block though. In older versions of python, SystemExit? was uncatchable, but that is no longer true. This means that the agent will continue to try to configure the system even if a lock file exists.

For example:

$ cat test.py try:

raise SystemExit?(1)

except:

pass

print 'got here' try:

raise SystemExit?(1)

except Exception:

pass

print 'got here' $ python -V Python 2.6.4 $ python test.py got here $

As you can see, in newer versions of Python SystemExit? does not inherit from Exception, so you can fix the problem by using "except Exception:" instead.

Attachments

Change History

comment:1 Changed 13 years ago by desai

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

comment:2 Changed 13 years ago by solj

  • Milestone changed from Bcfg2 1.2.0 Release to Bcfg2 1.1.0 Release

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.