title: PythonNameError: name 'discovery' is not defined
body: <p>Have this below function.But getting error ..any thoughts ?</p>
  
  <pre><code>def zabbix_discovery(pingdom_data):
          discovery = []
          for k,v in data["recipes"].items():
                  discovery.append(
                           {"{#NAME}": str(v['name'])}
                           )
  cmd_args = [
          'zabbix_sender',
          '-z', config.get('ZABBIX', 'server'),
          '-p', config.get('ZABBIX', 'port'),
          '-s', config.get('ZABBIX', 'host'),
          '-k', config.get('ZABBIX', 'key1'),
          '-o', "'{ \"data\": " + discovery + " }'"
          ]
  zabbix_trapper(cmd_args)
  </code></pre>
  
  <p>=====</p>
  
  <pre><code>Traceback (most recent call last):
    File "txncheck_backup.py", line 52, in &lt;module&gt;
      '-o', "'{ \"data\": " + discovery + " }'"
  NameError: name 'discovery' is not defined
  </code></pre>
  
  <p>=====</p>