import json
from invirt.common import *
+from os import rename
from os.path import getmtime
default_src_path = '/etc/invirt/master.yaml'
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))