diff options
author | Gonéri Le Bouder <goneri@lebouder.net> | 2019-04-18 16:08:20 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-04-18 16:08:20 +0000 |
commit | 937555fd422edf8235430afab3c0ab69f9e3b3a4 (patch) | |
tree | 4f058ebe6e56f17c490f89da4c5f8a534464afab /cloudinit/util.py | |
parent | 9fc682c9ebbccab5e958eb882636d969be88beb9 (diff) | |
download | vyos-cloud-init-937555fd422edf8235430afab3c0ab69f9e3b3a4.tar.gz vyos-cloud-init-937555fd422edf8235430afab3c0ab69f9e3b3a4.zip |
mount_cb: do not pass sync and rw options to mount
On FreeBSD, mount_cd9660 does not accept the sync option that is enabled
by default. In addition, the sync is only useful with the `rw` mode.
However the `rw` mode was never used.
This patch removes the `rw` and `sync` parameter of `mount_cb` to
simplify the code base and resolve the FreeBSD issue.
LP: #1645824
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 385f231c..ea4199cd 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1679,7 +1679,7 @@ def mounts(): return mounted -def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True, +def mount_cb(device, callback, data=None, mtype=None, update_env_for_mount=None): """ Mount the device, call method 'callback' passing the directory @@ -1726,18 +1726,7 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True, for mtype in mtypes: mountpoint = None try: - mountcmd = ['mount'] - mountopts = [] - if rw: - mountopts.append('rw') - else: - mountopts.append('ro') - if sync: - # This seems like the safe approach to do - # (ie where this is on by default) - mountopts.append("sync") - if mountopts: - mountcmd.extend(["-o", ",".join(mountopts)]) + mountcmd = ['mount', '-o', 'ro'] if mtype: mountcmd.extend(['-t', mtype]) mountcmd.append(device) |