<commit_before>include_recipe "midokura::_common"

package "midonet-api"
package "python-midonetclient"
package "tomcat"

# HACK: the midonet-api package should include tomcat loader midonet-api.xml
file "/etc/tomcat/Catalina/localhost/midonet-api.xml" do
  content "<Context path=\"/midonet-api\" docBase=\"/usr/share/midonet-api\" antiResourceLocking=\"false\" privileged=\"true\"/>"
  owner "tomcat"
  group "tomcat"
  mode 00774
end

# Hack: the midonet-api should not ship with servlet.jar
file "/usr/share/midonet-api/WEB-INF/lib/servlet-api-2.5-20081211.jar" do
  action :delete
end

template "/usr/share/midonet-api/WEB-INF/web.xml" do
  source "web.xml.erb"
  mode 00774
  owner "tomcat"
  group "tomcat"
  notifies :restart, "service[tomcat]", :immediately
end

service 'tomcat' do
  action [:enable, :start]
end<commit_msg>Use tomcat6 for midonet-api<commit_after>include_recipe "midokura::_common"

package "midonet-api"
package "python-midonetclient"
package "tomcat6"

# HACK: the midonet-api package should include tomcat loader midonet-api.xml
file "/etc/tomcat6/Catalina/localhost/midonet-api.xml" do
  content "<Context path=\"/midonet-api\" docBase=\"/usr/share/midonet-api\" antiResourceLocking=\"false\" privileged=\"true\"/>"
  owner "tomcat"
  group "tomcat"
  mode 00774
end

# Hack for tomcat 7: the midonet-api should not ship with servlet.jar
#file "/usr/share/midonet-api/WEB-INF/lib/servlet-api-2.5-20081211.jar" do
#  action :delete
#end

template "/usr/share/midonet-api/WEB-INF/web.xml" do
  source "web.xml.erb"
  mode 00774
  owner "tomcat"
  group "tomcat"
  notifies :restart, "service[tomcat6]", :immediately
end

service 'tomcat6' do
  action [:enable, :start]
end
{'fraction_non_alphanumeric': 0.1398354876615746, 'fraction_numerical': 0.02702702702702703, 'mean_word_length': 4.529220779220779, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4295929', 'n_tokens_mistral': 676, 'n_tokens_neox': 617, 'n_words': 145}