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: Owned by: desai
Priority: major Milestone: Bcfg2 1.1.0 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc:


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 try:

raise SystemExit?(1)



print 'got here' try:

raise SystemExit?(1)

except Exception:


print 'got here' $ python -V Python 2.6.4 $ python 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.


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.


Add a comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.