summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-06-05 05:54:42 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-06-05 05:55:48 -0500
commit3ba28dce51eebe94e37e3555c240d999e0c10e09 (patch)
tree9455ac80860a58d9d3546aa82fd9b6ee82c5f4ff
parent5dbca666092d679935bb7dacf339c929f3c12114 (diff)
downloadbcfg2-3ba28dce51eebe94e37e3555c240d999e0c10e09.tar.gz
bcfg2-3ba28dce51eebe94e37e3555c240d999e0c10e09.tar.bz2
bcfg2-3ba28dce51eebe94e37e3555c240d999e0c10e09.zip
importscript: Fix client added message and log level
-rwxr-xr-xsrc/lib/Bcfg2/Server/Reports/importscript.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/importscript.py b/src/lib/Bcfg2/Server/Reports/importscript.py
index 3f9f5ec35..18500f0c1 100755
--- a/src/lib/Bcfg2/Server/Reports/importscript.py
+++ b/src/lib/Bcfg2/Server/Reports/importscript.py
@@ -95,8 +95,8 @@ def load_stats(sdata, encoding, vlevel, logger, quick=False, location=''):
def load_stat(client_name, statistics, encoding, vlevel, logger, quick, location):
client, created = Client.objects.get_or_create(name=client_name)
- if vlevel > 0:
- logger.info("Client %s added to db" % name)
+ if created and vlevel > 0:
+ logger.info("Client %s added to db" % client_name)
timestamp = datetime(*strptime(statistics.get('time'))[0:6])
ilist = Interaction.objects.filter(client=client,
@@ -238,7 +238,7 @@ if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
Bcfg2.Logger.setup_logging('importscript.py',
True,
- syslog)
+ syslog, level=logging.INFO)
cf = ConfigParser.ConfigParser()
cf.read([cpath])