Syntax error.
[nodemanager.git] / conf_files.py
index 8b0119f..fd926a5 100644 (file)
@@ -28,15 +28,13 @@ class conf_files:
 
     def system(self, cmd):
         if not self.noscripts and cmd:
-            logger.log('conf_files: running command %s' % cmd)
+            logger.verbose('conf_files: running command %s' % cmd)
             return tools.fork_as(None, os.system, cmd)
         else: return 0
 
     def update_conf_file(self, cf_rec):
         if not cf_rec['enabled']: return
         dest = cf_rec['dest']
-        # XXX Remove once old Node Manager is out of service
-        if dest == '/etc/proper/propd.conf': return
         err_cmd = cf_rec['error_cmd']
         mode = string.atoi(cf_rec['file_permissions'], base=8)
         try:
@@ -57,11 +55,13 @@ class conf_files:
             url += "node_id=%d"%tools.node_id()
         else:
             logger.log('%s -- WARNING, cannot add node_id to request'%dest)
-        # replace @SLICEFAMILY@ with what's stored on the node
+        # pass slicefamily as well, as stored in /etc/planetlab/slicefamily ont the node
         if tools.slicefamily():
-            url = url.replace("@SLICEFAMILY@",tools.slicefamily())
+            if url.find('?') >0: url += '&'
+            else:                url += '?'
+            url += "slicefamily=%s"%tools.slicefamily()
         try:
-            logger.log("retrieving URL=%s"%url)
+            logger.verbose("retrieving URL=%s"%url)
             contents = curlwrapper.retrieve(url, self.config.cacert)
         except xmlrpclib.ProtocolError,e:
             logger.log('conf_files: failed to retrieve %s from %s, skipping' % (dest, url))