<commit_before>#
# Cookbook Name:: mesos
# Recipe:: docker-executor
#
# Copyright 2013, <NAME>
#
# All rights reserved - Do Not Redistribute
#

version = node[:mesos][:version]
egg_name = "mesos_#{version}_amd64"
if version =~ /^0\.14/ then
  egg_name = "mesos-#{version}-py2.7-linux-x86_64"
end

# this doesn't work. so we have to install docker manually outside. I can't figure out why.
include_recipe "docker"

package "python-setuptools" do
  action :install
end

remote_file "#{Chef::Config[:file_cache_path]}/#{egg_name}.egg" do
  source "http://downloads.mesosphere.io/master/ubuntu/13.04/#{egg_name}.egg"
  mode   "0755"
  not_if { File.exists?("#{Chef::Config[:file_cache_path]}/#{egg_name}.egg")==true }
  notifies :run,  "execute[install-mesos-python-binding]"
end

execute "install-mesos-python-binding" do
  command "easy_install #{Chef::Config[:file_cache_path]}/#{egg_name}.egg"
  not_if { ::File.exists?('/usr/local/lib/python2.7/dist-packages/mesos.egg') }
end

directory '/var/lib/mesos/executors' do
  owner 'root'
  group 'root'
  mode "0755"
  recursive true
  action :create
end

remote_file "/var/lib/mesos/executors/docker" do
  source "https://raw.github.com/mesosphere/mesos-docker/master/bin/mesos-docker"
  mode "0755"
  not_if { File.exists?("/var/lib/mesos/executor/docker")==true }
end
<commit_msg>Fix detection of an already installed mesos python egg<commit_after>#
# Cookbook Name:: mesos
# Recipe:: docker-executor
#
# Copyright 2013, <NAME>
#
# All rights reserved - Do Not Redistribute
#

version = node[:mesos][:version]
egg_name = "mesos_#{version}_amd64"
if version =~ /^0\.14/ then
  egg_name = "mesos-#{version}-py2.7-linux-x86_64"
end

# this doesn't work. so we have to install docker manually outside. I can't figure out why.
include_recipe "docker"

package "python-setuptools" do
  action :install
end

remote_file "#{Chef::Config[:file_cache_path]}/#{egg_name}.egg" do
  source "http://downloads.mesosphere.io/master/ubuntu/13.04/#{egg_name}.egg"
  mode   "0755"
  not_if { File.exists?("#{Chef::Config[:file_cache_path]}/#{egg_name}.egg")==true }
  notifies :run,  "execute[install-mesos-python-binding]"
end

execute "install-mesos-python-binding" do
  command "easy_install #{Chef::Config[:file_cache_path]}/#{egg_name}.egg"
  not_if { ::File.exists?("/usr/local/lib/python2.7/dist-packages/#{egg_name}.egg") }
end

directory '/var/lib/mesos/executors' do
  owner 'root'
  group 'root'
  mode "0755"
  recursive true
  action :create
end

remote_file "/var/lib/mesos/executors/docker" do
  source "https://raw.github.com/mesosphere/mesos-docker/master/bin/mesos-docker"
  mode "0755"
  not_if { File.exists?("/var/lib/mesos/executor/docker")==true }
end

{'fraction_non_alphanumeric': 0.1622920517560074, 'fraction_numerical': 0.024399260628465803, 'mean_word_length': 4.745222929936306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '487094', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1005, 'n_words': 200}