The only issue I see here is that the file system type is not passed to the function and the fstab entry wants the file system type also (in this case xfs), whereas mount can be used without the file system type.
I also cannot find any other charm using this charm helper section, e.g. the ceph charm does not use it and hence does not see the same issue after a reboot.
As stated above, host.py needs to be updated for the mount and umount functions:
def mount(device, mountpoint, options=None, persist=False):
cmd_args. extend( ['-o', options]) args.extend( [device, mountpoint])
subprocess. check_output( cmd_args) CalledProcessEr ror, e: .format( device, mountpoint, e.output))
"""Mount a filesystem at a particular mountpoint"""
cmd_args = ['mount']
if options is not None:
cmd_
try:
except subprocess.
log('Error mounting {} at {}\n{}'
return False
if persist:
# TODO: update fstab
pass
return True
def umount(mountpoint, persist=False):
subprocess. check_output( cmd_args) CalledProcessEr ror, e: .format( mountpoint, e.output))
"""Unmount a filesystem"""
cmd_args = ['umount', mountpoint]
try:
except subprocess.
log('Error unmounting {}\n{}'
return False
if persist:
# TODO: update fstab
pass
return True
The only issue I see here is that the file system type is not passed to the function and the fstab entry wants the file system type also (in this case xfs), whereas mount can be used without the file system type.
I also cannot find any other charm using this charm helper section, e.g. the ceph charm does not use it and hence does not see the same issue after a reboot.