- use invirt.config to get hostnames
[invirt/packages/invirt-base.git] / files / usr / share / python-support / sipb-xen-base / invirt / config.py
index cead926..8648c70 100644 (file)
@@ -1,5 +1,6 @@
 import json
 from invirt.common import *
+from os import rename
 from os.path import getmtime
 
 default_src_path   = '/etc/invirt/master.yaml'
@@ -74,7 +75,7 @@ def load(src_path = default_src_path,
                 try: with_closing(file(cache_path + '.tmp', 'w')) (
                         lambda f: f.write(json.write(ns.cfg)))
                 except: pass # silent failure
-                else: os.rename(cache_path + '.tmp', cache_path)
+                else: rename(cache_path + '.tmp', cache_path)
         except IOError:
             ns.cfg = with_closing(file(src_path)) (
                     lambda f: yaml.load(f, loader))