review 'print' statements - make sure to use PLC.Debug.log that gets redirected to...
[plcapi.git] / PLC / Methods / GetNodeFlavour.py
index 8e8381d..30a7b8f 100644 (file)
@@ -59,14 +59,14 @@ class GetNodeFlavour(Method):
             for assign in assigns:
                 (left,right)=[x.strip() for x in assign.split(':')]
                 if right not in GetNodeFlavour.known_virts:
-                    print "GetNodeFlavour, unknown 'virt' %s - ignored" % right
+                    print >> log, "GetNodeFlavour, unknown 'virt' %s - ignored" % right
                     continue
                 for fcdistro in [ x.strip() for x in left.split(',')]:
                     map[fcdistro]=right
         except:
-            print "GetNodeFlavour, issue with parsing PLC_FLAVOUR_VIRT_MAP=%s - returning '%s'"%\
+            print >> log, "GetNodeFlavour, issue with parsing PLC_FLAVOUR_VIRT_MAP=%s - returning '%s'"%\
                 (self.api.config.PLC_FLAVOUR_VIRT_MAP,GetNodeFlavour.default_virt)
-            traceback.print_exc()
+            traceback.print_exc(file=log)
             return GetNodeFlavour.default_virt
 #        print 'virt_from_virt_map, using map',map
         if node_fcdistro in map:  return map[node_fcdistro]