conf: fix bug in config template generation
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 13 Sep 2012 05:41:06 +0000 (08:41 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 13 Sep 2012 06:30:04 +0000 (09:30 +0300)
Use shutil.move() instead of os.rename() which fails if the template
file would be renamed over file system boundaries.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gitbuildsys/conf.py

index dd2a649..547e02e 100644 (file)
@@ -23,6 +23,7 @@ from __future__ import with_statement
 import os
 import ast
 import base64
+import shutil
 from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError, \
                          MissingSectionHeaderError
 
@@ -523,7 +524,7 @@ class BizConfigManager(ConfigMgr):
             with open(tmp.path, 'w') as fhandler:
                 dump_general(fhandler)
                 profile.dump(fhandler)
-            os.rename(tmp.path, os.path.expanduser(fname))
+            shutil.move(tmp.path, os.path.expanduser(fname))
         except IOError, err:
             raise errors.ConfigError(err)