From 8a3f88d0dbf6afdb0130b9d35e563f8a54d15d44 Mon Sep 17 00:00:00 2001 From: Krisztian Lengyel Date: Thu, 16 Jan 2020 09:11:37 +0100 Subject: [PATCH] Add explicit CM dependencies Change-Id: I4b9dd5ccad13da022f214e79b71493e3d0968a1c --- cmdatahandlers/src/cmdatahandlers/api/validation.py | 2 +- cmframework/src/cmframework/agent/cmagent.py | 2 +- cmframework/src/cmframework/cli/cmcli.py | 2 +- cmframework/src/cmframework/server/cmserver.py | 2 +- cmframework/src/setup.py | 1 + config-manager.spec | 8 +++++--- hostcli/setup.py | 3 +-- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cmdatahandlers/src/cmdatahandlers/api/validation.py b/cmdatahandlers/src/cmdatahandlers/api/validation.py index aabccb9..54e9d8b 100644 --- a/cmdatahandlers/src/cmdatahandlers/api/validation.py +++ b/cmdatahandlers/src/cmdatahandlers/api/validation.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # Copyright 2019 Nokia diff --git a/cmframework/src/cmframework/agent/cmagent.py b/cmframework/src/cmframework/agent/cmagent.py index c2abaa1..04514d6 100755 --- a/cmframework/src/cmframework/agent/cmagent.py +++ b/cmframework/src/cmframework/agent/cmagent.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # Copyright 2019 Nokia diff --git a/cmframework/src/cmframework/cli/cmcli.py b/cmframework/src/cmframework/cli/cmcli.py index 1d6fa28..130419b 100755 --- a/cmframework/src/cmframework/cli/cmcli.py +++ b/cmframework/src/cmframework/cli/cmcli.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # Copyright 2019 Nokia diff --git a/cmframework/src/cmframework/server/cmserver.py b/cmframework/src/cmframework/server/cmserver.py index 3c3822e..b8caef3 100755 --- a/cmframework/src/cmframework/server/cmserver.py +++ b/cmframework/src/cmframework/server/cmserver.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python2 # Copyright 2019 Nokia diff --git a/cmframework/src/setup.py b/cmframework/src/setup.py index 1bfc40c..cec0980 100644 --- a/cmframework/src/setup.py +++ b/cmframework/src/setup.py @@ -34,4 +34,5 @@ setup( ], }, zip_safe=False, + python_requires='~=2.7,<3.0', ) diff --git a/config-manager.spec b/config-manager.spec index 6620c8a..eae2d58 100644 --- a/config-manager.spec +++ b/config-manager.spec @@ -21,8 +21,9 @@ Source0: %{name}-%{version}.tar.gz Vendor: %{_platform_vendor} BuildArch: noarch -BuildRequires: python -BuildRequires: python-setuptools +BuildRequires: python2 +BuildRequires: python2-setuptools +Requires: python2, redis, python2-eventlet, python2-routes, python2-redis, python2-setuptools, python2-prettytable, python2-requests, python2-netaddr %description This RPM contains source code for the config manager. @@ -50,7 +51,7 @@ cp cmframework/systemd/cmagent.service %{buildroot}/usr/lib/systemd/system mkdir -p %{buildroot}/%{_python_site_packages_path}/cmframework/ set -e -cd cmframework/src && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd - +cd cmframework/src && python2 setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd - cd cmdatahandlers && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd - @@ -80,6 +81,7 @@ cd hostcli && python setup.py install --root %{buildroot} --no-compile --install %pre %post +mkdir -p /opt/openstack-ansible/inventory/ ln -sf /opt/cmframework/scripts/inventory.sh /opt/openstack-ansible/inventory/ chmod -x /usr/lib/systemd/system/config-manager.service chmod -x /usr/lib/systemd/system/cmagent.service diff --git a/hostcli/setup.py b/hostcli/setup.py index 0cfa23c..bd734d1 100644 --- a/hostcli/setup.py +++ b/hostcli/setup.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/env python +#!/usr/bin/env python2 PROJECT = 'cmcli' @@ -45,4 +45,3 @@ setup( }, zip_safe=False, ) - -- 2.16.6