code: def _snapper_pre(opts, jid):
      '''
      Create a snapper pre snapshot
      '''
      snapper_pre = None
      try:
          if not opts['test'] and __opts__.get('snapper_states'):
              # Run the snapper pre snapshot
              snapper_pre = __salt__['snapper.create_snapshot'](
                      config=__opts__.get('snapper_states_config', 'root'),
                      snapshot_type='pre',
                      description='Salt State run for jid {0}'.format(jid),
                      __pub_jid=jid)
      except Exception:
          log.error('Failed to create snapper pre snapshot for jid: %s', jid)
      return snapper_prf _snapper_pre(opts, jid):
      '''
      Create a snapper pre snapshot
      '''
      snapper_pre = None
      try:
          if not opts['test'] and __opts__.get('snapper_states'):
              # Run the snapper pre snapshot
              snapper_pre = __salt__['snapper.create_snapshot'](
                      config=__opts__.get('snapper_states_config', 'root'),
                      snapshot_type='pre',
                      description='Salt State run for jid {0}'.format(jid),
                      __pub_jid=jid)
      except Exception:
          log.error('Failed to create snapper pre snapshot for jid: %s', jid)
      return snapper_pre
docs: Create a snapper pre snapshot