diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-11-30 16:29:54 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-11-30 16:29:54 -0500 |
commit | 9909bfda3397b164d91e7b0ba203651e08be0988 (patch) | |
tree | 71d9240ff0f5f6cc5a0b8cb4a0879b02ece76092 /cloudinit | |
parent | 0c49b065ac888e36edc51958f31691096b90e741 (diff) | |
download | vyos-cloud-init-9909bfda3397b164d91e7b0ba203651e08be0988.tar.gz vyos-cloud-init-9909bfda3397b164d91e7b0ba203651e08be0988.zip |
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
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/CloudConfig/cc_mounts.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |