diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2012-06-05 05:54:42 -0500 |
---|---|---|
committer | Tim Laszlo <tim.laszlo@gmail.com> | 2012-06-05 05:55:48 -0500 |
commit | 3ba28dce51eebe94e37e3555c240d999e0c10e09 (patch) | |
tree | 9455ac80860a58d9d3546aa82fd9b6ee82c5f4ff /src/lib | |
parent | 5dbca666092d679935bb7dacf339c929f3c12114 (diff) | |
download | bcfg2-3ba28dce51eebe94e37e3555c240d999e0c10e09.tar.gz bcfg2-3ba28dce51eebe94e37e3555c240d999e0c10e09.tar.bz2 bcfg2-3ba28dce51eebe94e37e3555c240d999e0c10e09.zip |
importscript: Fix client added message and log level
Diffstat (limited to 'src/lib')
-rwxr-xr-x | src/lib/Bcfg2/Server/Reports/importscript.py | 6 |
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]) |