summaryrefslogtreecommitdiff
path: root/cloudinit/cmd/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/cmd/main.py')
-rw-r--r--cloudinit/cmd/main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
index 30b37fe1..d2f1b778 100644
--- a/cloudinit/cmd/main.py
+++ b/cloudinit/cmd/main.py
@@ -421,7 +421,13 @@ def di_report_warn(datasource, cfg):
LOG.debug("no di_report found in config.")
return
- dicfg = cfg.get('di_report', {})
+ dicfg = cfg['di_report']
+ if dicfg is None:
+ # ds-identify may write 'di_report:\n #comment\n'
+ # which reads as {'di_report': None}
+ LOG.debug("di_report was None.")
+ return
+
if not isinstance(dicfg, dict):
LOG.warning("di_report config not a dictionary: %s", dicfg)
return