Module: check_mk
Branch: master
Commit: f56ea2012d261f97d68f6a1451dd50411cf15a78
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f56ea2012d261f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jun 27 08:42:58 2014 +0200
FIX Fix exception when using pretty-print output format
---
.werks/1005 | 8 ++++++++
ChangeLog | 1 +
modules/inventory.py | 3 +--
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.werks/1005 b/.werks/1005
new file mode 100644
index 0000000..3e7dc71
--- /dev/null
+++ b/.werks/1005
@@ -0,0 +1,8 @@
+Title: Fix exception when using pretty-print output format
+Level: 1
+Component: inv
+Version: 1.2.5i5
+Date: 1403851360
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 6e64040..1692787 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
HW/SW-Inventory:
* 0167 FIX: mk_inventory.linux: Changed field separator from pipe to tab...
+ * 1005 FIX: Fix exception when using pretty-print output format
1.2.5i4:
diff --git a/modules/inventory.py b/modules/inventory.py
index cdbf3a1..f99d127 100644
--- a/modules/inventory.py
+++ b/modules/inventory.py
@@ -152,8 +152,6 @@ def inv_cleanup_tree(tree):
def do_inv(hostnames):
- if inventory_pprint_output:
- import pprint
if not os.path.exists(inventory_output_dir):
os.makedirs(inventory_output_dir)
@@ -244,6 +242,7 @@ def do_inv_for(hostname, ipaddress):
inv_cleanup_tree(g_inv_tree)
if inventory_pprint_output:
+ import pprint
r = pprint.pformat(g_inv_tree)
else:
r = repr(g_inv_tree)