From 4490165f638c2d02918ca91677c07945dcb459f815679e2236669367bcacf6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 21 May 2020 18:31:16 +0000 Subject: [PATCH] Accepting request 807980 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/807980 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-napalm?expand=0&rev=11 --- python-napalm.changes | 5 +++++ python-napalm.spec | 26 ++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/python-napalm.changes b/python-napalm.changes index c86a890..b826248 100644 --- a/python-napalm.changes +++ b/python-napalm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 21 10:56:30 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Fri May 15 10:36:31 UTC 2020 - Martin Hauke diff --git a/python-napalm.spec b/python-napalm.spec index eaa2459..e337eec 100644 --- a/python-napalm.spec +++ b/python-napalm.spec @@ -43,6 +43,8 @@ Requires: python-requests >= 2.7.0 Requires: python-scp Requires: python-setuptools >= 38.4.0 Requires: python-textfsm +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Jinja2} @@ -78,6 +80,10 @@ interact with different router vendor devices using a unified API. %install %python_install +%python_clone -a %{buildroot}%{_bindir}/napalm +%python_clone -a %{buildroot}%{_bindir}/cl_napalm_validate +%python_clone -a %{buildroot}%{_bindir}/cl_napalm_test +%python_clone -a %{buildroot}%{_bindir}/cl_napalm_configure %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -86,13 +92,25 @@ interact with different router vendor devices using a unified API. rm -Rf test/junos/ %pytest +%post +%python_install_alternative napalm +%python_install_alternative cl_napalm_validate +%python_install_alternative cl_napalm_test +%python_install_alternative cl_napalm_configure + +%postun +%python_uninstall_alternative napalm +%python_uninstall_alternative cl_napalm_validate +%python_uninstall_alternative cl_napalm_test +%python_uninstall_alternative cl_napalm_configure + %files %{python_files} %license LICENSE %doc README.md -%python3_only %{_bindir}/cl_napalm_configure -%python3_only %{_bindir}/cl_napalm_test -%python3_only %{_bindir}/cl_napalm_validate -%python3_only %{_bindir}/napalm +%python_alternative %{_bindir}/cl_napalm_configure +%python_alternative %{_bindir}/cl_napalm_test +%python_alternative %{_bindir}/cl_napalm_validate +%python_alternative %{_bindir}/napalm %{python_sitelib}/* %changelog