diff --git a/contrib/inventory_builder/inventory.py b/contrib/inventory_builder/inventory.py
index fea4ca0e6653a2f99cdfab3d0ad3b64a1cbcade9..2f02375c6664a6aa22d6a987ffb997bd97c68339 100644
--- a/contrib/inventory_builder/inventory.py
+++ b/contrib/inventory_builder/inventory.py
@@ -86,8 +86,12 @@ class KargoInventory(object):
         self.write_config(self.config_file)
 
     def write_config(self, config_file):
-        with open(config_file, 'w') as f:
-            self.config.write(f)
+        if config_file:
+            with open(config_file, 'w') as f:
+                self.config.write(f)
+        else:
+            print("WARNING: Unable to save config. Make sure you set "
+                  "CONFIG_FILE env var.")
 
     def debug(self, msg):
         if DEBUG: