Skip to content

Commit

Permalink
wmcs-prepare-cinder-volume: use the correct fstype for fstab
Browse files Browse the repository at this point in the history
It was always hardcoding ext4, even if the device had a different
filesystem.

Change-Id: Ib63883f5d45cb7ea5f2710bc20da776aac26b47f
Signed-off-by: David Caro <dcaro@wikimedia.org>
  • Loading branch information
david-caro committed Jun 25, 2021
1 parent 53d0694 commit 340aa63
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/cinderutils/files/wmcs-prepare-cinder-volume.py
Expand Up @@ -159,7 +159,12 @@ def mount_volume(args):
updated_devdict = block_dev_dict()
uuid = updated_devdict[args.device]["uuid"]

fstabline = "UUID=%s %s ext4 %s 0 2\n" % (uuid, args.mountpoint, mount_options)
fstabline = "UUID=%s %s %s %s 0 2\n" % (
uuid,
args.mountpoint,
updated_devdict[args.device]["fstype"],
mount_options,
)
print("Updating fstab with %s..." % fstabline)
with open("/etc/fstab", "a") as myfile:
myfile.write(fstabline)
Expand Down

0 comments on commit 340aa63

Please sign in to comment.