From 9909bfda3397b164d91e7b0ba203651e08be0988 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 30 Nov 2011 16:29:54 -0500 Subject: do not convert 'None' to a string in cloud-config mounts input. input like: mounts: - [ ephemeral0, /opt , auto, "defaults,noexec" ] - [ swap, null ] would get interpreted as string "None" rather than "None" and an entry for swap would be written to fstab. LP: #898365 --- cloudinit/CloudConfig/cc_mounts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cloudinit/CloudConfig/cc_mounts.py b/cloudinit/CloudConfig/cc_mounts.py index 592a030a..db382f04 100644 --- a/cloudinit/CloudConfig/cc_mounts.py +++ b/cloudinit/CloudConfig/cc_mounts.py @@ -72,8 +72,10 @@ def handle(name,cfg,cloud,log,args): cfgmnt[i][0] = "/dev/%s" % cfgmnt[i][0] # in case the user did not quote a field (likely fs-freq, fs_passno) + # but do not convert None to 'None' (LP: #898365) for j in range(len(cfgmnt[i])): - cfgmnt[i][j]=str(cfgmnt[i][j]) + if isinstance(cfgmnt[i][j], int): + cfgmnt[i][j]=str(cfgmnt[i][j]) for i in range(len(cfgmnt)): # fill in values with defaults from defvals above -- cgit v1.2.3