snmp {
  {% if (location is defined) and location %}
  delete: location "{{location}}";
  {% endif %}
  {% if (contact is defined) and contact %}
  delete: contact "{{contact}}";
  {% endif %}
  {% if (community is defined) and community %}
  {% for comm_name, comm_details in community.iteritems() %}
  delete: community {{comm_name}} {
    {% if (comm_details is defined) and comm_details %}
    {% if (comm_details.get('mode') is defined) and comm_details.get('mode') == 'rw' %}
    authorization read-write;
    {% else %}
    authorization read-only;
    {% endif %}
    {% else %}
    authorization read-only;
    {% endif %}
  }
  {% endfor %}
  {% endif %}
}

