From a08f4e63f0fc917dbd74466c64fb31e314f45a83 Mon Sep 17 00:00:00 2001 From: Tristan Rivoallan Date: Fri, 25 Aug 2017 15:41:21 +0200 Subject: [PATCH 1/2] Chef 13 compatibility The appdynamics cookbook was not compatible with the latest version of Chef due to a dependency on the deprecated "python" cookbook. This PR switches to the recommended "poise-python" cookbook in order to achieve Chef 13 compatibility. --- .kitchen.yml | 3 ++- metadata.rb | 2 +- recipes/python_agent.rb | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 9bed409..cb6d3b6 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -27,6 +27,7 @@ provisioner: platforms: - name: ubuntu-12.04 + - name: ubuntu-16.04 - name: centos-6.7 - name: windows2012r2 driver_config: @@ -59,10 +60,10 @@ suites: - name: python_agent run_list: - recipe[apt::default] - - recipe[python::default] - recipe[appdynamics::python_agent] attributes: appdynamics: + version: '4.3.9.0' python_agent: debug: true dir: '/opt/pyagent' diff --git a/metadata.rb b/metadata.rb index 3538c6b..c96ad86 100644 --- a/metadata.rb +++ b/metadata.rb @@ -9,7 +9,7 @@ issues_url 'https://github.com/appdynamics/appdynamics-cookbooks/issues' if respond_to?(:issues_url) depends 'windows', '~> 1.44.3' -depends 'python', '~> 1.4.6' +depends 'poise-python', '~> 1.6.0' depends 'nodejs', '~> 2.4.4' depends 'java', '~> 1.42.0' depends 'apt', '~> 3.0.0' diff --git a/recipes/python_agent.rb b/recipes/python_agent.rb index dd78b24..37b466f 100644 --- a/recipes/python_agent.rb +++ b/recipes/python_agent.rb @@ -5,13 +5,17 @@ agent_version = agent['version'] || node['appdynamics']['version'] fail 'You must specify either node[\'appdynamics\'][\'version\'] or node[\'appdynamics\'][\'python_agent\'][\'version\']' unless agent_version -python_pip 'appdynamics' do +python_runtime 'appdynamics' do + version '3' +end + +python_package 'appdynamics' do virtualenv agent['virtualenv'] if agent['virtualenv'] + python 'appdynamics' if not agent['virtualenv'] action agent['action'] version agent_version user agent['user'] - group agent['group'] - options '--pre' if agent['prerelease'] + install_options '--pre' if agent['prerelease'] end template agent['config_file'] do From 3bbf2b1260fe685120d848c49711d45f217a8de2 Mon Sep 17 00:00:00 2001 From: Tristan Rivoallan Date: Fri, 25 Aug 2017 15:46:22 +0200 Subject: [PATCH 2/2] Force Chef 13 for kitchen tests --- .kitchen.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.kitchen.yml b/.kitchen.yml index cb6d3b6..e829cde 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -7,6 +7,7 @@ driver: provisioner: name: chef_zero + require_chef_omnibus: 13 attributes: appdynamics: version: '4.1.3.1'