diff --git a/recipes/client.rb b/recipes/client.rb index 9662ccea..e61a326d 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -4,6 +4,7 @@ # Recipe:: client # # Copyright 2014, IBM Corp. +# Copyright 2017, cloudbau GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,6 +21,15 @@ python_runtime '2' +python_virtualenv '/opt/osc' do + system_site_packages true +end + python_package 'python-openstackclient' do version node['openstack']['common']['client_version'] + virtualenv '/opt/osc' +end + +link '/usr/local/bin/openstack' do + to '/opt/osc/bin/openstack' end diff --git a/spec/client_spec.rb b/spec/client_spec.rb index a2d31dd9..49ca1288 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -13,9 +13,19 @@ describe 'openstack-common::client' do expect(chef_run).to install_python_runtime('2') end + it do + expect(chef_run).to create_python_virtualenv('/opt/osc') + .with(system_site_packages: true) + end + it do expect(chef_run).to install_python_package('python-openstackclient') .with(version: '3.6.0') end + + it do + expect(chef_run).to create_link('/usr/local/bin/openstack') + .with(to: '/opt/osc/bin/openstack') + end end end