Modify

Ticket #538 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

The invocation of "svn info" should be independant of the locale

Reported by: pratte Owned by: desai
Priority: minor Milestone: Bcfg2 0.9.6 Release
Component: bcfg2-server Version: 0.9.x
Keywords: Cc:

Description

When running with a different locale than C, Bcfg2-server fails to extract the information from SVN when running the "svn info" command :

Apr  8 15:48:37 mjbcfg2 bcfg2-server[12243]: Failed to read svn info; disabling svn support
Apr  8 15:48:37 mjbcfg2 bcfg2-server[12243]: Ran command "svn info /var/lib/bcfg2"
Apr  8 15:48:37 mjbcfg2 bcfg2-server[12243]:  : 12925\n', 'Date de la derni\xc3\xa8re modification: 2008-04-08 11:48:45 -0400 (mar, 08 avr 2008)\n', '\n']
Apr  8 15:48:37 mjbcfg2 bcfg2-server[12243]: 0310-accd-a6771abca7d2\n', 'R\xc3\xa9vision : 12929\n', 'Type de noeud : r\xc3\xa9pertoire\n', 'T\xc3\xa2che programm\xc3\xa9e
 : normale\n', 'Auteur de la derni\xc3\xa8re modification : mjeanson\n', 'R\xc3\xa9vision de la derni\xc3\xa8re modification
Apr  8 15:48:37 mjbcfg2 bcfg2-server[12243]: Got output: ['Chemin : /var/lib/bcfg2\n', 'URL : https://svn.revolutionlinux.com/svn/Revolution/trunk/Sysadmin/Bcfg2\n', 'Raci
ne du d\xc3\xa9p\xc3\xb4t : https://svn.revolutionlinux.com/svn/Revolution\n', 'UUID du d\xc3\xa9p\xc3\xb4t : cd69993d-71d5-

The "svn info" command must be executed in the "C" locale. Here is a patch to fix this :

--- Core.py.orig        2008-04-08 15:51:44.527610640 -0400
+++ Core.py     2008-04-08 15:52:00.458052636 -0400
@@ -360,7 +360,7 @@
     def read_svn_revision(self):
         '''Read svn revision information for the bcfg2 repository'''
         try:
-            data = os.popen("svn info %s" % (self.datastore)).readlines()
+            data = os.popen("env LC_ALL=C svn info %s" % (self.datastore)).readlines()
             revline = [line.split(': ')[1].strip() for line in data if line[:9] == 'Revision:'][-1]
             self.revision = revline
         except IndexError:

Attachments

Change History

comment:1 Changed 14 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to Bcfg2 0.9.6 Release

Committed in [47c62630727183a15194cadc94000e05f578bdee] (SVN r4492). Thanks for the patch.

-nld

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.