---
snake/machinedb.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/snake/machinedb.py b/snake/machinedb.py
index f9bf26c..e49bb9a 100644
--- a/snake/machinedb.py
+++ b/snake/machinedb.py
@@ -40,12 +40,15 @@ def _loadmachines(dir=None,check=True):
def _writemachine(machine):
'''Write the given Machine object back to the machine
database'''
+ # create machine directory
cfgdir = os.path.join(getoption("machinedb_dir"), str(machine.id))
if not os.path.isdir(cfgdir):
os.mkdir(cfgdir)
+ # create machine config file
cfg = os.path.join(cfgdir, "config")
fp = open(cfg,"w")
+ logging.debug("Writing '%s' ...\n%s\n" % (cfg,
dict(m.config.items("general"))))
machine.config.write(fp)
fp.close()
@@ -106,7 +109,6 @@ def update(id, hwinfo):
else:
m.config.set("general", opt, str(getattr(m, opt)))
- logging.debug("Writing '%s' ...\n%s\n" % (cfg,
dict(m.config.items("general"))))
_writemachine(m)
return True
--
1.5.4.5