@error.context_aware
def lv_mount(vg_name, lv_name, mount_loc, create_filesystem=''):
 error.context('Mounting the logical volume', logging.info)
 try:
  if create_filesystem:
   result = utils.run(('mkfs.%s /dev/%s/%s' % (create_filesystem, vg_name, lv_name)))
   logging.debug(result.stdout.rstrip())
  result = utils.run(('mount /dev/%s/%s %s' % (vg_name, lv_name, mount_loc)))
 except error.CmdError as ex:
  logging.warning(ex)
  return False
 return True

@ error . context_aware def lv_mount ( vg_name , lv_name , mount_loc , create_filesystem = '' ) : error . context ( 'Mounting the logical volume' , logging . info ) try : if create_filesystem : result = utils . run ( ( 'mkfs.%s /dev/%s/%s' % ( create_filesystem , vg_name , lv_name ) ) ) logging . debug ( result . stdout . rstrip ( ) ) result = utils . run ( ( 'mount /dev/%s/%s %s' % ( vg_name , lv_name , mount_loc ) ) ) except error . CmdError as ex : logging . warning ( ex ) return False return True
mount a logical volume to a mount location .