<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def commit_update():
 """ Switch the target boot partition. """

    unused = _find_unused_partition()
    new = _switch_partition()
    if new != unused:
        msg = f"Bad switch: switched to {new} when {unused} was unused"
        LOG.error(msg)
        raise RuntimeError(msg)
    else:
        LOG.info(f'commit_update: committed to booting {new}')