def snapshot(domain, name=None, suffix=None):
    if name and name.lower() == domain.lower():
        raise CommandExecutionError('Virtual Machine {name} is already defined. '
                                    'Please choose another name for the snapshot'.format(name=name))
    if not name:
        name = "{domain}-{tsnap}".format(domain=domain, tsnap=time.strftime('%Y%m%d-%H%M%S', time.localtime()))

    if suffix:
        name = "{name}-{suffix}".format(name=name, suffix=suffix)

    doc = ElementTree.Element('domainsnapshot')
    n_name = ElementTree.SubElement(doc, 'name')
    n_name.text = name

    _get_domain(domain).snapshotCreateXML(ElementTree.tostring(doc))

    return {'name': name}
Test that successful post redirects to update subscriptions.
dataset/ETHPy150Open saltstack/salt/salt/modules/virt.py/snapshot--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/notifications/tests/test_views.py/SubscriptionsUpdateViewTest.test_redirects_to_update_subscriptions_on_success