<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def swap(ctx):
 """ Swaps the two slot configurations. """

    controller = ctx.obj['controller']
    click.echo('Swapping slots...')
    try:
        controller.swap_slots()
    except YkpersError as e:
        _failed_to_write_msg(ctx, e)