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>
import os
import ast
import base64
+import shutil
from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError, \
MissingSectionHeaderError
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)