Update openstack clients to stein/master

python-aodhclient spec file is based off 1.1.1 (rocky)
python-barbicanclient spec file is based off 4.7.1 (rocky)
python-cinderclient spec file is based off 4.0.1 (rocky)
python-glanceclient spec file is based off 2.13.1 (rocky)
 - docs disabled
python-gnocchiclient spec file is based off 7.0.4 (rocky)
python-heatclient spec file is based off 1.16.1 (rocky)
 - docs disabled
python-ironicclient spec file is based off 2.5.0 (rocky)
python-keystoneclient spec file is based off 3.17.0 (rocky)
python-magnumclient spec file is based off 2.10.0 (rocky)
python-muranoclient spec file is based off 1.1.1 (rocky)
python-neutronclient spec file is based off 6.9.1 (rocky)
python-novaclient spec file is based off 11.0.0 (rocky)
 - docs disabled
python-openstackclient spec file is based off 3.16.2 (rocky)
 - docs disabled
 - unit tests disabled
python-openstacksdk spec file is based of 0.17.2 (rocky)
 - unit tests disabled
python-pankoclient spec file is based off 0.5.0 (rocky)

The primary changes to each spec files are
1) version has tis extension
2) sdk package added
3) wheels package added

Disable building:
 - openstack-aodh
 - python-osc-lib

ceilometerclient no longer exists.
openstack-heat no longer requires ceilometerclient

Story: 2004751
Task: 28864
Change-Id: Ifa905bea2e95ded72a327f8ff43667c8c5429363
Depends-On: Iea58cb9484c75cf757397d53d7d1576a2f436d81
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey 2019-01-09 14:48:12 -06:00
parent 7713430481
commit d7964a17fb
106 changed files with 5196 additions and 6466 deletions

View File

@ -40,7 +40,7 @@ python2-ironicclient
# python-magnumclient
python2-magnumclient
python-magnumclient-doc
python-magnumclient-tests
# python-magnumclient-tests
# openstack-magnum
python-magnum
@ -147,15 +147,6 @@ distributedcloud-dcorch
# distributedcloud-client
distributedcloud-client-dcmanagerclient
# openstack-aodh
openstack-aodh-compat
openstack-aodh-api
openstack-aodh-evaluator
openstack-aodh-notifier
openstack-aodh-listener
openstack-aodh-expirer
openstack-aodh-config
# openstack-panko
python-panko
openstack-panko-api

View File

@ -1,5 +1,3 @@
openstack/openstack-aodh
openstack/openstack-aodh-config
openstack/openstack-murano
openstack/python-muranoclient
openstack/openstack-murano-ui
@ -13,8 +11,8 @@ openstack/openstack-panko
openstack/openstack-panko-config
openstack/openstack-os-vif
openstack/python-aodhclient
openstack/python-barbicanclient
openstack/python-ceilometer
openstack/python-ceilometerclient
openstack/python-cinder
openstack/python-cinderclient
openstack/python-glance
@ -28,7 +26,6 @@ openstack/python-heatclient
openstack/python-horizon
openstack/python-keystone
openstack/python-keystoneclient
openstack/python-keystonemiddleware
openstack/python-networking-bgpvpn
openstack/python-networking-sfc
openstack/python-networking-odl
@ -42,11 +39,10 @@ openstack/python-openstackdocstheme
openstack/python-oslo-concurrency
openstack/python-oslo-service
openstack/python-oslo-messaging
openstack/python-pankoclient
openstack/rabbitmq-server
openstack/rabbitmq-server-config
openstack/python-keystoneauth1
openstack/python-openstackclient
openstack/python-osc-lib
openstack/python-openstacksdk
openstack/python-django-openstack-auth
openstack/python-wsme

View File

@ -1 +1,3 @@
TIS_PATCH_VER=1
TAR_NAME=aodhclient
SRC_DIR=$CGCS_BASE/git/python-aodhclient
TIS_PATCH_VER=0

View File

@ -1,21 +0,0 @@
diff --git a/SPECS/python-aodhclient.spec b/SPECS/python-aodhclient.spec
index 5d60fe2..ec5afaa 100644
--- a/SPECS/python-aodhclient.spec
+++ b/SPECS/python-aodhclient.spec
@@ -8,13 +8,15 @@
Name: python-aodhclient
Version: 0.9.0
-Release: 1%{?dist}
+Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Aodh
License: ASL 2.0
URL: https://launchpad.net/python-aodhclient
Source0: https://tarballs.openstack.org/%{name}/%{pypi_name}-%{upstream_version}.tar.gz
+Patch0: 0001-fix-interface.patch
+
BuildArch: noarch
%description

View File

@ -1 +0,0 @@
0001-spec.patch

View File

@ -1,15 +0,0 @@
diff --git a/aodhclient/osc.py b/aodhclient/osc.py
index 1e8599f..a1ecfee 100644
--- a/aodhclient/osc.py
+++ b/aodhclient/osc.py
@@ -39,7 +39,9 @@ def make_client(instance):
API_VERSIONS)
# NOTE(sileht): ensure setup of the session is done
instance.setup_auth()
- return aodh_client(session=instance.session)
+ return aodh_client(session=instance.session,
+ interface=instance.interface,
+ region_name=instance.region_name)
def build_option_parser(parser):

View File

@ -0,0 +1,207 @@
%global pypi_name aodhclient
%if 0%{?fedora}
%global with_python3 1
%endif
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global common_desc \
This is a client library for Aodh built on the Aodh API. It \
provides a Python API (the aodhclient module) and a command-line tool.
Name: python-aodhclient
Version: 1.1.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Aodh
License: ASL 2.0
URL: https://launchpad.net/python-aodhclient
Source0: https://tarballs.openstack.org/%{name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{pypi_name}
Summary: Python API and CLI for OpenStack Aodh
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python2-devel
BuildRequires: python-pbr
BuildRequires: git
Requires: python-pbr
Requires: python-cliff >= 1.14.0
Requires: python-oslo-i18n >= 1.5.0
Requires: python-oslo-serialization >= 1.4.0
Requires: python-oslo-utils >= 2.0.0
Requires: python-keystoneauth1 >= 1.0.0
Requires: python-six >= 1.9.0
Requires: python-osc-lib >= 1.0.1
Requires: pyparsing
%description -n python2-%{pypi_name}
%{common_desc}
%package doc
Summary: Documentation for OpenStack Aodh API Client
BuildRequires: python-sphinx
# FIXME: remove following line when a new release including https://review.openstack.org/#/c/476759/ is in u-c
BuildRequires: python-oslo-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-keystoneauth1
BuildRequires: python-oslo-utils
BuildRequires: python-oslo-serialization
BuildRequires: python-cliff
%description doc
%{common_desc}
(aodh).
This package contains auto-generated documentation.
%package -n python2-%{pypi_name}-tests
Summary: Python API and CLI for OpenStack Aodh Tests
Requires: python2-%{pypi_name} = %{version}-%{release}
%description -n python2-%{pypi_name}-tests
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Python API and CLI for OpenStack Aodh
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-setuptools
BuildRequires: python3-devel
BuildRequires: python3-pbr
Requires: python3-pbr
Requires: python3-cliff >= 1.14.0
Requires: python3-oslo-i18n >= 1.5.0
Requires: python3-oslo-serialization >= 1.4.0
Requires: python3-oslo-utils >= 2.0.0
Requires: python3-keystoneauth1 >= 1.0.0
Requires: python3-six >= 1.9.0
Requires: python3-osc-lib >= 1.0.1
Requires: python3-pyparsing
%description -n python3-%{pypi_name}
%{common_desc}
%package -n python3-%{pypi_name}-tests
Summary: Python API and CLI for OpenStack Aodh Tests
Requires: python3-%{pypi_name} = %{version}-%{release}
%description -n python3-%{pypi_name}-tests
%{common_desc}
%endif
%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
# Let RPM handle the requirements
rm -f {,test-}requirements.txt
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/aodh %{buildroot}%{_bindir}/aodh-%{python3_version}
ln -s ./aodh-%{python3_version} %{buildroot}%{_bindir}/aodh-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/aodh %{buildroot}%{_bindir}/aodh-%{python2_version}
ln -s ./aodh-%{python2_version} %{buildroot}%{_bindir}/aodh-2
ln -s ./aodh-2 %{buildroot}%{_bindir}/aodh
export PYTHONPATH=.
sphinx-build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
# STX: stage wheels
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# STX: prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{pypi_name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{pypi_name}-%{version}
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/aodhclient
%{python2_sitelib}/*.egg-info
%{_bindir}/aodh
%{_bindir}/aodh-2
%{_bindir}/aodh-%{python2_version}
%exclude %{python2_sitelib}/aodhclient/tests
%files -n python2-%{pypi_name}-tests
%license LICENSE
%{python2_sitelib}/aodhclient/tests
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/*.egg-info
%{_bindir}/aodh-3
%{_bindir}/aodh-%{python3_version}
%exclude %{python3_sitelib}/aodhclient/tests
%files -n python3-%{pypi_name}-tests
%license LICENSE
%{python3_sitelib}/aodhclient/tests
%endif
%files doc
%doc doc/build/html
%license LICENSE
%package sdk
Summary: SDK files for %{pypi_name}
%description sdk
Contains SDK files for %{pypi_name} package
%files sdk
/usr/share/remote-clients/%{pypi_name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 1.1.1-1
- Update to 1.1.1

View File

@ -0,0 +1,176 @@
%global pypi_name aodhclient
%if 0%{?fedora}
%global with_python3 1
%endif
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global common_desc \
This is a client library for Aodh built on the Aodh API. It \
provides a Python API (the aodhclient module) and a command-line tool.
Name: python-aodhclient
Version: 1.1.1
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Aodh
License: ASL 2.0
URL: https://launchpad.net/python-aodhclient
Source0: https://tarballs.openstack.org/%{name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{pypi_name}
Summary: Python API and CLI for OpenStack Aodh
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python-setuptools
BuildRequires: python2-devel
BuildRequires: python-pbr
BuildRequires: git
Requires: python-pbr
Requires: python-cliff >= 1.14.0
Requires: python-oslo-i18n >= 1.5.0
Requires: python-oslo-serialization >= 1.4.0
Requires: python-oslo-utils >= 2.0.0
Requires: python-keystoneauth1 >= 1.0.0
Requires: python-six >= 1.9.0
Requires: python-osc-lib >= 1.0.1
Requires: pyparsing
%description -n python2-%{pypi_name}
%{common_desc}
%package doc
Summary: Documentation for OpenStack Aodh API Client
BuildRequires: python-sphinx
# FIXME: remove following line when a new release including https://review.openstack.org/#/c/476759/ is in u-c
BuildRequires: python-oslo-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-keystoneauth1
BuildRequires: python-oslo-utils
BuildRequires: python-oslo-serialization
BuildRequires: python-cliff
%description doc
%{common_desc}
(aodh).
This package contains auto-generated documentation.
%package -n python2-%{pypi_name}-tests
Summary: Python API and CLI for OpenStack Aodh Tests
Requires: python2-%{pypi_name} = %{version}-%{release}
%description -n python2-%{pypi_name}-tests
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Python API and CLI for OpenStack Aodh
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-setuptools
BuildRequires: python3-devel
BuildRequires: python3-pbr
Requires: python3-pbr
Requires: python3-cliff >= 1.14.0
Requires: python3-oslo-i18n >= 1.5.0
Requires: python3-oslo-serialization >= 1.4.0
Requires: python3-oslo-utils >= 2.0.0
Requires: python3-keystoneauth1 >= 1.0.0
Requires: python3-six >= 1.9.0
Requires: python3-osc-lib >= 1.0.1
Requires: python3-pyparsing
%description -n python3-%{pypi_name}
%{common_desc}
%package -n python3-%{pypi_name}-tests
Summary: Python API and CLI for OpenStack Aodh Tests
Requires: python3-%{pypi_name} = %{version}-%{release}
%description -n python3-%{pypi_name}-tests
%{common_desc}
%endif
%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
# Let RPM handle the requirements
rm -f {,test-}requirements.txt
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/aodh %{buildroot}%{_bindir}/aodh-%{python3_version}
ln -s ./aodh-%{python3_version} %{buildroot}%{_bindir}/aodh-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/aodh %{buildroot}%{_bindir}/aodh-%{python2_version}
ln -s ./aodh-%{python2_version} %{buildroot}%{_bindir}/aodh-2
ln -s ./aodh-2 %{buildroot}%{_bindir}/aodh
export PYTHONPATH=.
sphinx-build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/aodhclient
%{python2_sitelib}/*.egg-info
%{_bindir}/aodh
%{_bindir}/aodh-2
%{_bindir}/aodh-%{python2_version}
%exclude %{python2_sitelib}/aodhclient/tests
%files -n python2-%{pypi_name}-tests
%license LICENSE
%{python2_sitelib}/aodhclient/tests
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/*.egg-info
%{_bindir}/aodh-3
%{_bindir}/aodh-%{python3_version}
%exclude %{python3_sitelib}/aodhclient/tests
%files -n python3-%{pypi_name}-tests
%license LICENSE
%{python3_sitelib}/aodhclient/tests
%endif
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 1.1.1-1
- Update to 1.1.1

View File

@ -1 +0,0 @@
mirror:Source/python-aodhclient-0.9.0-1.el7.src.rpm

View File

@ -0,0 +1,3 @@
TAR_NAME=python-barbicanclient
SRC_DIR=$CGCS_BASE/git/python-barbicanclient
TIS_PATCH_VER=0

View File

@ -0,0 +1,182 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname barbicanclient
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the Barbican Key Management API. There is a \
Python library for accessing the API (barbicanclient module), and \
a command-line script (barbican).
Name: python-barbicanclient
Version: 4.7.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Client Library for OpenStack Barbican Key Management API
License: ASL 2.0
URL: https://pypi.python.org/pypi/python-barbicanclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Client Library for OpenStack Barbican Key Management API
BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python2-setuptools
BuildRequires: git
Requires: python2-requests
Requires: python2-six >= 1.10.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-prettytable
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-pbr >= 2.0.0
%if 0%{?fedora} > 0
Requires: python2-cliff
%else
Requires: python-cliff
%endif
%{?python_provide:%python_provide python2-%{sname}}
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Client Library for OpenStack Barbican Key Management API
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
Requires: python3-requests
Requires: python3-six >= 1.10.0
Requires: python3-cliff
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-prettytable
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-pbr >= 2.0.0
%{?python_provide:%python_provide python3-%{sname}}
%description -n python3-%{sname}
%{common_desc}
%endif
%package doc
Summary: Documentation for OpenStack Barbican API client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-oslo-utils
BuildRequires: python2-oslo-i18n
BuildRequires: python2-prettytable
%description doc
Documentation for the barbicanclient module
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# let RPM handle deps
sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
rm -rf {test-,}requirements.txt
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
# doc
%{__python2} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.buildinfo
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/barbican %{buildroot}%{_bindir}/barbican-%{python3_version}
ln -s ./barbican-%{python3_version} %{buildroot}%{_bindir}/barbican-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/barbican %{buildroot}%{_bindir}/barbican-%{python2_version}
ln -s ./barbican-%{python2_version} %{buildroot}%{_bindir}/barbican-2
ln -s ./barbican-2 %{buildroot}%{_bindir}/barbican
# STX: stage wheels
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# STX: prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%files -n python2-%{sname}
%license LICENSE
%doc AUTHORS CONTRIBUTING.rst README.rst ChangeLog
%{_bindir}/barbican
%{_bindir}/barbican-2*
%{python2_sitelib}/barbicanclient
%{python2_sitelib}/python_barbicanclient-%{upstream_version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc AUTHORS CONTRIBUTING.rst README.rst ChangeLog
%{_bindir}/barbican-3*
%{python3_sitelib}/barbicanclient
%{python3_sitelib}/python_barbicanclient-%{upstream_version}-py?.?.egg-info
%endif
%files doc
%doc doc/build/html
%license LICENSE
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Tue Nov 27 2018 RDO <dev@lists.rdoproject.org> 4.7.1-1
- Update to 4.7.1
* Wed Aug 08 2018 RDO <dev@lists.rdoproject.org> 4.7.0-1
- Update to 4.7.0

View File

@ -0,0 +1,152 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname barbicanclient
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the Barbican Key Management API. There is a \
Python library for accessing the API (barbicanclient module), and \
a command-line script (barbican).
Name: python-barbicanclient
Version: 4.7.1
Release: 1%{?dist}
Summary: Client Library for OpenStack Barbican Key Management API
License: ASL 2.0
URL: https://pypi.python.org/pypi/python-barbicanclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Client Library for OpenStack Barbican Key Management API
BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-setuptools
BuildRequires: git
Requires: python2-requests
Requires: python2-six >= 1.10.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-prettytable
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-pbr >= 2.0.0
%if 0%{?fedora} > 0
Requires: python2-cliff
%else
Requires: python-cliff
%endif
%{?python_provide:%python_provide python2-%{sname}}
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Client Library for OpenStack Barbican Key Management API
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
Requires: python3-requests
Requires: python3-six >= 1.10.0
Requires: python3-cliff
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-prettytable
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-pbr >= 2.0.0
%{?python_provide:%python_provide python3-%{sname}}
%description -n python3-%{sname}
%{common_desc}
%endif
%package doc
Summary: Documentation for OpenStack Barbican API client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-oslo-utils
BuildRequires: python2-oslo-i18n
BuildRequires: python2-prettytable
%description doc
Documentation for the barbicanclient module
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# let RPM handle deps
sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
rm -rf {test-,}requirements.txt
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# doc
%{__python2} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.buildinfo
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/barbican %{buildroot}%{_bindir}/barbican-%{python3_version}
ln -s ./barbican-%{python3_version} %{buildroot}%{_bindir}/barbican-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/barbican %{buildroot}%{_bindir}/barbican-%{python2_version}
ln -s ./barbican-%{python2_version} %{buildroot}%{_bindir}/barbican-2
ln -s ./barbican-2 %{buildroot}%{_bindir}/barbican
%files -n python2-%{sname}
%license LICENSE
%doc AUTHORS CONTRIBUTING.rst README.rst PKG-INFO ChangeLog
%{_bindir}/barbican
%{_bindir}/barbican-2*
%{python2_sitelib}/barbicanclient
%{python2_sitelib}/python_barbicanclient-%{upstream_version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc AUTHORS CONTRIBUTING.rst README.rst PKG-INFO ChangeLog
%{_bindir}/barbican-3*
%{python3_sitelib}/barbicanclient
%{python3_sitelib}/python_barbicanclient-%{upstream_version}-py?.?.egg-info
%endif
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Tue Nov 27 2018 RDO <dev@lists.rdoproject.org> 4.7.1-1
- Update to 4.7.1
* Wed Aug 08 2018 RDO <dev@lists.rdoproject.org> 4.7.0-1
- Update to 4.7.0

View File

@ -1,10 +0,0 @@
TAR_NAME=python-ceilometerclient
SRC_DIR=$CGCS_BASE/git/python-ceilometerclient
# Tar everything found in this subdirectory. Define this if source need to be collected into a tarball in SOURCES.
# Tar file name and version are derived from PKG-INFO. Alternatively you may define TAR_NAME ad VERSION
# A Space separated list of paths to copy to .distro/centos7/rpmbuild/SOURCES.
#COPY_LIST="$CGCS_BASE/downloads/$CLIENT_NAME-$CLIENT_VER.tar.gz $PKG_BASE/$CLIENT_NAME/*"
TIS_BASE_SRCREV=3d4966e6a76c63f6bf4a24d3cb3f86d7a585c1e0
TIS_PATCH_VER=GITREVCOUNT

View File

@ -1,207 +0,0 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif
%global sname ceilometerclient
%global sum Python API and CLI for OpenStack Ceilometer
Name: python-ceilometerclient
Version: 2.9.0
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: %{sum}
License: ASL 2.0
URL: https://github.com/openstack/%{name}
Source0: %{name}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python2-devel
BuildRequires: python-pbr >= 1.6
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr >= 1.6
%endif
%description
This is a client library for Ceilometer built on the Ceilometer API. It
provides a Python API (the ceilometerclient module) and a command-line tool
(ceilometer).
%package -n python2-%{sname}
Summary: %{sum}
# from requirements.txt
Requires: python-iso8601
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-serialization >= 1.10.0
Requires: python-oslo-utils >= 3.17.0
Requires: python-requests >= 2.8.1
Requires: python-six >= 1.9.0
Requires: python-stevedore
Requires: python-pbr
Requires: python-keystoneauth1 >= 2.1.0
Requires: python-prettytable
%{?python_provide:%python_provide python2-%{sname}}
%description -n python2-%{sname}
This is a client library for Ceilometer built on the Ceilometer API. It
provides a Python API (the ceilometerclient module) and a command-line tool
(ceilometer).
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: %{sum}
# from requirements.txt
Requires: python3-iso8601
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-serialization >= 1.10.0
Requires: python3-oslo-utils >= 3.17.0
Requires: python3-requests >= 2.8.1
Requires: python3-six >= 1.9.0
Requires: python3-stevedore
Requires: python3-pbr
Requires: python3-keystoneauth1 >= 2.1.0
Requires: python3-prettytable
%{?python_provide:%python_provide python3-%{sname}}
# WRS installs to usr/lib and not /usr/lib64
%description -n python3-%{sname}
This is a client library for Ceilometer built on the Ceilometer API. It
provides a Python API (the ceilometerclient module) and a command-line tool
(ceilometer).
%endif # with_python3
%package doc
Summary: Documentation for OpenStack Ceilometer API Client
BuildRequires: python-sphinx
# FIXME: remove following line when a new release including https://review.openstack.org/#/c/476759/ is in u-u
BuildRequires: python-oslo-sphinx
BuildRequires: python-openstackdocstheme
%description doc
This is a client library for Ceilometer built on the Ceilometer API. It
provides a Python API (the ceilometerclient module) and a command-line tool
(ceilometer).
This package contains auto-generated documentation.
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Remove bundled egg-info
rm -rf python_%{sname}.egg-info
# Let RPM handle the requirements
rm -f test-requirements.txt
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
%install
export PBR_VERSION=%{version}
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%if 0%{?with_python3}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
%endif
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/ceilometer %{buildroot}%{_bindir}/ceilometer-%{python3_version}
ln -s ./ceilometer-%{python3_version} %{buildroot}%{_bindir}/ceilometer-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/ceilometer %{buildroot}%{_bindir}/ceilometer-%{python2_version}
ln -s ./ceilometer-%{python2_version} %{buildroot}%{_bindir}/ceilometer-2
ln -s ./ceilometer-2 %{buildroot}%{_bindir}/ceilometer
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/%{sname}/tests
%if 0%{?with_python3}
rm -fr %{buildroot}%{python3_sitelib}/%{sname}/tests
%endif
# Build HTML docs
%{__python2} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -rf doc/build/html/.doctrees doc/build/html/.buildinfo
# WRS
install -d %{buildroot}/%{_sysconfdir}/bash_completion.d
install -m 664 tools/ceilometer.bash_completion %{buildroot}/%{_sysconfdir}/bash_completion.d/ceilometer.bash_completion
# prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%files -n python2-%{sname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{sname}
%{python2_sitelib}/*.egg-info
%{_bindir}/ceilometer
%{_bindir}/ceilometer-2
%{_bindir}/ceilometer-%{python2_version}
%{_sysconfdir}/bash_completion.d/ceilometer.bash_completion
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_bindir}/ceilometer-3
%{_bindir}/ceilometer-%{python3_version}
%{_sysconfdir}/bash_completion.d/ceilometer.bash_completion
%endif # with_python3
%files doc
%license LICENSE
%doc doc/build/html
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Fri Aug 11 2017 Alfredo Moralejo <amoralej@redhat.com> 2.9.0-1
- Update to 2.9.0

View File

@ -1,10 +1,3 @@
TAR_NAME=python-cinderclient
SRC_DIR=$CGCS_BASE/git/python-cinderclient
# Tar everything found in this subdirectory. Define this if source need to be collected into a tarball in SOURCES.
# Tar file name and version are derived from PKG-INFO. Alternatively you may define TAR_NAME ad VERSION
# A Space separated list of paths to copy to .distro/centos7/rpmbuild/SOURCES.
#COPY_LIST="$CGCS_BASE/downloads/$CLIENT_NAME-$CLIENT_VER.tar.gz $PKG_BASE/$CLIENT_NAME/*"
TIS_BASE_SRCREV=3640aeab6e11987288a2f149fbeedb1c026045e2
TIS_PATCH_VER=GITREVCOUNT
TIS_PATCH_VER=0

View File

@ -5,8 +5,12 @@
%global with_python3 1
%endif
%global common_desc \
Client library (cinderclient python module) and command line utility \
(cinder) for interacting with OpenStack Cinder (Block Storage) API.
Name: python-cinderclient
Version: 3.1.0
Version: 4.0.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Cinder
@ -19,34 +23,37 @@ BuildArch: noarch
BuildRequires: git
%description
Client library (cinderclient python module) and command line utility
(cinder) for interacting with OpenStack Cinder (Block Storage) API.
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Cinder
%{?python_provide:%python_provide python2-%{sname}}
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-pbr
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
%if 0%{?fedora} > 0
BuildRequires: python2-d2to1
%else
BuildRequires: python-d2to1
%endif
Requires: python-babel
Requires: python-pbr
Requires: python-prettytable
Requires: python-requests
Requires: python-setuptools
Requires: python2-babel
Requires: python2-pbr
Requires: python2-prettytable
Requires: python2-requests
Requires: python2-six
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-utils >= 3.33.0
%if 0%{?fedora} > 0
Requires: python2-simplejson
%else
Requires: python-simplejson
Requires: python-six
Requires: python-keystoneauth1 >= 2.21.0
Requires: python-oslo-i18n >= 3.9.0
Requires: python-oslo-utils >= 3.20.0
%endif
%description -n python2-%{sname}
Client library (cinderclient python module) and command line utility
(cinder) for interacting with OpenStack Cinder (Block Storage) API.
%{common_desc}
%if 0%{?with_python3}
@ -66,13 +73,12 @@ Requires: python3-requests
Requires: python3-setuptools
Requires: python3-simplejson
Requires: python3-six
Requires: python3-keystoneauth1 >= 2.21.0
Requires: python3-oslo-i18n >= 3.9.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
%description -n python3-%{sname}
Client library (cinderclient python module) and command line utility
(cinder) for interacting with OpenStack Cinder (Block Storage) API.
%{common_desc}
%endif
@ -85,16 +91,10 @@ BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
%description doc
Client library (cinderclient python module) and command line utility
(cinder) for interacting with OpenStack Cinder (Block Storage) API.
%{common_desc}
This package contains auto-generated documentation.
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%prep
%autosetup -n %{name}-%{upstream_version} -S git
@ -113,18 +113,13 @@ export PBR_VERSION=%{version}
%py3_build
%endif
# FIXME (amoralej): following manual edit on conf.py is required for man page
# until https://review.openstack.org/#/c/489123 is merged
sed -i 's/man\/cinder/user\/cinder/' doc/source/conf.py
%{__python2} setup.py build_sphinx -b html
%{__python2} setup.py build_sphinx -b man
sphinx-build -W -b html doc/source doc/build/html
sphinx-build -W -b man doc/source doc/build/man
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/cinder %{buildroot}%{_bindir}/cinder-%{python3_version}
@ -151,6 +146,7 @@ install -p -D -m 644 doc/build/man/cinder.1 %{buildroot}%{_mandir}/man1/cinder.1
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
@ -173,6 +169,12 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='
%files doc
%doc doc/build/html
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
@ -186,6 +188,6 @@ Contains python wheels for %{name}
/wheels/*
%changelog
* Fri Aug 11 2017 Alfredo Moralejo <amoralej@redhat.com> 3.1.0-1
- Update to 3.1.0
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 4.0.1-1
- Update to 4.0.1

View File

@ -0,0 +1,166 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname cinderclient
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
Client library (cinderclient python module) and command line utility \
(cinder) for interacting with OpenStack Cinder (Block Storage) API.
Name: python-cinderclient
Version: 4.0.1
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Cinder
License: ASL 2.0
URL: http://github.com/openstack/python-cinderclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: git
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Cinder
%{?python_provide:%python_provide python2-%{sname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
%if 0%{?fedora} > 0
BuildRequires: python2-d2to1
%else
BuildRequires: python-d2to1
%endif
Requires: python2-babel
Requires: python2-pbr
Requires: python2-prettytable
Requires: python2-requests
Requires: python2-six
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-utils >= 3.33.0
%if 0%{?fedora} > 0
Requires: python2-simplejson
%else
Requires: python-simplejson
%endif
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Cinder
%{?python_provide:%python_provide python3-%{sname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-d2to1
Requires: python3-babel
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-requests
Requires: python3-setuptools
Requires: python3-simplejson
Requires: python3-six
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
%description -n python3-%{sname}
%{common_desc}
%endif
%package doc
Summary: Documentation for OpenStack Cinder API Client
Group: Documentation
BuildRequires: python-reno
BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
%description doc
%{common_desc}
This package contains auto-generated documentation.
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Remove bundled egg-info
rm -rf python_cinderclient.egg-info
# Let RPM handle the requirements
rm -f {,test-}requirements.txt
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
sphinx-build -W -b html doc/source doc/build/html
sphinx-build -W -b man doc/source doc/build/man
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/cinder %{buildroot}%{_bindir}/cinder-%{python3_version}
ln -s ./cinder-%{python3_version} %{buildroot}%{_bindir}/cinder-3
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/cinderclient/tests
%endif
%py2_install
mv %{buildroot}%{_bindir}/cinder %{buildroot}%{_bindir}/cinder-%{python2_version}
ln -s ./cinder-%{python2_version} %{buildroot}%{_bindir}/cinder-2
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/cinderclient/tests
ln -s ./cinder-2 %{buildroot}%{_bindir}/cinder
install -p -D -m 644 tools/cinder.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/cinder.bash_completion
install -p -D -m 644 doc/build/man/cinder.1 %{buildroot}%{_mandir}/man1/cinder.1
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{_bindir}/cinder
%{_bindir}/cinder-2*
%{python2_sitelib}/cinderclient
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d/cinder.bash_completion
%{_mandir}/man1/cinder.1*
%if 0%{?with_python3}
%files -n python3-%{sname}
%doc README.rst
%license LICENSE
%{_bindir}/cinder-3*
%{python3_sitelib}/cinderclient
%{python3_sitelib}/*.egg-info
%endif
%files doc
%doc doc/build/html
%changelog
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 4.0.1-1
- Update to 4.0.1

View File

@ -1,5 +1,3 @@
TAR_NAME=python-glanceclient
SRC_DIR="$CGCS_BASE/git/python-glanceclient"
COPY_LIST="$FILES_BASE/*"
TIS_BASE_SRCREV=13b25ff1fed908cfe7b4e719a97efd7121e3be96
TIS_PATCH_VER=GITREVCOUNT
TIS_PATCH_VER=0

View File

@ -1,209 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
backup_dir="/opt/backups"
tmp_dir="${backup_dir}/image_temp"
function usage {
cat <<"EOF"
Helper tool for backing up Glance images
Usage:
image-backup export <uuid> - export the image with <uuid> into backup file /opt/backups/image_<uuid>.tgz
image-backup import image_<uuid>.tgz - import the image from the backup source file at /opt/backups/image_<uuid>.tgz
into the corresponding image.
Temporary files are stored in /opt/backups/image_temp
Please consult the System Backups section of the Administration Guide.
EOF
}
function create_tmp {
if [ ! -d ${backup_dir} ]; then
echo "Error: backup directory ${backup_dir} does not exist"
exit 1
fi
# Create temporary directory
if [ ! -d ${tmp_dir} ]; then
mkdir ${tmp_dir}
fi
}
function remove_tmp {
# Remove temporary files and directory if not empty
local uuid=$1
rm -f ${tmp_dir}/${uuid}*
rmdir --ignore-fail-on-non-empty ${tmp_dir} &>/dev/null
}
function export_file_from_rbd_image {
local file=$1
rbd export -p images ${file} ${tmp_dir}/${file}
if [ $? -ne 0 ]; then
echo "Error: Failed to export image ${file} from Ceph images pool, please check status of storage cluster"
remove_tmp; exit 1
fi
}
function export_image {
local uuid=$1
# Check if the corresponding image is present in the RBD pool
rbd -p images ls | grep -q -e "^${uuid}$"
if [ $? -ne 0 ]; then
echo "Error: Corresponding file for image with id: ${uuid} was not found in the RBD images pool"
remove_tmp; exit 1
fi
# Export original image
export_file_from_rbd_image ${uuid}
# Export raw cache if present
rbd -p images ls | grep -q ${uuid}_raw
if [ $? -eq 0 ]; then
export_file_from_rbd_image ${uuid}_raw
raw="${uuid}_raw"
fi
echo -n "Creating backup archive..."
archive="${backup_dir}/image_${uuid}.tgz"
tar czf ${archive} -C ${tmp_dir} ${uuid} ${raw}
if [ $? -ne 0 ]; then
echo "Error: Failed to create archive ${archive}"
remove_tmp; exit 1
else
echo "done"
fi
echo "Backup archive ${archive} created"
}
function import_file_to_rbd_image {
local file=$1
local snap="images/${file}@snap"
rbd import --image-format 2 ${tmp_dir}/${file} images/${file}
if [ $? -ne 0 ]; then
echo "Error: Failed to import image ${file} into Ceph images pool, please check status of storage cluster"
remove_tmp; exit 1
fi
rbd snap create ${snap} 1>/dev/null
if [ $? -ne 0 ]; then
echo "Error: Failed to create snapshot ${snap}, please check status of storage cluster"
remove_tmp; exit 1
fi
rbd snap protect ${snap} 1>/dev/null
if [ $? -ne 0 ]; then
echo "Error: Failed to protect snapshot ${snap}, please check status of storage cluster"
remove_tmp; exit 1
fi
}
function import_image {
local uuid=$1
# Storage cluster must be healthy before starting the import
if [ ! "$(ceph health)" = "HEALTH_OK" ]; then
echo "Error: The storage cluster health must be HEALTH_OK before proceding"
remove_tmp; exit 1
fi
# Check if the corresponding image is already present in the RBD pool
rbd -p images ls | grep -q -e "^${uuid}$"
if [ $? -eq 0 ]; then
echo "Error: Image with id: ${uuid} is already imported"
remove_tmp; exit 1
fi
# Import original image
import_file_to_rbd_image ${uuid}
# Import raw cache
if [ -f "${tmp_dir}/${uuid}_raw" ]; then
import_file_to_rbd_image ${uuid}_raw
fi
}
if [ $EUID -ne 0 ]; then
echo "This script must be executed as root"
exit 1
fi
if [ $# -ne 2 ]; then
usage
exit 0
fi
source /etc/nova/openrc
# Check if glance is using ceph as RBD
cat /etc/glance/glance-api.conf | grep -q -e "^stores.*=.*rbd"
if [ $? -ne 0 ]; then
echo "Error: Glance is not configured to use the ceph backend."
echo "This command should be used only on setups with configured Ceph storage."
exit 1
fi
if [ "$1" = "export" ]; then
# Check that glance image is present in glance
glance image-list | tail -n +3 | awk '{print $2}' | grep -q $2
if [ $? -ne 0 ]; then
echo "Error: Glance image with id: $2 not found. Please try with an existing image id."
remove_tmp; exit 1
fi
# Only allow backup of images that use rbd as backend.
glance image-show $2 | grep 'direct_url' | awk '{print $4}' | grep -q '^rbd://'
if [ $? -ne 0 ]; then
echo "Image with id: $2 is not stored in Ceph RBD. Backup using image-backup tool is not needed."
echo "Please consult the Software Management Manual for more details."
remove_tmp; exit 1
fi
create_tmp
export_image $2
remove_tmp
elif [ "$1" = "import" ]; then
# Check that the input file format is correct
if [[ ! $2 =~ ^image_.*\.tgz$ ]]; then
echo "Error: Source file name must conform to image_<uuid>.tgz format"
exit 1
fi
# Check that the source file exists
if [ ! -f ${backup_dir}/$2 ]; then
echo "Error: File $2 does not exists in ${backup_dir}"
exit 1
fi
# Get glance uuid from filename
uuid=$(echo $2 | sed "s/^image_\(.*\)\.tgz/\1/g")
# Check that glance has this image in the database
glance image-list | grep -q $uuid
if [ $? -ne 0 ]; then
echo "Error: Glance image with id: ${uuid} not found. Please try with an existing image id."
exit 1
fi
create_tmp
# Extract the files that need to be imported into the temp directory
echo -n "Extracting files..."
tar xfz ${backup_dir}/$2 -C ${tmp_dir} 1>/dev/null
if [ $? -ne 0 ]; then
echo "Error: Failed to extract archive ${backup_dir}/$2 into ${tmp_dir}."
remove_tmp; exit 1
fi
echo "done"
# Importing images into RBD
import_image $uuid
remove_tmp
else
usage
fi

View File

@ -1,31 +1,34 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname glanceclient
%global with_doc 0
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the OpenStack Glance API. There's a Python API (the \
glanceclient module), and a command-line script (glance). Each implements \
100% of the OpenStack Glance API.
Name: python-glanceclient
Epoch: 1
Version: 2.8.0
Version: 2.13.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Glance
License: ASL 2.0
URL: https://launchpad.net/python-glanceclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
#WRS
Source1: image-backup.sh
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
This is a client for the OpenStack Glance API. There's a Python API (the
glanceclient module), and a command-line script (glance). Each implements
100% of the OpenStack Glance API.
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Glance
@ -34,24 +37,27 @@ Summary: Python API and CLI for OpenStack Glance
BuildRequires: python2-devel
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-setuptools
BuildRequires: python-pbr
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-utils >= 3.20.0
Requires: python-pbr
Requires: python-prettytable
Requires: pyOpenSSL >= 0.14
Requires: python-requests
Requires: python-six >= 1.9.0
Requires: python2-keystoneauth1 >= 3.6.2
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pbr
Requires: python2-prettytable
Requires: python2-pyOpenSSL >= 17.1.0
Requires: python2-requests
Requires: python2-six >= 1.10.0
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: python2-warlock
Requires: python2-wrapt
%else
Requires: python-warlock
Requires: python-wrapt
%endif
%description -n python2-%{sname}
This is a client for the OpenStack Glance API. There's a Python API (the
glanceclient module), and a command-line script (glance). Each implements
100% of the OpenStack Glance API.
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
@ -62,52 +68,48 @@ BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
Requires: python3-keystoneauth1 >= 3.1.0
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-keystoneauth1 >= 3.6.2
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-pyOpenSSL >= 0.14
Requires: python3-pyOpenSSL >= 17.1.0
Requires: python3-requests
Requires: python3-six >= 1.9.0
Requires: python3-six >= 1.10.0
Requires: python3-warlock
Requires: python3-wrapt
%description -n python3-%{sname}
This is a client for the OpenStack Glance API. There's a Python API (the
glanceclient module), and a command-line script (glance). Each implements
100% of the OpenStack Glance API.
%{common_desc}
%endif
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Glance API Client
BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-keystoneauth1
BuildRequires: python-oslo-utils
BuildRequires: python-prettytable
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-keystoneauth1
BuildRequires: python2-oslo-utils
BuildRequires: python2-prettytable
BuildRequires: python2-pyOpenSSL >= 17.1.0
BuildRequires: python2-sphinxcontrib-apidoc
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: python2-warlock
%else
BuildRequires: python-warlock
BuildRequires: pyOpenSSL >= 0.14
%endif
%description doc
This is a client for the OpenStack Glance API. There's a Python API (the
glanceclient module), and a command-line script (glance). Each implements
100% of the OpenStack Glance API.
%{common_desc}
This package contains auto-generated documentation.
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
rm -rf test-requirements.txt
%py_req_cleanup
%build
export PBR_VERSION=%{version}
@ -118,7 +120,6 @@ export PBR_VERSION=%{version}
%endif
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/glance %{buildroot}%{_bindir}/glance-%{python3_version}
@ -127,6 +128,7 @@ ln -s ./glance-%{python3_version} %{buildroot}%{_bindir}/glance-3
rm -fr %{buildroot}%{python3_sitelib}/glanceclient/tests
%endif
%py2_install
mv %{buildroot}%{_bindir}/glance %{buildroot}%{_bindir}/glance-%{python2_version}
ln -s ./glance-%{python2_version} %{buildroot}%{_bindir}/glance-2
@ -136,7 +138,6 @@ ln -s ./glance-2 %{buildroot}%{_bindir}/glance
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/glance.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/glance
install -p -D -m 500 %{SOURCE1} %{buildroot}/sbin/image-backup
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
@ -144,13 +145,15 @@ install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/glanceclient/tests
export PYTHONPATH="$( pwd ):$PYTHONPATH"
sphinx-build -b html doc/source html
%if 0%{?with_doc}
# generate html docs
sphinx-build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
# generate man page
sphinx-build -b man doc/source man
install -p -D -m 644 man/glance.1 %{buildroot}%{_mandir}/man1/glance.1
sphinx-build -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/glance.1 %{buildroot}%{_mandir}/man1/glance.1
%endif
# prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients/%{name}
tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
@ -162,8 +165,9 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --e
%{python2_sitelib}/glanceclient
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%if 0%{?with_doc}
%{_mandir}/man1/glance.1.gz
"/sbin/image-backup"
%endif
%{_bindir}/glance
%{_bindir}/glance-2
%{_bindir}/glance-%{python2_version}
@ -180,9 +184,17 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --e
%{_bindir}/glance-%{python3_version}
%endif
%if 0%{?with_doc}
%files doc
%doc html
%doc doc/build/html
%license LICENSE
%endif
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz
@ -197,6 +209,12 @@ Contains python wheels for %{name}
/wheels/*
%changelog
* Fri Aug 11 2017 Alfredo Moralejo <amoralej@redhat.com> 1:2.8.0-1
- Update to 2.8.0
* Wed Dec 19 2018 RDO <dev@lists.rdoproject.org> 1:2.13.1-1
- Update to 2.13.1
* Mon Nov 05 2018 RDO <dev@lists.rdoproject.org> 1:2.13.0-1
- Update to 2.13.0
* Wed Aug 08 2018 RDO <dev@lists.rdoproject.org> 1:2.12.1-1
- Update to 2.12.1

View File

@ -0,0 +1,190 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname glanceclient
%global with_doc 1
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the OpenStack Glance API. There's a Python API (the \
glanceclient module), and a command-line script (glance). Each implements \
100% of the OpenStack Glance API.
Name: python-glanceclient
Epoch: 1
Version: 2.13.1
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Glance
License: ASL 2.0
URL: https://launchpad.net/python-glanceclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Glance
%{?python_provide:%python_provide python2-glanceclient}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
Requires: python2-keystoneauth1 >= 3.6.2
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pbr
Requires: python2-prettytable
Requires: python2-pyOpenSSL >= 17.1.0
Requires: python2-requests
Requires: python2-six >= 1.10.0
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: python2-warlock
Requires: python2-wrapt
%else
Requires: python-warlock
Requires: python-wrapt
%endif
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Glance
%{?python_provide:%python_provide python3-glanceclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
Requires: python3-keystoneauth1 >= 3.6.2
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-pyOpenSSL >= 17.1.0
Requires: python3-requests
Requires: python3-six >= 1.10.0
Requires: python3-warlock
Requires: python3-wrapt
%description -n python3-%{sname}
%{common_desc}
%endif
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Glance API Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-keystoneauth1
BuildRequires: python2-oslo-utils
BuildRequires: python2-prettytable
BuildRequires: python2-pyOpenSSL >= 17.1.0
BuildRequires: python2-sphinxcontrib-apidoc
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: python2-warlock
%else
BuildRequires: python-warlock
%endif
%description doc
%{common_desc}
This package contains auto-generated documentation.
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
%py_req_cleanup
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/glance %{buildroot}%{_bindir}/glance-%{python3_version}
ln -s ./glance-%{python3_version} %{buildroot}%{_bindir}/glance-3
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/glanceclient/tests
%endif
%py2_install
mv %{buildroot}%{_bindir}/glance %{buildroot}%{_bindir}/glance-%{python2_version}
ln -s ./glance-%{python2_version} %{buildroot}%{_bindir}/glance-2
ln -s ./glance-2 %{buildroot}%{_bindir}/glance
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/glance.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/glance
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/glanceclient/tests
%if 0%{?with_doc}
# generate html docs
sphinx-build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
# generate man page
sphinx-build -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/glance.1 %{buildroot}%{_mandir}/man1/glance.1
%endif
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/glanceclient
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%if 0%{?with_doc}
%{_mandir}/man1/glance.1.gz
%endif
%{_bindir}/glance
%{_bindir}/glance-2
%{_bindir}/glance-%{python2_version}
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_mandir}/man1/glance.1.gz
%{_bindir}/glance-3
%{_bindir}/glance-%{python3_version}
%endif
%if 0%{?with_doc}
%files doc
%doc doc/build/html
%license LICENSE
%endif
%changelog
* Wed Dec 19 2018 RDO <dev@lists.rdoproject.org> 1:2.13.1-1
- Update to 2.13.1
* Mon Nov 05 2018 RDO <dev@lists.rdoproject.org> 1:2.13.0-1
- Update to 2.13.0
* Wed Aug 08 2018 RDO <dev@lists.rdoproject.org> 1:2.12.1-1
- Update to 2.12.1

View File

@ -1,5 +1,3 @@
VERSION=7.0.1
TAR_NAME=gnocchiclient
COPY_LIST="$CGCS_BASE/downloads/$TAR_NAME-$VERSION.tar.gz"
TIS_PATCH_VER=1
SRC_DIR=$CGCS_BASE/git/python-gnocchiclient
TIS_PATCH_VER=0

View File

@ -14,14 +14,17 @@ This is a client library for Gnocchi built on the Gnocchi API. It \
provides a Python API (the gnocchiclient module) and a command-line tool.
Name: python-gnocchiclient
Version: 7.0.1
Version: 7.0.4
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Gnocchi
License: ASL 2.0
URL: https://github.com/openstack/%{name}
Source0: https://pypi.io/packages/source/g/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
# FIXME(jpena): remove this patch once a version > 7.0.1 is released
%if "%{version}" == "7.0.1"
Patch0001: 0001-Avoid-using-openstack-doc-tools.patch
%endif
BuildArch: noarch
@ -37,15 +40,15 @@ BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-tools
Requires: python-cliff >= 1.16.0
Requires: python2-osc-lib >= 1.7.0
Requires: python2-cliff >= 2.10
Requires: python2-osc-lib >= 1.8.0
Requires: python2-keystoneauth1 >= 2.0.0
Requires: python2-six >= 1.10.0
Requires: python2-futurist
Requires: python2-ujson
Requires: python2-pbr
Requires: python2-iso8601
Requires: python-dateutil
Requires: python2-dateutil
Requires: python2-debtcollector
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: python2-monotonic
@ -62,9 +65,7 @@ Summary: Documentation for OpenStack Gnocchi API Client
Group: Documentation
BuildRequires: python2-sphinx
BuildRequires: python2-oslo-sphinx
BuildRequires: python2-openstack-doc-tools
BuildRequires: python-cliff
BuildRequires: python2-cliff >= 2.10
BuildRequires: python2-keystoneauth1
BuildRequires: python2-six
BuildRequires: python2-futurist
@ -74,7 +75,7 @@ BuildRequires: python2-sphinx_rtd_theme
BuildRequires: python2-babel
# Runtime requirements needed during documentation build
BuildRequires: python2-osc-lib
BuildRequires: python-dateutil
BuildRequires: python2-dateutil
%description doc
%{common_desc}
@ -99,8 +100,8 @@ BuildRequires: python3-pbr
BuildRequires: python3-setuptools
BuildRequires: python3-tools
Requires: python3-cliff >= 1.16.0
Requires: python3-osc-lib >= 1.7.0
Requires: python3-cliff >= 2.10
Requires: python3-osc-lib >= 1.8.0
Requires: python3-keystoneauth1 >= 2.0.0
Requires: python3-six >= 1.10.0
Requires: python3-futurist
@ -126,14 +127,9 @@ Requires: python3-%{pypi_name} = %{version}-%{release}
%description
%{common_desc}
%package sdk
Summary: SDK files for %{pypi_name}
%description sdk
Contains SDK files for %{pypi_name} package
%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
%autosetup -p1 -n %{pypi_name}-%{upstream_version}
%if 0%{?with_python3}
rm -rf %{py3dir}
@ -145,7 +141,7 @@ cp -a . %{py3dir}
rm -rf gnocchiclient.egg-info
# Let RPM handle the requirements
rm -f test-requirements.txt
rm -f {,test-}requirements.txt
%build
export PBR_VERSION=%{version}
@ -168,9 +164,11 @@ popd
%endif
%{__python2} setup.py install --skip-build --root %{buildroot}
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# rename binaries, make compat symlinks
install -m 755 -d %{buildroot}/%{_bindir}
pushd %{buildroot}%{_bindir}
@ -185,7 +183,6 @@ done
popd
# Some env variables required to successfully build our doc
export PATH=$PATH:%{buildroot}%{_bindir}
export PYTHONPATH=.
export LANG=en_US.utf8
python setup.py build_sphinx -b html
@ -197,6 +194,7 @@ rm -rf doc/build/html/.doctrees doc/build/html/.buildinfo
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{pypi_name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{pypi_name}-%{version}
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
@ -230,6 +228,12 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{pypi_name}-%{version}.tgz --excl
%files -n python-%{pypi_name}-doc
%doc doc/build/html
%package sdk
Summary: SDK files for %{pypi_name}
%description sdk
Contains SDK files for %{pypi_name} package
%files sdk
/usr/share/remote-clients/%{pypi_name}-%{version}.tgz
@ -242,6 +246,8 @@ Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Tue Feb 13 2018 RDO <dev@lists.rdoproject.org> 7.0.1-1
- Update to 7.0.1
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 7.0.4-1
- Update to 7.0.4

View File

@ -0,0 +1,220 @@
%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
%global pypi_name gnocchiclient
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora} >= 24
%global with_python3 1
%endif
%global common_desc \
This is a client library for Gnocchi built on the Gnocchi API. It \
provides a Python API (the gnocchiclient module) and a command-line tool.
Name: python-gnocchiclient
Version: 7.0.4
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Gnocchi
License: ASL 2.0
URL: https://github.com/openstack/%{name}
Source0: https://pypi.io/packages/source/g/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
# FIXME(jpena): remove this patch once a version > 7.0.1 is released
%if "%{version}" == "7.0.1"
Patch0001: 0001-Avoid-using-openstack-doc-tools.patch
%endif
BuildArch: noarch
%package -n python2-%{pypi_name}
Summary: Python API and CLI for OpenStack Gnocchi
%{?python_provide:%python_provide python2-gnocchiclient}
BuildRequires: python2-setuptools
BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-tools
Requires: python2-cliff >= 2.10
Requires: python2-osc-lib >= 1.8.0
Requires: python2-keystoneauth1 >= 2.0.0
Requires: python2-six >= 1.10.0
Requires: python2-futurist
Requires: python2-ujson
Requires: python2-pbr
Requires: python2-iso8601
Requires: python2-dateutil
Requires: python2-debtcollector
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: python2-monotonic
%else
Requires: python-monotonic
%endif
%description -n python2-%{pypi_name}
%{common_desc}
%package -n python-%{pypi_name}-doc
Summary: Documentation for OpenStack Gnocchi API Client
Group: Documentation
BuildRequires: python2-sphinx
BuildRequires: python2-cliff >= 2.10
BuildRequires: python2-keystoneauth1
BuildRequires: python2-six
BuildRequires: python2-futurist
BuildRequires: python2-ujson
BuildRequires: python2-sphinx_rtd_theme
# test
BuildRequires: python2-babel
# Runtime requirements needed during documentation build
BuildRequires: python2-osc-lib
BuildRequires: python2-dateutil
%description doc
%{common_desc}
This package contains auto-generated documentation.
%package -n python2-%{pypi_name}-tests
Summary: Python API and CLI for OpenStack Gnocchi Tests
Requires: python2-%{pypi_name} = %{version}-%{release}
%description -n python2-%{pypi_name}-tests
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Python API and CLI for OpenStack Gnocchi
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
BuildRequires: python3-tools
Requires: python3-cliff >= 2.10
Requires: python3-osc-lib >= 1.8.0
Requires: python3-keystoneauth1 >= 2.0.0
Requires: python3-six >= 1.10.0
Requires: python3-futurist
Requires: python3-ujson
Requires: python3-pbr
Requires: python3-monotonic
Requires: python3-iso8601
Requires: python3-dateutil
Requires: python3-debtcollector
%description -n python3-%{pypi_name}
%{common_desc}
%package -n python3-%{pypi_name}-tests
Summary: Python API and CLI for OpenStack Gnocchi Tests
Requires: python3-%{pypi_name} = %{version}-%{release}
%description -n python3-%{pypi_name}-tests
%{common_desc}
%endif
%description
%{common_desc}
%prep
%autosetup -p1 -n %{pypi_name}-%{upstream_version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
2to3 --write --nobackups %{py3dir}
%endif
# Remove bundled egg-info
rm -rf gnocchiclient.egg-info
# Let RPM handle the requirements
rm -f {,test-}requirements.txt
%build
%py2_build
%if 0%{?with_python3}
pushd %{py3dir}
LANG=en_US.UTF-8 %{__python3} setup.py build
popd
%endif
%install
%if 0%{?with_python3}
pushd %{py3dir}
LANG=en_US.UTF-8 %{__python3} setup.py install --skip-build --root %{buildroot}
mv %{buildroot}%{_bindir}/gnocchi %{buildroot}%{_bindir}/python3-gnocchi
popd
%endif
%{__python2} setup.py install --skip-build --root %{buildroot}
# rename binaries, make compat symlinks
install -m 755 -d %{buildroot}/%{_bindir}
pushd %{buildroot}%{_bindir}
for i in gnocchi-{2,%{?python2_shortver}}; do
ln -s gnocchi $i
done
%if 0%{?with_python3}
for i in gnocchi-{3,%{?python3_shortver}}; do
ln -s python3-gnocchi $i
done
%endif
popd
# Some env variables required to successfully build our doc
export PYTHONPATH=.
export LANG=en_US.utf8
python setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -rf doc/build/html/.doctrees doc/build/html/.buildinfo
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{_bindir}/gnocchi
%{_bindir}/gnocchi-2*
%{python2_sitelib}/gnocchiclient
%{python2_sitelib}/*.egg-info
%exclude %{python2_sitelib}/gnocchiclient/tests
%files -n python2-%{pypi_name}-tests
%license LICENSE
%{python2_sitelib}/gnocchiclient/tests
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{_bindir}/python3-gnocchi
%{_bindir}/gnocchi-3*
%{python3_sitelib}/gnocchiclient
%{python3_sitelib}/*.egg-info
%exclude %{python3_sitelib}/gnocchiclient/tests
%files -n python3-%{pypi_name}-tests
%license LICENSE
%{python3_sitelib}/gnocchiclient/tests
%endif
%files -n python-%{pypi_name}-doc
%doc doc/build/html
%changelog
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 7.0.4-1
- Update to 7.0.4

View File

@ -87,7 +87,6 @@ BuildRequires: python-saharaclient
BuildRequires: python-neutronclient
BuildRequires: python-swiftclient
BuildRequires: python-heatclient
BuildRequires: python-ceilometerclient
BuildRequires: python-glanceclient
BuildRequires: python-troveclient
BuildRequires: python-aodhclient
@ -277,7 +276,6 @@ Requires: python-oslo-service
Requires: python-oslo-log
Requires: python-oslo-versionedobjects
Requires: python-ceilometerclient
Requires: python-cinderclient
Requires: python-glanceclient
Requires: python-heatclient

View File

@ -1 +1,4 @@
TIS_PATCH_VER=3
TAR_NAME=python-heatclient
SRC_DIR=$CGCS_BASE/git/python-heatclient
TIS_PATCH_VER=0

View File

@ -1,25 +0,0 @@
From 001aa3b51766fb3b2cbb0c9a0c715650ef394f8c Mon Sep 17 00:00:00 2001
From: Al Bailey <al.bailey@windriver.com>
Date: Mon, 30 Jan 2017 12:24:46 -0500
Subject: [PATCH 1/2] Update package versioning format for Titanium Cloud format
---
SPECS/python-heatclient.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/python-heatclient.spec b/SPECS/python-heatclient.spec
index 73a1c6f..7d6d32f 100644
--- a/SPECS/python-heatclient.spec
+++ b/SPECS/python-heatclient.spec
@@ -8,7 +8,7 @@
Name: python-heatclient
Version: 1.11.0
-Release: 1%{?dist}
+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Heat
License: ASL 2.0
--
1.8.3.1

View File

@ -1,51 +0,0 @@
From e3f1154184f24103942c98fa9373763df49703c7 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:32:49 -0400
Subject: WRS: 0002-Packages-sdk-for-remote-clients.patch
---
SPECS/python-heatclient.spec | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/SPECS/python-heatclient.spec b/SPECS/python-heatclient.spec
index c5ff419..1f44763 100644
--- a/SPECS/python-heatclient.spec
+++ b/SPECS/python-heatclient.spec
@@ -92,6 +92,13 @@ the OpenStack Heat API.
This package contains auto-generated documentation.
+%package sdk
+Summary: SDK files for %{name}
+
+%description sdk
+Contains SDK files for %{name} package
+
+
%prep
%autosetup -n %{name}-%{upstream_version} -S git
@@ -128,6 +135,10 @@ install -pm 644 tools/heat.bash_completion \
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/heatclient/tests
+# prep SDK package
+mkdir -p %{buildroot}/usr/share/remote-clients/%{name}
+tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
+
%{__python2} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
@@ -164,6 +175,9 @@ install -p -D -m 644 doc/build/man/heat.1 %{buildroot}%{_mandir}/man1/heat.1
%doc doc/build/html
%license LICENSE
+%files sdk
+/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz
+
%changelog
* Mon Aug 14 2017 Alfredo Moralejo <amoralej@redhat.com> 1.11.0-1
- Update to 1.11.0
--
2.7.4

View File

@ -1,37 +0,0 @@
From 2d0e1e8effaf3c83e137af5a79eb62f3e312bd94 Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Thu, 26 Oct 2017 08:56:39 -0500
Subject: [PATCH] WRS: 0003-Apply-timezone-support-patch.patch
---
SPECS/python-heatclient.spec | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/SPECS/python-heatclient.spec b/SPECS/python-heatclient.spec
index 1f44763..12ce333 100644
--- a/SPECS/python-heatclient.spec
+++ b/SPECS/python-heatclient.spec
@@ -15,6 +15,12 @@ License: ASL 2.0
URL: https://launchpad.net/python-heatclientclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
+# WRS.
+Patch0001: 0001-timezone-support-for-heatclient.patch
+
+# BuildArch needs to be located below patches in the spec file
+
+
BuildArch: noarch
%description
@@ -101,6 +107,7 @@ Contains SDK files for %{name} package
%prep
%autosetup -n %{name}-%{upstream_version} -S git
+# autosetup applies all patches automatically
rm -rf {test-,}requirements.txt tools/{pip,test}-requires
--
1.8.3.1

View File

@ -1,3 +0,0 @@
0001-Update-package-versioning-format-for-TiS-format.patch
0002-Packages-sdk-for-remote-clients.patch
0003-Apply-timezone-support-patch.patch

View File

@ -1,224 +0,0 @@
From d144d6cfe42d8af42106f709114fd707afcfaede Mon Sep 17 00:00:00 2001
From: Litao Gao <litao.gao@windriver.com>
Date: Fri, 24 Mar 2017 04:34:54 -0400
Subject: [PATCH 1/1] timezone support for heatclient
---
heatclient/common/utils.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++
heatclient/v1/shell.py | 18 +++++++++++++++++
2 files changed, 66 insertions(+)
diff --git a/heatclient/common/utils.py b/heatclient/common/utils.py
index f2b20f1..9f2767f 100644
--- a/heatclient/common/utils.py
+++ b/heatclient/common/utils.py
@@ -18,6 +18,14 @@ import logging
import os
import textwrap
import uuid
+import sys
+import re
+
+from functools import wraps
+from cStringIO import StringIO
+from datetime import datetime
+import dateutil
+from dateutil import parser
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
@@ -371,3 +379,43 @@ def get_response_body(resp):
else:
body = None
return body
+
+
+def parse_date(string_data):
+ """Parses a date-like input string into a timezone aware Python
+ datetime.
+ """
+ pattern = r'(\d{4}-\d{2}-\d{2}[T ])?\d{2}:\d{2}:\d{2}(\.\d{6})?Z?'
+
+ def convert_date(matchobj):
+ formats = ["%Y-%m-%dT%H:%M:%S.%f", "%Y-%m-%d %H:%M:%S.%f",
+ "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S",
+ "%Y-%m-%dT%H:%M:%SZ", "%H:%M:%S"]
+ datestring = matchobj.group(0)
+ if datestring:
+ for format in formats:
+ try:
+ datetime.strptime(datestring, format)
+ datestring += "+0000"
+ parsed = parser.parse(datestring)
+ converted = parsed.astimezone(dateutil.tz.tzlocal())
+ return datetime.strftime(converted, format)
+ except Exception:
+ pass
+ return datestring
+
+ return re.sub(pattern, convert_date, str(string_data))
+
+
+def timestamp_converter(display):
+ """
+ Decorator that parse the timestamp and convert according timezone
+ """
+ @wraps(display)
+ def new_f(*args, **kwargs):
+ sys.stdout = mystdout = StringIO()
+ display(*args, **kwargs)
+ sys.stdout = sys.__stdout__
+ content = mystdout.getvalue()
+ print parse_date(content)
+ return new_f
diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py
index ac4ecb9..d8c8324 100644
--- a/heatclient/v1/shell.py
+++ b/heatclient/v1/shell.py
@@ -45,6 +45,7 @@ def show_deprecated(deprecated, recommended):
)
+@utils.timestamp_converter
@utils.arg('-f', '--template-file', metavar='<FILE>',
help=_('Path to the template.'))
@utils.arg('-e', '--environment-file', metavar='<FILE or URL>',
@@ -414,6 +415,7 @@ def do_action_check(hc, args):
do_stack_list(hc)
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to describe.'))
@utils.arg('--no-resolve-outputs', action="store_true",
@@ -592,6 +594,7 @@ def do_stack_cancel_update(hc, args):
do_stack_list(hc)
+@utils.timestamp_converter
@utils.arg('-s', '--show-deleted', default=False, action="store_true",
help=_('Include soft-deleted stacks in the stack listing.'))
@utils.arg('-n', '--show-nested', default=False, action="store_true",
@@ -695,6 +698,7 @@ def do_stack_list(hc, args=None):
utils.print_list(stacks, fields, sortby_index=sortby_index)
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to query.'))
def do_output_list(hc, args):
@@ -856,6 +860,7 @@ def do_resource_type_template(hc, args):
print(utils.format_output(template))
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to get the template for.'))
def do_template_show(hc, args):
@@ -929,6 +934,7 @@ def do_template_validate(hc, args):
print(jsonutils.dumps(validation, indent=2, ensure_ascii=False))
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to show the resources for.'))
@utils.arg('-n', '--nested-depth', metavar='<DEPTH>',
@@ -970,6 +976,7 @@ def do_resource_list(hc, args):
utils.print_list(resources, fields, sortby_index=4)
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to show the resource for.'))
@utils.arg('resource', metavar='<RESOURCE>',
@@ -1135,6 +1142,7 @@ def do_hook_clear(hc, args):
hook_type, resource_pattern)
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to show the events for.'))
@utils.arg('-r', '--resource', metavar='<RESOURCE>',
@@ -1258,6 +1266,7 @@ def do_event(hc, args):
do_event_show(hc, args)
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to show the events for.'))
@utils.arg('resource', metavar='<RESOURCE>',
@@ -1285,6 +1294,7 @@ def do_event_show(hc, args):
utils.print_dict(event.to_dict(), formatters=formatters)
+@utils.timestamp_converter
@utils.arg('-f', '--definition-file', metavar='<FILE or URL>',
help=_('Path to JSON/YAML containing map defining '
'<inputs>, <outputs>, and <options>.'))
@@ -1355,6 +1365,7 @@ def do_config_list(hc, args):
utils.print_list(scs, fields, sortby_index=None)
+@utils.timestamp_converter
@utils.arg('id', metavar='<ID>',
help=_('ID of the config.'))
@utils.arg('-c', '--config-only', default=False, action="store_true",
@@ -1475,6 +1486,7 @@ def do_deployment_list(hc, args):
utils.print_list(deployments, fields, sortby_index=5)
+@utils.timestamp_converter
@utils.arg('id', metavar='<ID>',
help=_('ID of the deployment.'))
def do_deployment_show(hc, args):
@@ -1490,6 +1502,7 @@ def do_deployment_show(hc, args):
print(jsonutils.dumps(sd.to_dict(), indent=2))
+@utils.timestamp_converter
@utils.arg('id', metavar='<ID>',
help=_('ID of the server to fetch deployments for.'))
def do_deployment_metadata_show(hc, args):
@@ -1535,6 +1548,7 @@ def do_deployment_delete(hc, args):
{'count': failure_count, 'total': len(args.id)})
+@utils.timestamp_converter
@utils.arg('id', metavar='<ID>',
help=_('ID deployment to show the output for.'))
@utils.arg('output', metavar='<OUTPUT NAME>', nargs='?', default=None,
@@ -1589,6 +1603,7 @@ def do_build_info(hc, args):
utils.print_dict(result, formatters=formatters)
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of stack to snapshot.'))
@utils.arg('-n', '--name', metavar='<NAME>',
@@ -1608,6 +1623,7 @@ def do_stack_snapshot(hc, args):
print(jsonutils.dumps(snapshot, indent=2, ensure_ascii=False))
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of the stack containing the snapshot.'))
@utils.arg('snapshot', metavar='<SNAPSHOT>',
@@ -1655,6 +1671,7 @@ def do_stack_restore(hc, args):
raise exc.CommandError(_('Stack or snapshot not found'))
+@utils.timestamp_converter
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of the stack containing the snapshots.'))
def do_snapshot_list(hc, args):
@@ -1678,6 +1695,7 @@ def do_snapshot_list(hc, args):
utils.print_list(snapshots["snapshots"], fields, formatters=formatters)
+@utils.timestamp_converter
def do_service_list(hc, args=None):
'''List the Heat engines.'''
show_deprecated('heat service-list',
--
1.8.3.1

View File

@ -0,0 +1,230 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname heatclient
%global with_doc 0
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the OpenStack Heat API. There's a Python API (the \
heatclient module), and a command-line script (heat). Each implements 100% of \
the OpenStack Heat API.
Name: python-heatclient
Version: 1.16.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Heat
License: ASL 2.0
URL: https://launchpad.net/python-heatclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Heat
%{?python_provide:%python_provide python2-heatclient}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python2-pbr
BuildRequires: git
Requires: python2-babel
Requires: python2-iso8601
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-osc-lib >= 1.8.0
Requires: python2-prettytable
Requires: python2-pbr
Requires: python2-six
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-swiftclient >= 3.2.0
Requires: python2-requests
Requires: python2-cliff
%if 0%{?fedora} > 0
Requires: python2-pyyaml
%else
Requires: PyYAML
%endif
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Heat
%{?python_provide:%python_provide python3-heatclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
Requires: python3-babel
Requires: python3-cliff
Requires: python3-iso8601
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-osc-lib >= 1.8.0
Requires: python3-prettytable
Requires: python3-pbr
Requires: python3-six
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-swiftclient >= 3.2.0
Requires: python3-requests
Requires: python3-PyYAML
%description -n python3-%{sname}
%{common_desc}
%endif
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Heat API Client
BuildRequires: python2-sphinx
BuildRequires: python2-sphinxcontrib-apidoc
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-babel
BuildRequires: python2-iso8601
BuildRequires: python2-keystoneauth1
BuildRequires: python2-osc-lib
BuildRequires: python2-prettytable
BuildRequires: python2-pbr
BuildRequires: python2-six
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-utils
BuildRequires: python2-oslo-i18n
BuildRequires: python2-swiftclient
BuildRequires: python2-requests
BuildRequires: python2-cliff
%description doc
%{common_desc}
This package contains auto-generated documentation.
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
rm -rf {test-,}requirements.txt tools/{pip,test}-requires
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
echo "%{version}" > %{buildroot}%{python3_sitelib}/heatclient/versioninfo
mv %{buildroot}%{_bindir}/heat %{buildroot}%{_bindir}/heat-%{python3_version}
ln -s ./heat-%{python3_version} %{buildroot}%{_bindir}/heat-3
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/heatclient/tests
%endif
%py2_install
echo "%{version}" > %{buildroot}%{python2_sitelib}/heatclient/versioninfo
mv %{buildroot}%{_bindir}/heat %{buildroot}%{_bindir}/heat-%{python2_version}
ln -s ./heat-%{python2_version} %{buildroot}%{_bindir}/heat-2
ln -s ./heat-2 %{buildroot}%{_bindir}/heat
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/heat.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/heat
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/heatclient/tests
%if 0%{?with_doc}
export PYTHONPATH=.
sphinx-build -W -b html doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
# generate man page
sphinx-build -W -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/heat.1 %{buildroot}%{_mandir}/man1/heat.1
%endif
# STX: stage wheels
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# STX: prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/heatclient
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%if 0%{?with_doc}
%{_mandir}/man1/heat.1.gz
%endif
%{_bindir}/heat
%{_bindir}/heat-2
%{_bindir}/heat-%{python2_version}
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%if 0%{?with_doc}
%{_mandir}/man1/heat.1.gz
%endif
%{_bindir}/heat-3
%{_bindir}/heat-%{python3_version}
%endif
%if 0%{?with_doc}
%files doc
%doc doc/build/html
%license LICENSE
%endif
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Fri Aug 10 2018 RDO <dev@lists.rdoproject.org> 1.16.1-1
- Update to 1.16.1

View File

@ -0,0 +1,185 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname heatclient
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the OpenStack Heat API. There's a Python API (the \
heatclient module), and a command-line script (heat). Each implements 100% of \
the OpenStack Heat API.
Name: python-heatclient
Version: 1.16.1
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Heat
License: ASL 2.0
URL: https://launchpad.net/python-heatclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Heat
%{?python_provide:%python_provide python2-heatclient}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
BuildRequires: git
Requires: python2-babel
Requires: python2-iso8601
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-osc-lib >= 1.8.0
Requires: python2-prettytable
Requires: python2-pbr
Requires: python2-six
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-swiftclient >= 3.2.0
Requires: python2-requests
Requires: python2-cliff
%if 0%{?fedora} > 0
Requires: python2-pyyaml
%else
Requires: PyYAML
%endif
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Heat
%{?python_provide:%python_provide python3-heatclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
Requires: python3-babel
Requires: python3-cliff
Requires: python3-iso8601
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-osc-lib >= 1.8.0
Requires: python3-prettytable
Requires: python3-pbr
Requires: python3-six
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-swiftclient >= 3.2.0
Requires: python3-requests
Requires: python3-PyYAML
%description -n python3-%{sname}
%{common_desc}
%endif
%package doc
Summary: Documentation for OpenStack Heat API Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-babel
BuildRequires: python2-iso8601
BuildRequires: python2-keystoneauth1
BuildRequires: python2-osc-lib
BuildRequires: python2-prettytable
BuildRequires: python2-pbr
BuildRequires: python2-six
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-utils
BuildRequires: python2-oslo-i18n
BuildRequires: python2-swiftclient
BuildRequires: python2-requests
BuildRequires: python2-cliff
%description doc
%{common_desc}
This package contains auto-generated documentation.
%prep
%autosetup -n %{name}-%{upstream_version} -S git
rm -rf {test-,}requirements.txt tools/{pip,test}-requires
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python3}
%py3_install
echo "%{version}" > %{buildroot}%{python3_sitelib}/heatclient/versioninfo
mv %{buildroot}%{_bindir}/heat %{buildroot}%{_bindir}/heat-%{python3_version}
ln -s ./heat-%{python3_version} %{buildroot}%{_bindir}/heat-3
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/heatclient/tests
%endif
%py2_install
echo "%{version}" > %{buildroot}%{python2_sitelib}/heatclient/versioninfo
mv %{buildroot}%{_bindir}/heat %{buildroot}%{_bindir}/heat-%{python2_version}
ln -s ./heat-%{python2_version} %{buildroot}%{_bindir}/heat-2
ln -s ./heat-2 %{buildroot}%{_bindir}/heat
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/heat.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/heat
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/heatclient/tests
export PYTHONPATH=.
sphinx-build -W -b html doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
# generate man page
sphinx-build -W -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/heat.1 %{buildroot}%{_mandir}/man1/heat.1
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/heatclient
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_mandir}/man1/heat.1.gz
%{_bindir}/heat
%{_bindir}/heat-2
%{_bindir}/heat-%{python2_version}
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_mandir}/man1/heat.1.gz
%{_bindir}/heat-3
%{_bindir}/heat-%{python3_version}
%endif
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Fri Aug 10 2018 RDO <dev@lists.rdoproject.org> 1.16.1-1
- Update to 1.16.1

View File

@ -1,2 +0,0 @@
mirror:Source/python-heatclient-1.11.0-1.el7.src.rpm

View File

@ -1,5 +1,3 @@
TAR_NAME="python-ironicclient"
SRC_DIR="$CGCS_BASE/git/python-ironicclient"
TIS_BASE_SRCREV=096834f09ae5d8cabc8c0b1ccbac271ddb13e2ee
TIS_PATCH_VER=1
TIS_PATCH_VER=0

View File

@ -6,9 +6,11 @@
%global sname ironicclient
%global common_desc A python and command line client library for Ironic
Name: python-ironicclient
Version: 1.17.0
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Version: 2.5.0
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python client for Ironic
License: ASL 2.0
@ -18,38 +20,42 @@ BuildArch: noarch
%description
A python and command line client library for Ironic.
%{common_desc}
%package -n python2-%{sname}
Summary: Python client for Ironic
BuildRequires: python2-devel
BuildRequires: python2-pbr >= 2.0.0
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-pbr >= 2.0.0
BuildRequires: python-setuptools
Requires: python-appdirs >= 1.3.0
Requires: python2-appdirs >= 1.3.0
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-pbr >= 2.0.0
Requires: python2-prettytable
Requires: python2-six >= 1.10.0
Requires: python2-osc-lib >= 1.10.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-requests
%if 0%{?fedora} > 0
Requires: python2-dogpile-cache >= 0.6.2
Requires: python2-jsonschema
Requires: python2-pyyaml
%else
Requires: python-dogpile-cache >= 0.6.2
Requires: python-httplib2
Requires: python-jsonschema
Requires: python-openstackclient >= 3.3.0
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-pbr >= 2.0.0
Requires: python-prettytable
Requires: python-six >= 1.9.0
Requires: python-osc-lib >= 1.7.0
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-serialization >= 1.10.0
Requires: python-oslo-utils >= 3.20.0
Requires: python-requests
Requires: PyYAML
%endif
%{?python_provide:%python_provide python2-%{sname}}
%description -n python2-%{sname}
A python and command line client library for Ironic
%{common_desc}
%if 0%{?with_python3}
@ -62,24 +68,22 @@ BuildRequires: python3-setuptools
Requires: python3-appdirs >= 1.3.0
Requires: python3-dogpile-cache >= 0.6.2
Requires: python3-httplib2
Requires: python3-jsonschema
Requires: python3-openstackclient >= 3.3.0
Requires: python3-keystoneauth1 >= 3.1.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-pbr >= 2.0.0
Requires: python3-prettytable
Requires: python3-six >= 1.9.0
Requires: python3-osc-lib >= 1.7.0
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-serialization >= 1.10.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-six >= 1.10.0
Requires: python3-osc-lib >= 1.10.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-requests
Requires: python3-PyYAML
%{?python_provide:%python_provide python3-%{sname}}
%description -n python3-%{sname}
A python and command line client library for Ironic
%{common_desc}
%endif
%prep
@ -112,11 +116,10 @@ ln -s ./ironic-%{python2_version} %{buildroot}%{_bindir}/ironic-2
ln -s ./ironic-2 %{buildroot}%{_bindir}/ironic
install -p -D -m 644 tools/ironic.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/ironic.bash_completion
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
@ -125,7 +128,6 @@ install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%{_bindir}/ironic-%{python2_version}
%{python2_sitelib}/ironicclient*
%{python2_sitelib}/python_ironicclient*
%{_sysconfdir}/bash_completion.d/ironic.bash_completion
%if 0%{?with_python3}
%files -n python3-%{sname}
@ -148,9 +150,6 @@ Contains python wheels for %{name}
%changelog
* Wed Sep 06 2017 rdo-trunk <javier.pena@redhat.com> 1.17.0-1
- Update to 1.17.0
* Mon Aug 14 2017 Alfredo Moralejo <amoralej@redhat.com> 1.16.0-1
- Update to 1.16.0
* Fri Aug 10 2018 RDO <dev@lists.rdoproject.org> 2.5.0-1
- Update to 2.5.0

View File

@ -0,0 +1,138 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif
%global sname ironicclient
%global common_desc A python and command line client library for Ironic
Name: python-ironicclient
Version: 2.5.0
Release: 1%{?dist}
Summary: Python client for Ironic
License: ASL 2.0
URL: https://pypi.python.org/pypi/python-ironicclient
Source0: https://tarballs.openstack.org/python-ironicclient/python-ironicclient-%{version}%{?milestone}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python client for Ironic
BuildRequires: python2-devel
BuildRequires: python2-pbr >= 2.0.0
BuildRequires: python2-setuptools
Requires: python2-appdirs >= 1.3.0
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-pbr >= 2.0.0
Requires: python2-prettytable
Requires: python2-six >= 1.10.0
Requires: python2-osc-lib >= 1.10.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-requests
%if 0%{?fedora} > 0
Requires: python2-dogpile-cache >= 0.6.2
Requires: python2-jsonschema
Requires: python2-pyyaml
%else
Requires: python-dogpile-cache >= 0.6.2
Requires: python-jsonschema
Requires: PyYAML
%endif
%{?python_provide:%python_provide python2-%{sname}}
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python client for Ironic
BuildRequires: python3-devel
BuildRequires: python3-pbr >= 2.0.0
BuildRequires: python3-setuptools
Requires: python3-appdirs >= 1.3.0
Requires: python3-dogpile-cache >= 0.6.2
Requires: python3-jsonschema
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-pbr >= 2.0.0
Requires: python3-prettytable
Requires: python3-six >= 1.10.0
Requires: python3-osc-lib >= 1.10.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-requests
Requires: python3-PyYAML
%{?python_provide:%python_provide python3-%{sname}}
%description -n python3-%{sname}
%{common_desc}
%endif
%prep
%setup -q -n %{name}-%{upstream_version}
# Remove the requirements file so that pbr hooks don't add it
# to distutils requires_dist config
rm -rf {test-,}requirements.txt tools/{pip,test}-requires
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/ironic %{buildroot}%{_bindir}/ironic-%{python3_version}
ln -s ./ironic-%{python3_version} %{buildroot}%{_bindir}/ironic-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/ironic %{buildroot}%{_bindir}/ironic-%{python2_version}
ln -s ./ironic-%{python2_version} %{buildroot}%{_bindir}/ironic-2
ln -s ./ironic-2 %{buildroot}%{_bindir}/ironic
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{_bindir}/ironic
%{_bindir}/ironic-2
%{_bindir}/ironic-%{python2_version}
%{python2_sitelib}/ironicclient*
%{python2_sitelib}/python_ironicclient*
%if 0%{?with_python3}
%files -n python3-%{sname}
%doc README.rst
%license LICENSE
%{_bindir}/ironic-3
%{_bindir}/ironic-%{python3_version}
%{python3_sitelib}/ironicclient*
%{python3_sitelib}/python_ironicclient*
%endif
%changelog
* Fri Aug 10 2018 RDO <dev@lists.rdoproject.org> 2.5.0-1
- Update to 2.5.0

View File

@ -1 +1,4 @@
TIS_PATCH_VER=7
TAR_NAME=python-keystoneclient
SRC_DIR=$CGCS_BASE/git/python-keystoneclient
TIS_PATCH_VER=0

View File

@ -1,13 +0,0 @@
diff --git a/SPECS/python-keystoneclient.spec b/SPECS/python-keystoneclient.spec
index 79ab30f..e68bc6f 100644
--- a/SPECS/python-keystoneclient.spec
+++ b/SPECS/python-keystoneclient.spec
@@ -8,7 +8,7 @@
Name: python-keystoneclient
Epoch: 1
Version: 3.13.0
-Release: 1%{?dist}
+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver}
Summary: Client library for OpenStack Identity API
License: ASL 2.0
URL: https://launchpad.net/python-keystoneclient

View File

@ -1,16 +0,0 @@
diff --git a/SPECS/python-keystoneclient.spec b/SPECS/python-keystoneclient.spec
index e68bc6f..c71629d 100644
--- a/SPECS/python-keystoneclient.spec
+++ b/SPECS/python-keystoneclient.spec
@@ -14,6 +14,11 @@ License: ASL 2.0
URL: https://launchpad.net/python-keystoneclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
+# WRS
+Patch0001: internal-keystone-client-public-adminURL-detection.patch
+
+# BuildArch needs to be located below patches in the spec file
+
BuildArch: noarch
BuildRequires: /usr/bin/openssl

View File

@ -1,47 +0,0 @@
diff --git a/SPECS/python-keystoneclient.spec b/SPECS/python-keystoneclient.spec
index 2844d30..edd6720 100644
--- a/SPECS/python-keystoneclient.spec
+++ b/SPECS/python-keystoneclient.spec
@@ -167,6 +167,12 @@ BuildRequires: python-openstackdocstheme
%description doc
Documentation for the keystoneclient module
+%package sdk
+Summary: SDK files for %{name}
+
+%description sdk
+Contains SDK files for %{name} package
+
%prep
%autosetup -n %{name}-%{upstream_version} -S git
@@ -194,6 +200,10 @@ rm -rf {test-,}requirements.txt
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.{doctrees,buildinfo}
+# prep SDK package
+mkdir -p %{buildroot}/usr/share/remote-clients/%{name}
+tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
+
%check
%{__python2} setup.py test
@@ -202,6 +212,7 @@ rm -fr .testrepository
%{__python3} setup.py test
%endif
+
%files -n python2-keystoneclient
%license LICENSE
%doc README.rst
@@ -232,6 +243,10 @@ rm -fr .testrepository
%{python3_sitelib}/keystoneclient/tests
%endif
+%files sdk
+/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz
+
+
%changelog
* Fri Aug 11 2017 Alfredo Moralejo <amoralej@redhat.com> 1:3.13.0-1
- Update to 3.13.0

View File

@ -1,13 +0,0 @@
diff --git a/SPECS/python-keystoneclient.spec b/SPECS/python-keystoneclient.spec
index edd6720..a41311e 100644
--- a/SPECS/python-keystoneclient.spec
+++ b/SPECS/python-keystoneclient.spec
@@ -181,7 +181,7 @@ Contains SDK files for %{name} package
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg
# Let RPM handle the dependencies
-rm -rf {test-,}requirements.txt
+rm -f test-requirements.txt
%build
%py2_build

View File

@ -1,20 +0,0 @@
diff --git a/SPECS/python-keystoneclient.spec b/SPECS/python-keystoneclient.spec
index 965c437..efc0c4b 100644
--- a/SPECS/python-keystoneclient.spec
+++ b/SPECS/python-keystoneclient.spec
@@ -34,6 +34,7 @@ Summary: Client library for OpenStack Identity API
BuildRequires: python2-devel
BuildRequires: python-setuptools
+BuildRequires: python2-setuptools_scm
BuildRequires: python-pbr >= 2.0.0
BuildRequires: git
@@ -61,6 +62,7 @@ Summary: Client library for OpenStack Identity API
BuildRequires: python3-devel
BuildRequires: python3-setuptools
+BuildRequires: python3-setuptools_scm
BuildRequires: python3-pbr >= 2.0.0
Requires: python3-oslo-config >= 2:4.0.0

View File

@ -1,5 +0,0 @@
0001-Update-package-versioning-for-TIS-format.patch
0002-meta-public-adminURL-detection.patch
0003-meta-TiS-remote-client-sdk-patch.patch
0004-meta-dont-remove-requirements-txt.patch
0006-meta-buildrequires-python-setuptools_scm.patch

View File

@ -1,55 +0,0 @@
From e9d61bd41cfbe8cf424d13052c35f298f5beb1e2 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Tue, 24 Jan 2017 15:19:33 -0500
Subject: [PATCH] TiS-remote-client-sdk-patch
---
keystoneclient/v2_0/client.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py
index 904f769..003c5b1 100644
--- a/keystoneclient/v2_0/client.py
+++ b/keystoneclient/v2_0/client.py
@@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import os
import logging
import warnings
@@ -30,6 +31,9 @@ from keystoneclient.v2_0 import tenants
from keystoneclient.v2_0 import tokens
from keystoneclient.v2_0 import users
+import requests
+from requests.packages.urllib3.exceptions import InsecureRequestWarning
+from requests.packages.urllib3 import disable_warnings as urllib3_disable_warnings
_logger = logging.getLogger(__name__)
@@ -154,6 +158,20 @@ class Client(httpclient.HTTPClient):
'deprecated as of the 1.7.0 release and may be removed in '
'the 2.0.0 release.', DeprecationWarning)
+ # NOTE(knasim-wrs): As per US76645, the Keystone adminURL
+ # is no longer an internal address since it needs to be
+ # accessible via remote Openstack client. Things get
+ # complicated with HTTPS where the internal keystone client
+ # gets this adminURL and cannot connect to Keystone server
+ # as it cannot verify the SSL certificate.
+ # We will check for this condition here, if OS_ENDPOINT_TYPE
+ # is not publicURL then this is an internal access scenario and
+ # Keystone client will be set to SSL insecure mode
+ if os.environ.get('OS_ENDPOINT_TYPE') == 'internalURL':
+ kwargs['insecure'] = True
+ # disable verbose insecurity warnings
+ urllib3_disable_warnings(InsecureRequestWarning)
+
super(Client, self).__init__(**kwargs)
self.certificates = certificates.CertificatesManager(self._adapter)
--
1.8.3.1

View File

@ -0,0 +1,278 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
Client library and command line utility for interacting with Openstack \
Identity API.
Name: python-keystoneclient
Epoch: 1
Version: 3.17.0
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Client library for OpenStack Identity API
License: ASL 2.0
URL: https://launchpad.net/python-keystoneclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: /usr/bin/openssl
%description
%{common_desc}
%package -n python2-keystoneclient
Summary: Client library for OpenStack Identity API
%{?python_provide:%python_provide python2-keystoneclient}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python2-pbr >= 2.0.0
BuildRequires: git
Requires: python2-oslo-config >= 2:5.2.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-requests >= 2.14.2
Requires: python2-six >= 1.10.0
Requires: python2-stevedore >= 1.20.0
Requires: python2-pbr >= 2.0.0
Requires: python2-debtcollector >= 1.2.0
Requires: python2-keystoneauth1 >= 3.4.0
%if 0%{?fedora} > 0
Requires: python2-keyring >= 5.5.1
%else
Requires: python-keyring >= 5.5.1
%endif
%description -n python2-keystoneclient
%{common_desc}
%if 0%{?with_python3}
%package -n python3-keystoneclient
Summary: Client library for OpenStack Identity API
%{?python_provide:%python_provide python3-keystoneclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr >= 2.0.0
Requires: python3-oslo-config >= 2:5.2.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-requests >= 2.14.2
Requires: python3-six >= 1.10.0
Requires: python3-stevedore >= 1.20.0
Requires: python3-pbr >= 2.0.0
Requires: python3-debtcollector >= 1.2.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-keyring >= 5.5.1
%description -n python3-keystoneclient
Client library for interacting with Openstack Identity API.
%endif
%package -n python2-keystoneclient-tests
Summary: python2-keystoneclient test subpackage
Requires: python2-keystoneclient = %{epoch}:%{version}-%{release}
BuildRequires: python2-hacking
BuildRequires: python2-fixtures
BuildRequires: python2-mock
BuildRequires: python2-oauthlib
BuildRequires: python2-oslotest
BuildRequires: python2-testtools
BuildRequires: python2-keystoneauth1
BuildRequires: python2-oslo-config
BuildRequires: python2-oslo-utils
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-i18n
BuildRequires: python2-stestr
BuildRequires: python2-testresources
BuildRequires: python2-testscenarios
%if 0%{?fedora} > 0
BuildRequires: python2-keyring >= 5.5.1
BuildRequires: python2-lxml
BuildRequires: python2-requests-mock
%else
BuildRequires: python-keyring >= 5.5.1
BuildRequires: python-lxml
BuildRequires: python-requests-mock
%endif
Requires: python2-hacking
Requires: python2-fixtures
Requires: python2-mock
Requires: python2-oauthlib
Requires: python2-oslotest
Requires: python2-stestr
Requires: python2-testtools
Requires: python2-testresources
Requires: python2-testscenarios
%if 0%{?fedora} > 0
Requires: python2-lxml
Requires: python2-requests-mock
%else
Requires: python-lxml
Requires: python-requests-mock
%endif
%description -n python2-keystoneclient-tests
python2-keystoneclient test subpackages
%if 0%{?with_python3}
%package -n python3-keystoneclient-tests
Summary: python3-keystoneclient test subpackage
Requires: python3-keystoneclient = %{epoch}:%{version}-%{release}
BuildRequires: python3-hacking
BuildRequires: python3-fixtures
BuildRequires: python3-keyring >= 5.5.1
BuildRequires: python3-lxml
BuildRequires: python3-mock
BuildRequires: python3-oauthlib
BuildRequires: python3-oslotest
BuildRequires: python3-requests-mock
BuildRequires: python3-testresources
BuildRequires: python3-testscenarios
BuildRequires: python3-testtools
BuildRequires: python3-keystoneauth1
BuildRequires: python3-oslo-config
BuildRequires: python3-oslo-utils
BuildRequires: python3-oslo-serialization
BuildRequires: python3-oslo-i18n
BuildRequires: python3-stestr
Requires: python3-hacking
Requires: python3-fixtures
Requires: python3-lxml
Requires: python3-mock
Requires: python3-oauthlib
Requires: python3-oslotest
Requires: python3-requests-mock
Requires: python3-stestr
Requires: python3-testresources
Requires: python3-testscenarios
Requires: python3-testtools
%description -n python3-keystoneclient-tests
python3-keystoneclient test subpackages
%endif
%package doc
Summary: Documentation for OpenStack Keystone API client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
%description doc
Documentation for the keystoneclient module
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# disable warning-is-error, this project has intersphinx in docs
# so some warnings are generated in network isolated build environment
# as koji
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg
# Let RPM handle the dependencies
rm -rf {test-,}requirements.txt
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
%install
export PBR_VERSION=%{version}
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
# Build HTML docs
%{__python2} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.{doctrees,buildinfo}
# STX: stage wheels
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# STX: prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%check
stestr --test-path=./keystoneclient/tests/unit run
%if 0%{?with_python3}
stestr-3 --test-path=./keystoneclient/tests/unit run
%endif
%files -n python2-keystoneclient
%license LICENSE
%doc README.rst
%{python2_sitelib}/keystoneclient
%{python2_sitelib}/*.egg-info
%exclude %{python2_sitelib}/keystoneclient/tests
%if 0%{?with_python3}
%files -n python3-keystoneclient
%license LICENSE
%doc README.rst
%{python3_sitelib}/keystoneclient
%{python3_sitelib}/*.egg-info
%exclude %{python3_sitelib}/keystoneclient/tests
%endif
%files doc
%doc doc/build/html
%license LICENSE
%files -n python2-keystoneclient-tests
%license LICENSE
%{python2_sitelib}/keystoneclient/tests
%if 0%{?with_python3}
%files -n python3-keystoneclient-tests
%license LICENSE
%{python3_sitelib}/keystoneclient/tests
%endif
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Wed Aug 08 2018 RDO <dev@lists.rdoproject.org> 1:3.17.0-1
- Update to 3.17.0

View File

@ -0,0 +1,247 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
Client library and command line utility for interacting with Openstack \
Identity API.
Name: python-keystoneclient
Epoch: 1
Version: 3.17.0
Release: 1%{?dist}
Summary: Client library for OpenStack Identity API
License: ASL 2.0
URL: https://launchpad.net/python-keystoneclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: /usr/bin/openssl
%description
%{common_desc}
%package -n python2-keystoneclient
Summary: Client library for OpenStack Identity API
%{?python_provide:%python_provide python2-keystoneclient}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr >= 2.0.0
BuildRequires: git
Requires: python2-oslo-config >= 2:5.2.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-requests >= 2.14.2
Requires: python2-six >= 1.10.0
Requires: python2-stevedore >= 1.20.0
Requires: python2-pbr >= 2.0.0
Requires: python2-debtcollector >= 1.2.0
Requires: python2-keystoneauth1 >= 3.4.0
%if 0%{?fedora} > 0
Requires: python2-keyring >= 5.5.1
%else
Requires: python-keyring >= 5.5.1
%endif
%description -n python2-keystoneclient
%{common_desc}
%if 0%{?with_python3}
%package -n python3-keystoneclient
Summary: Client library for OpenStack Identity API
%{?python_provide:%python_provide python3-keystoneclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr >= 2.0.0
Requires: python3-oslo-config >= 2:5.2.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-requests >= 2.14.2
Requires: python3-six >= 1.10.0
Requires: python3-stevedore >= 1.20.0
Requires: python3-pbr >= 2.0.0
Requires: python3-debtcollector >= 1.2.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-keyring >= 5.5.1
%description -n python3-keystoneclient
Client library for interacting with Openstack Identity API.
%endif
%package -n python2-keystoneclient-tests
Summary: python2-keystoneclient test subpackage
Requires: python2-keystoneclient = %{epoch}:%{version}-%{release}
BuildRequires: python2-hacking
BuildRequires: python2-fixtures
BuildRequires: python2-mock
BuildRequires: python2-oauthlib
BuildRequires: python2-oslotest
BuildRequires: python2-testtools
BuildRequires: python2-keystoneauth1
BuildRequires: python2-oslo-config
BuildRequires: python2-oslo-utils
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-i18n
BuildRequires: python2-stestr
BuildRequires: python2-testresources
BuildRequires: python2-testscenarios
%if 0%{?fedora} > 0
BuildRequires: python2-keyring >= 5.5.1
BuildRequires: python2-lxml
BuildRequires: python2-requests-mock
%else
BuildRequires: python-keyring >= 5.5.1
BuildRequires: python-lxml
BuildRequires: python-requests-mock
%endif
Requires: python2-hacking
Requires: python2-fixtures
Requires: python2-mock
Requires: python2-oauthlib
Requires: python2-oslotest
Requires: python2-stestr
Requires: python2-testtools
Requires: python2-testresources
Requires: python2-testscenarios
%if 0%{?fedora} > 0
Requires: python2-lxml
Requires: python2-requests-mock
%else
Requires: python-lxml
Requires: python-requests-mock
%endif
%description -n python2-keystoneclient-tests
python2-keystoneclient test subpackages
%if 0%{?with_python3}
%package -n python3-keystoneclient-tests
Summary: python3-keystoneclient test subpackage
Requires: python3-keystoneclient = %{epoch}:%{version}-%{release}
BuildRequires: python3-hacking
BuildRequires: python3-fixtures
BuildRequires: python3-keyring >= 5.5.1
BuildRequires: python3-lxml
BuildRequires: python3-mock
BuildRequires: python3-oauthlib
BuildRequires: python3-oslotest
BuildRequires: python3-requests-mock
BuildRequires: python3-testresources
BuildRequires: python3-testscenarios
BuildRequires: python3-testtools
BuildRequires: python3-keystoneauth1
BuildRequires: python3-oslo-config
BuildRequires: python3-oslo-utils
BuildRequires: python3-oslo-serialization
BuildRequires: python3-oslo-i18n
BuildRequires: python3-stestr
Requires: python3-hacking
Requires: python3-fixtures
Requires: python3-lxml
Requires: python3-mock
Requires: python3-oauthlib
Requires: python3-oslotest
Requires: python3-requests-mock
Requires: python3-stestr
Requires: python3-testresources
Requires: python3-testscenarios
Requires: python3-testtools
%description -n python3-keystoneclient-tests
python3-keystoneclient test subpackages
%endif
%package doc
Summary: Documentation for OpenStack Keystone API client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
%description doc
Documentation for the keystoneclient module
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# disable warning-is-error, this project has intersphinx in docs
# so some warnings are generated in network isolated build environment
# as koji
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg
# Let RPM handle the dependencies
rm -rf {test-,}requirements.txt
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
# Build HTML docs
%{__python2} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.{doctrees,buildinfo}
%check
stestr --test-path=./keystoneclient/tests/unit run
%if 0%{?with_python3}
stestr-3 --test-path=./keystoneclient/tests/unit run
%endif
%files -n python2-keystoneclient
%license LICENSE
%doc README.rst
%{python2_sitelib}/keystoneclient
%{python2_sitelib}/*.egg-info
%exclude %{python2_sitelib}/keystoneclient/tests
%if 0%{?with_python3}
%files -n python3-keystoneclient
%license LICENSE
%doc README.rst
%{python3_sitelib}/keystoneclient
%{python3_sitelib}/*.egg-info
%exclude %{python3_sitelib}/keystoneclient/tests
%endif
%files doc
%doc doc/build/html
%license LICENSE
%files -n python2-keystoneclient-tests
%license LICENSE
%{python2_sitelib}/keystoneclient/tests
%if 0%{?with_python3}
%files -n python3-keystoneclient-tests
%license LICENSE
%{python3_sitelib}/keystoneclient/tests
%endif
%changelog
* Wed Aug 08 2018 RDO <dev@lists.rdoproject.org> 1:3.17.0-1
- Update to 3.17.0

View File

@ -1 +0,0 @@
mirror:Source/python-keystoneclient-3.13.0-1.el7.src.rpm

View File

@ -1,144 +0,0 @@
Index: git/keystoneclient/shell.py
===================================================================
--- git.orig/keystoneclient/shell.py 2014-09-17 13:06:07.761186569 -0400
+++ git/keystoneclient/shell.py 2014-09-22 15:10:36.326737219 -0400
@@ -24,6 +24,7 @@
from __future__ import print_function
+import os
import argparse
import getpass
import logging
@@ -32,6 +33,8 @@
import six
+import keyring
+
import keystoneclient
from keystoneclient import access
from keystoneclient.contrib.bootstrap import shell as shell_bootstrap
@@ -333,6 +336,11 @@
'--os-username or env[OS_USERNAME]')
if not args.os_password:
+ # priviledge check (only allow Keyring retrieval if we are root)
+ if os.geteuid() == 0:
+ args.os_password = keyring.get_password('CGCS', args.os_username)
+
+ if not args.os_password:
# No password, If we've got a tty, try prompting for it
if hasattr(sys.stdin, 'isatty') and sys.stdin.isatty():
# Check for Ctl-D
Index: git/keystoneclient/probe.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ git/keystoneclient/probe.py 2014-09-23 10:41:57.758412311 -0400
@@ -0,0 +1,106 @@
+#
+# Copyright (c) 2014 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
+
+"""
+OCF sanity probe to prevent cleartext password
+"""
+
+import os
+import sys
+import json
+import urllib2
+import datetime
+import keyring
+import logging
+import logging.handlers
+
+_loggers = {}
+
+def get_logger(name):
+ """ Get a logger or create one """
+ if name not in _loggers:
+ _loggers[name] = logging.getLogger(name)
+
+ return _loggers[name]
+
+
+def setup_logger(logger):
+ """ Setup a logger """
+ syslog_facility = logging.handlers.SysLogHandler.LOG_SYSLOG
+
+ formatter = logging.Formatter("probe_keyring[%(process)d] " +
+ "%(pathname)s:%(lineno)s " +
+ "%(levelname)8s [%(name)s] %(message)s")
+
+ handler = logging.handlers.SysLogHandler(address='/dev/log',
+ facility=syslog_facility)
+ handler.setLevel(logging.INFO)
+ handler.setFormatter(formatter)
+
+ logger.addHandler(handler)
+ logger.setLevel(logging.INFO)
+
+def configure():
+ """ Setup logging """
+ for logger in _loggers:
+ setup_logger(_loggers[logger])
+
+LOG = get_logger(__name__)
+
+def probe(auth_url, tenant, login):
+ """ Asks OpenStack Keystone for a token """
+
+ try:
+ url = auth_url + "tokens"
+ request_info = urllib2.Request(url)
+ request_info.add_header("Content-type", "application/json")
+ request_info.add_header("Accept", "application/json")
+ payload = json.dumps(
+ {"auth": {"tenantName": tenant,
+ "passwordCredentials": {"username": login,
+ "password": keyring.get_password('CGCS',login)}}})
+ request_info.add_data(payload)
+
+ request = urllib2.urlopen(request_info)
+ response = json.loads(request.read())
+ request.close()
+ return response['access']['token']['id']
+
+ except Exception as e:
+ LOG.error("%s, %s" % (e.code, e.read()))
+ return None
+
+def main():
+
+ global cmd_auth_url
+ global cmd_tenant
+ global cmd_os_username
+
+ cmd_auth_url = "http://127.0.0.1:5000/v2.0/tokens"
+ cmd_tenant = "tenant"
+ cmd_os_username = "username"
+
+ configure()
+
+# priviledge check (only allow Keyring retrieval if we are root)
+ if os.geteuid() == 0:
+ arg = 1
+ cmd_auth_url = sys.argv[arg]
+ arg += 1
+ cmd_tenant = sys.argv[arg]
+ arg += 1
+ cmd_os_username = sys.argv[arg]
+
+ try:
+ token_id = probe(cmd_auth_url, cmd_tenant, cmd_os_username)
+ if token_id is None:
+ sys.exit(-1)
+ sys.exit(0)
+ except Exception as e:
+ sys.exit(-1)
+

View File

@ -1,16 +0,0 @@
Index: python-keystoneclient-1.3.1/keystoneclient/auth/identity/base.py
===================================================================
--- python-keystoneclient-1.3.1.orig/keystoneclient/auth/identity/base.py
+++ python-keystoneclient-1.3.1/keystoneclient/auth/identity/base.py
@@ -34,8 +34,9 @@ def get_options():
@six.add_metaclass(abc.ABCMeta)
class BaseIdentityPlugin(base.BaseAuthPlugin):
- # we count a token as valid if it is valid for at least this many seconds
- MIN_TOKEN_LIFE_SECONDS = 1
+ # we count a token as valid (not needing refreshing) if it is valid for at
+ # least this many seconds before the token expiry time
+ MIN_TOKEN_LIFE_SECONDS = 120
def __init__(self,
auth_url=None,

View File

@ -1,45 +0,0 @@
---
keystoneclient/v2_0/client.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/keystoneclient/v2_0/client.py
+++ b/keystoneclient/v2_0/client.py
@@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import os
import logging
from keystoneclient.auth.identity import v2 as v2_auth
@@ -29,6 +30,8 @@ from keystoneclient.v2_0 import tenants
from keystoneclient.v2_0 import tokens
from keystoneclient.v2_0 import users
+import requests
+from requests.packages.urllib3.exceptions import InsecureRequestWarning
_logger = logging.getLogger(__name__)
@@ -130,6 +133,21 @@ class Client(httpclient.HTTPClient):
def __init__(self, **kwargs):
"""Initialize a new client for the Keystone v2.0 API."""
+
+ # NOTE(knasim-wrs): As per US76645, the Keystone adminURL
+ # is no longer an internal address since it needs to be
+ # accessible via remote Openstack client. Things get
+ # complicated with HTTPS where the internal keystone client
+ # gets this adminURL and cannot connect to Keystone server
+ # as it cannot verify the SSL certificate.
+ # We will check for this condition here, if OS_ENDPOINT_TYPE
+ # is not publicURL then this is an internal access scenario and
+ # Keystone client will be set to SSL insecure mode
+ if os.environ.get('OS_ENDPOINT_TYPE') == 'internalURL':
+ kwargs['insecure'] = True
+ # disable verbose insecurity warnings
+ requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
+
super(Client, self).__init__(**kwargs)
self.certificates = certificates.CertificatesManager(self._adapter)

View File

@ -1,26 +0,0 @@
---
keystoneclient/v2_0/shell.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/keystoneclient/v2_0/shell.py
+++ b/keystoneclient/v2_0/shell.py
@@ -141,7 +141,8 @@ def do_user_password_update(kc, args):
"""Update user password."""
user = utils.find_resource(kc.users, args.user)
new_passwd = args.passwd or utils.prompt_for_password()
- if new_passwd is None:
+ # if password is empty or blank then reject it
+ if new_passwd is None or new_passwd.strip() is "":
msg = (_("\nPlease specify password using the --pass option "
"or using the prompt"))
sys.exit(msg)
@@ -167,7 +168,8 @@ def do_password_update(kc, args):
currentpasswd = getpass.getpass(_('Current Password: '))
newpasswd = args.newpasswd
- while newpasswd is None:
+ # don't allow empty or blank passwords
+ while newpasswd is None or newpasswd.strip() is "":
passwd1 = getpass.getpass(_('New Password: '))
passwd2 = getpass.getpass(_('Repeat New Password: '))
if passwd1 == passwd2:

View File

@ -1,6 +1,4 @@
TAR_NAME="python-magnumclient"
SRC_DIR="$CGCS_BASE/git/python-magnumclient"
TIS_BASE_SRCREV=6bef59aec50e41ec2133fad1bd1fc4c954a08312
TIS_PATCH_VER=1
TIS_PATCH_VER=0

View File

@ -9,8 +9,15 @@
%global default_python 2
%endif
%global common_desc \
This is a client library for Magnum built on the Magnum API. \
It provides a Python API (the magnumclient module) and a \
command-line tool (magnum).
%global common_desc_tests Python-magnumclient test subpackage
Name: python-%{pname}
Version: 2.7.0
Version: 2.10.0
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Client library for Magnum API
@ -20,49 +27,54 @@ Source0: https://tarballs.openstack.org/%{sname}/%{sname}-%{upstream_vers
BuildArch: noarch
%description
This is a client library for Magnum built on the Magnum API.
It provides a Python API (the magnumclient module) and a
command-line tool (magnum).
%{common_desc}
%package -n python2-%{pname}
Summary: Client library for Magnum API
%{?python_provide:%python_provide python2-%{pname}}
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-pbr
BuildRequires: python2-pbr
BuildRequires: git
# test dependencies
BuildRequires: python-oslo-utils
BuildRequires: python-stevedore
BuildRequires: python-requests
BuildRequires: python-oslo-i18n
BuildRequires: python-fixtures
BuildRequires: python-mock
BuildRequires: python-testtools
BuildRequires: python-keystoneauth1
BuildRequires: python-prettytable
BuildRequires: python2-oslo-utils
BuildRequires: python2-openstackclient
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-log
BuildRequires: python2-osprofiler
BuildRequires: python2-stevedore
BuildRequires: python2-requests
BuildRequires: python2-oslo-i18n
BuildRequires: python2-fixtures
BuildRequires: python2-mock
BuildRequires: python2-testtools
BuildRequires: python2-keystoneauth1
BuildRequires: python2-prettytable
Requires: python-babel
Requires: python-cryptography
Requires: python2-babel
Requires: python2-cryptography
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-log >= 3.36.0
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-osc-lib >= 1.8.0
Requires: python2-os-client-config >= 1.28.0
Requires: python2-pbr
Requires: python2-prettytable
Requires: python2-six
%if 0%{?fedora} > 0
Requires: python2-decorator
%else
Requires: python-decorator
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-serialization >= 1.10.0
Requires: python-oslo-utils >= 3.20.0
Requires: python-osc-lib >= 1.7.0
Requires: python-os-client-config >= 1.28.0
Requires: python-pbr
Requires: python-prettytable
Requires: python-six
%endif
%description -n python2-%{pname}
This is a client library for Magnum built on the Magnum API.
It provides a Python API (the magnumclient module) and a
command-line tool (magnum).
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{pname}
@ -75,6 +87,10 @@ BuildRequires: python3-pbr
# test dependencies
BuildRequires: python3-oslo-utils
BuildRequires: python3-openstackclient
BuildRequires: python3-oslo-serialization
BuildRequires: python3-oslo-log
BuildRequires: python3-osprofiler
BuildRequires: python3-stevedore
BuildRequires: python3-requests
BuildRequires: python3-oslo-i18n
@ -87,48 +103,53 @@ BuildRequires: python3-prettytable
Requires: python3-babel
Requires: python3-cryptography
Requires: python3-decorator
Requires: python3-keystoneauth1 >= 3.1.0
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-serialization >= 1.10.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-osc-lib >= 1.7.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-osc-lib >= 1.8.0
Requires: python3-os-client-config >= 1.28.0
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-six
%description -n python3-%{pname}
This is a client library for Magnum built on the Magnum API.
It provides a Python API (the magnumclient module) and a
command-line tool (magnum).
%{common_desc}
%endif
%package -n python-%{pname}-doc
Summary: python-magnumclient documentation
BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-os-client-config
#BuildRequires: python-decorator
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-os-client-config
BuildRequires: openstack-macros
%if 0%{?fedora} > 0
BuildRequires: python2-decorator
%else
BuildRequires: python-decorator
%endif
%description -n python-%{pname}-doc
Documentation for python-magnumclient
%package -n python-%{pname}-tests
%package -n python2-%{pname}-tests
Summary: Python-magnumclient test subpackage
%{?python_provide:%python_provide python2-%{pname}-tests}
Requires: python-%{pname} = %{version}-%{release}
Requires: python-oslo-utils
Requires: python-stevedore
Requires: python-requests
Requires: python-oslo-i18n
Requires: python-fixtures
Requires: python-mock
Requires: python-testtools
Requires: python-keystoneauth1
Requires: python-prettytable
Requires: python2-%{pname} = %{version}-%{release}
Requires: python2-oslo-utils
Requires: python2-stevedore
Requires: python2-requests
Requires: python2-oslo-i18n
Requires: python2-fixtures
Requires: python2-mock
Requires: python2-testtools
Requires: python2-keystoneauth1
Requires: python2-prettytable
%description -n python-%{pname}-tests
Python-magnumclient test subpackage
%description -n python2-%{pname}-tests
%{common_desc_tests}
%if 0%{?with_python3}
%package -n python3-%{pname}-tests
@ -146,34 +167,32 @@ Requires: python3-keystoneauth1
Requires: python3-prettytable
%description -n python3-%{pname}-tests
Python-magnumclient test subpackage
%{common_desc_tests}
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# let RPM handle deps
rm -rf {test-,}requirements.txt
%py_req_cleanup
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
# generate html docs
%{__python2} setup.py build_sphinx -b html
# (TODO) Re-add -W once https://review.openstack.org/#/c/554197 is in a
# tagged release
sphinx-build -b html doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -rf doc/build/html/.{doctrees,buildinfo}
%py2_build_wheel
%install
export PBR_VERSION=%{version}
install -p -D -m 644 tools/magnum.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/magnum.bash_completion
%if 0%{?with_python3}
%py3_install
%if %{default_python} >= 3
@ -182,20 +201,21 @@ mv %{buildroot}%{_bindir}/magnum ./magnum.py3
%endif
%py2_install
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%if 0%{?default_python} >= 3
mv magnum.py3 %{buildroot}%{_bindir}/magnum
%endif
#%check
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%check
# tests are failing due to unicode not defined
# we are skipping the test
#%{__python2} setup.py test ||
#%if 0%{?with_python3}
#%{__python3} setup.py test ||
#%endif
%{__python2} setup.py test ||
%if 0%{?with_python3}
%{__python3} setup.py test ||
%endif
%files -n python2-%{pname}
%doc README.rst
@ -206,7 +226,6 @@ mv magnum.py3 %{buildroot}%{_bindir}/magnum
%endif
%{python2_sitelib}/*.egg-info
%exclude %{python2_sitelib}/%{pname}/tests
%{_sysconfdir}/bash_completion.d/magnum.bash_completion
%if 0%{?with_python3}
%files -n python3-%{pname}
@ -224,7 +243,7 @@ mv magnum.py3 %{buildroot}%{_bindir}/magnum
%license LICENSE
%doc doc/build/html
%files -n python-%{pname}-tests
%files -n python2-%{pname}-tests
%{python2_sitelib}/%{pname}/tests
%if 0%{?with_python3}
@ -242,6 +261,6 @@ Contains python wheels for %{name}
/wheels/*
%changelog
* Fri Aug 11 2017 Alfredo Moralejo <amoralej@redhat.com> 2.7.0-1
- Update to 2.7.0
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 2.10.0-1
- Update to 2.10.0

View File

@ -0,0 +1,250 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname python-magnumclient
%global pname magnumclient
%if 0%{?fedora} >= 24
%global with_python3 1
%global default_python 3
%else
%global default_python 2
%endif
%global common_desc \
This is a client library for Magnum built on the Magnum API. \
It provides a Python API (the magnumclient module) and a \
command-line tool (magnum).
%global common_desc_tests Python-magnumclient test subpackage
Name: python-%{pname}
Version: 2.10.0
Release: 1%{?dist}
Summary: Client library for Magnum API
License: ASL 2.0
URL: https://launchpad.net/python-magnumclient
Source0: https://tarballs.openstack.org/%{sname}/%{sname}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{pname}
Summary: Client library for Magnum API
%{?python_provide:%python_provide python2-%{pname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
BuildRequires: git
# test dependencies
BuildRequires: python2-oslo-utils
BuildRequires: python2-openstackclient
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-log
BuildRequires: python2-osprofiler
BuildRequires: python2-stevedore
BuildRequires: python2-requests
BuildRequires: python2-oslo-i18n
BuildRequires: python2-fixtures
BuildRequires: python2-mock
BuildRequires: python2-testtools
BuildRequires: python2-keystoneauth1
BuildRequires: python2-prettytable
Requires: python2-babel
Requires: python2-cryptography
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-log >= 3.36.0
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-osc-lib >= 1.8.0
Requires: python2-os-client-config >= 1.28.0
Requires: python2-pbr
Requires: python2-prettytable
Requires: python2-six
%if 0%{?fedora} > 0
Requires: python2-decorator
%else
Requires: python-decorator
%endif
%description -n python2-%{pname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{pname}
Summary: Client library for Magnum API
%{?python_provide:%python_provide python3-%{pname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
# test dependencies
BuildRequires: python3-oslo-utils
BuildRequires: python3-openstackclient
BuildRequires: python3-oslo-serialization
BuildRequires: python3-oslo-log
BuildRequires: python3-osprofiler
BuildRequires: python3-stevedore
BuildRequires: python3-requests
BuildRequires: python3-oslo-i18n
BuildRequires: python3-fixtures
BuildRequires: python3-mock
BuildRequires: python3-testtools
BuildRequires: python3-keystoneauth1
BuildRequires: python3-prettytable
Requires: python3-babel
Requires: python3-cryptography
Requires: python3-decorator
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-osc-lib >= 1.8.0
Requires: python3-os-client-config >= 1.28.0
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-six
%description -n python3-%{pname}
%{common_desc}
%endif
%package -n python-%{pname}-doc
Summary: python-magnumclient documentation
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-os-client-config
BuildRequires: openstack-macros
%if 0%{?fedora} > 0
BuildRequires: python2-decorator
%else
BuildRequires: python-decorator
%endif
%description -n python-%{pname}-doc
Documentation for python-magnumclient
%package -n python2-%{pname}-tests
Summary: Python-magnumclient test subpackage
%{?python_provide:%python_provide python2-%{pname}-tests}
Requires: python2-%{pname} = %{version}-%{release}
Requires: python2-oslo-utils
Requires: python2-stevedore
Requires: python2-requests
Requires: python2-oslo-i18n
Requires: python2-fixtures
Requires: python2-mock
Requires: python2-testtools
Requires: python2-keystoneauth1
Requires: python2-prettytable
%description -n python2-%{pname}-tests
%{common_desc_tests}
%if 0%{?with_python3}
%package -n python3-%{pname}-tests
Summary: Python-magnumclient test subpackage
Requires: python3-%{pname} = %{version}-%{release}
Requires: python3-oslo-utils
Requires: python3-stevedore
Requires: python3-requests
Requires: python3-oslo-i18n
Requires: python3-fixtures
Requires: python3-mock
Requires: python3-testtools
Requires: python3-keystoneauth1
Requires: python3-prettytable
%description -n python3-%{pname}-tests
%{common_desc_tests}
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# let RPM handle deps
%py_req_cleanup
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# generate html docs
# (TODO) Re-add -W once https://review.openstack.org/#/c/554197 is in a
# tagged release
sphinx-build -b html doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -rf doc/build/html/.{doctrees,buildinfo}
%install
%if 0%{?with_python3}
%py3_install
%if %{default_python} >= 3
mv %{buildroot}%{_bindir}/magnum ./magnum.py3
%endif
%endif
%py2_install
%if 0%{?default_python} >= 3
mv magnum.py3 %{buildroot}%{_bindir}/magnum
%endif
%check
# tests are failing due to unicode not defined
# we are skipping the test
%{__python2} setup.py test ||
%if 0%{?with_python3}
%{__python3} setup.py test ||
%endif
%files -n python2-%{pname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pname}
%if 0%{?default_python} <= 2
%{_bindir}/magnum
%endif
%{python2_sitelib}/*.egg-info
%exclude %{python2_sitelib}/%{pname}/tests
%if 0%{?with_python3}
%files -n python3-%{pname}
%doc README.rst
%license LICENSE
%if 0%{?default_python} >= 3
%{_bindir}/magnum
%endif
%{python3_sitelib}/magnumclient
%{python3_sitelib}/*.egg-info
%exclude %{python3_sitelib}/%{pname}/tests
%endif
%files -n python-%{pname}-doc
%license LICENSE
%doc doc/build/html
%files -n python2-%{pname}-tests
%{python2_sitelib}/%{pname}/tests
%if 0%{?with_python3}
%files -n python3-%{pname}-tests
%{python3_sitelib}/%{pname}/tests
%endif
%changelog
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 2.10.0-1
- Update to 2.10.0

View File

@ -1,5 +1,3 @@
TAR_NAME="python-muranoclient"
SRC_DIR="$CGCS_BASE/git/python-muranoclient"
TIS_BASE_SRCREV=9a31e6bd406b18b32a97bd11d0020426dd6ff318
TIS_PATCH_VER=2
TIS_PATCH_VER=0

View File

@ -7,8 +7,12 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global common_desc \
Client library for Murano built on the Murano API. It provides a Python \
API (the muranoclient module) and a command-line tool (murano).
Name: python-%{pypi_name}
Version: 0.14.0
Version: 1.1.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Client library for OpenStack Murano API
@ -18,45 +22,46 @@ Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
%description
Client library for Murano built on the Murano API. It provides a Python
API (the muranoclient module) and a command-line tool (murano).
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python2-%{pypi_name}
BuildRequires: git
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-setuptools
BuildRequires: python2-wheel
BuildRequires: python-pbr >= 2.0.0
BuildRequires: python2-pbr >= 2.0.0
Requires: python-babel >= 2.3.4
Requires: python-glanceclient >= 1:2.8.0
Requires: python-httplib2 >= 0.7.5
Requires: python-iso8601 >= 0.1.11
Requires: python-keystoneclient >= 1:3.8.0
Requires: python-murano-pkg-check >= 0.3.0
Requires: python-pbr >= 2.0.0
Requires: python-prettytable >= 0.7
Requires: python-requests >= 2.10.0
Requires: python-six >= 1.9.0
Requires: python-yaql >= 1.1.0
Requires: python-osc-lib >= 1.7.0
Requires: python-oslo-log >= 3.22.0
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-serialization >= 1.10.0
Requires: python-oslo-utils >= 3.20.0
Requires: pyOpenSSL >= 0.14
Requires: python2-babel >= 2.3.4
Requires: python2-glanceclient >= 1:2.8.0
Requires: python2-iso8601 >= 0.1.11
Requires: python2-keystoneclient >= 1:3.8.0
Requires: python2-murano-pkg-check >= 0.3.0
Requires: python2-pbr >= 2.0.0
Requires: python2-prettytable >= 0.7.2
Requires: python2-requests >= 2.14.2
Requires: python2-six >= 1.10.0
Requires: python2-yaql >= 1.1.3
Requires: python2-osc-lib >= 1.10.0
Requires: python2-oslo-log >= 3.36.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pyOpenSSL >= 16.2.0
%if 0%{?fedora} > 0
Requires: python2-pyyaml >= 3.10
%else
Requires: PyYAML >= 3.10
%endif
Summary: Client library for OpenStack Murano API.
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
Client library for Murano built on the Murano API. It provides a Python
API (the muranoclient module) and a command-line tool (murano).
%{common_desc}
# Python3 package
%if 0%{?with_python3}
@ -71,52 +76,44 @@ BuildRequires: python-tools
Requires: python3-babel >= 2.3.4
Requires: python3-glanceclient >= 1:2.8.0
Requires: python3-httplib2 >= 0.7.5
Requires: python3-iso8601 >= 0.1.11
Requires: python3-keystoneclient >= 1:3.8.0
Requires: python3-murano-pkg-check >= 0.3.0
Requires: python3-pbr >= 2.0.0
Requires: python3-prettytable >= 0.7
Requires: python3-requests >= 2.10.0
Requires: python3-six >= 1.9.0
Requires: python3-yaql >= 1.1.0
Requires: python3-osc-lib >= 1.7.0
Requires: python3-oslo-log >= 3.22.0
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-serialization >= 1.10.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-oslo-utils >= 3.18.0
Requires: python3-pyOpenSSL >= 0.14
Requires: python3-prettytable >= 0.7.2
Requires: python3-requests >= 2.14.2
Requires: python3-six >= 1.10.0
Requires: python3-yaql >= 1.1.3
Requires: python3-osc-lib >= 1.10.0
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pyOpenSSL >= 16.2.0
Requires: python3-PyYAML >= 3.10
%description -n python3-%{pypi_name}
Client library for Murano built on the Murano API. It provides a Python
API (the muranoclient module) and a command-line tool (murano).
%{common_desc}
%endif
# Documentation package
%package -n python-%{pypi_name}-doc
Summary: Documentation for OpenStack Murano API Client
BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
%description -n python-%{pypi_name}-doc
Documentation for the client library for interacting with Openstack
Murano API.
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# Let RPM handle the dependencies
rm -f test-requirements.txt requirements.txt
%py_req_cleanup
%if 0%{?with_python3}
rm -rf %{py3dir}
@ -127,6 +124,7 @@ cp -a . %{py3dir}
%build
export PBR_VERSION=%{version}
%{__python2} setup.py build
%py2_build_wheel
%if 0%{?with_python3}
pushd %{py3dir}
@ -135,12 +133,11 @@ popd
%endif
# generate html docs
%{__python2} setup.py build_sphinx -b html
export PYTHONPATH=.
sphinx-build -W -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%py2_build_wheel
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
@ -151,10 +148,6 @@ popd
%endif
%{__python2} setup.py install --skip-build --root %{buildroot}
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
install -p -D -m 644 tools/murano.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/murano.bash_completion
# rename binaries, make compat symlinks
pushd %{buildroot}%{_bindir}
@ -165,17 +158,20 @@ done
%endif
popd
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%files -n python2-%{pypi_name}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/python_%{pypi_name}-*-py?.?.egg-info
%{_bindir}/murano*
%{_sysconfdir}/bash_completion.d/murano.bash_completion
# Files for python3
%if 0%{?with_python3}
@ -192,6 +188,12 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='
%doc doc/build/html
%license LICENSE
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
@ -204,7 +206,9 @@ Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Mon Aug 14 2017 Alfredo Moralejo <amoralej@redhat.com> 0.14.0-1
- Update to 0.14.0
%changelog
* Thu Aug 16 2018 RDO <dev@lists.rdoproject.org> 1.1.1-1
- Update to 1.1.1

View File

@ -0,0 +1,182 @@
%global pypi_name muranoclient
%if 0%{?fedora}
%global with_python3 0
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
%endif
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global common_desc \
Client library for Murano built on the Murano API. It provides a Python \
API (the muranoclient module) and a command-line tool (murano).
Name: python-%{pypi_name}
Version: 1.1.1
Release: 1%{?dist}
Summary: Client library for OpenStack Murano API
License: ASL 2.0
URL: http://pypi.python.org/pypi/%{name}
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python2-%{pypi_name}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr >= 2.0.0
Requires: python2-babel >= 2.3.4
Requires: python2-glanceclient >= 1:2.8.0
Requires: python2-iso8601 >= 0.1.11
Requires: python2-keystoneclient >= 1:3.8.0
Requires: python2-murano-pkg-check >= 0.3.0
Requires: python2-pbr >= 2.0.0
Requires: python2-prettytable >= 0.7.2
Requires: python2-requests >= 2.14.2
Requires: python2-six >= 1.10.0
Requires: python2-yaql >= 1.1.3
Requires: python2-osc-lib >= 1.10.0
Requires: python2-oslo-log >= 3.36.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pyOpenSSL >= 16.2.0
%if 0%{?fedora} > 0
Requires: python2-pyyaml >= 3.10
%else
Requires: PyYAML >= 3.10
%endif
Summary: Client library for OpenStack Murano API.
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
%{common_desc}
# Python3 package
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Support of EC2 API for OpenStack
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr >= 2.0.0
BuildRequires: python-tools
Requires: python3-babel >= 2.3.4
Requires: python3-glanceclient >= 1:2.8.0
Requires: python3-iso8601 >= 0.1.11
Requires: python3-keystoneclient >= 1:3.8.0
Requires: python3-murano-pkg-check >= 0.3.0
Requires: python3-pbr >= 2.0.0
Requires: python3-prettytable >= 0.7.2
Requires: python3-requests >= 2.14.2
Requires: python3-six >= 1.10.0
Requires: python3-yaql >= 1.1.3
Requires: python3-osc-lib >= 1.10.0
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pyOpenSSL >= 16.2.0
Requires: python3-PyYAML >= 3.10
%description -n python3-%{pypi_name}
%{common_desc}
%endif
# Documentation package
%package -n python-%{pypi_name}-doc
Summary: Documentation for OpenStack Murano API Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
%description -n python-%{pypi_name}-doc
Documentation for the client library for interacting with Openstack
Murano API.
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# Let RPM handle the dependencies
%py_req_cleanup
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
2to3 --write --nobackups %{py3dir}
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
LANG=en_US.UTF-8 %{__python3} setup.py build
popd
%endif
# generate html docs
export PYTHONPATH=.
sphinx-build -W -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%install
%if 0%{?with_python3}
pushd %{py3dir}
LANG=en_US.UTF-8 %{__python3} setup.py install --skip-build --root %{buildroot}
mv %{buildroot}%{_bindir}/murano %{buildroot}%{_bindir}/python3-murano
popd
%endif
%{__python2} setup.py install --skip-build --root %{buildroot}
# rename binaries, make compat symlinks
pushd %{buildroot}%{_bindir}
%if 0%{?with_python3}
for i in %{pypi_name}-{3,%{?python3_shortver}}; do
ln -s python3-%{pypi_name} $i
done
%endif
popd
%files -n python2-%{pypi_name}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/python_%{pypi_name}-*-py?.?.egg-info
%{_bindir}/murano*
# Files for python3
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
%{_bindir}/python3-murano
%{_bindir}/murano*
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/python_%{pypi_name}-%{version}-py?.?.egg-info
%endif
%files -n python-%{pypi_name}-doc
%doc doc/build/html
%license LICENSE
%changelog
* Thu Aug 16 2018 RDO <dev@lists.rdoproject.org> 1.1.1-1
- Update to 1.1.1

View File

@ -1,5 +1,7 @@
%global pypi_name networking-sfc
%global module networking_sfc
%global with_doc 0
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Name: python-%{pypi_name}
@ -91,10 +93,12 @@ implemented as a collection of physical network devices connected in series by
cables.
%if 0%{?with_doc}
%package -n python-%{pypi_name}-doc
Summary: Documentation for networking-sfc
%description -n python-%{pypi_name}-doc
Documentation for networking-sfc
%endif
%package -n python2-%{pypi_name}-tests
Summary: Tests for networking-sfc
@ -133,9 +137,11 @@ rm -rf %{module}/tests/unit/cli
%build
export PBR_VERSION=%{version}
%py2_build
%if 0%{?with_doc}
%{__python2} setup.py build_sphinx -b html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
# generate the configuration file
PYTHONPATH=. oslo-config-generator --config-file etc/oslo-config-generator/networking-sfc.conf
@ -167,9 +173,11 @@ mv etc/networking-sfc.conf.sample %{buildroot}%{_sysconfdir}/neutron/conf.d/neut
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/conf.d/neutron-server/networking-sfc.conf
%exclude %{python2_sitelib}/%{module}/tests
%if 0%{?with_doc}
%files -n python-%{pypi_name}-doc
%doc doc/build/html/*
%license LICENSE
%endif
%files -n python2-%{pypi_name}-tests
%{python2_sitelib}/%{module}/tests

View File

@ -1,4 +1,3 @@
TAR_NAME=python-neutronclient
SRC_DIR="$CGCS_BASE/git/python-neutronclient"
TIS_BASE_SRCREV=e145c4ef8a0e8390f0468df422a757760e77f823
TIS_PATCH_VER=GITREVCOUNT
TIS_PATCH_VER=0

View File

@ -6,55 +6,84 @@
%global with_python3 1
%endif
%global common_desc \
Client library and command line utility for interacting with OpenStack \
Neutron's API.
Name: python-neutronclient
Version: 6.5.0
Version: 6.9.1
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Neutron
License: ASL 2.0
URL: http://launchpad.net/python-neutronclient/
Source0: %{name}-%{version}.tar.gz
URL: http://launchpad.net/%{name}/
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
Obsoletes: python-%{sname}-tests <= 4.1.1-3
%description
Client library and command line utility for interacting with OpenStack
Neutron's API.
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Neutron
%{?python_provide:%python_provide python2-neutronclient}
BuildRequires: git
BuildRequires: openstack-macros
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-pbr
BuildRequires: python2-pbr
# Required for unit tests
BuildRequires: python2-osc-lib-tests
BuildRequires: python2-oslotest
BuildRequires: python2-testtools
BuildRequires: python2-testrepository
BuildRequires: python2-testscenarios
Requires: python-babel >= 2.3.4
Requires: python-cliff >= 2.8.0
Requires: python-dateutil
Requires: python-iso8601 >= 0.1.11
Requires: python-netaddr >= 0.7.13
Requires: python-os-client-config >= 1.28.0
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-serialization >= 1.10.0
Requires: python-oslo-utils >= 3.20.0
Requires: python-pbr
Requires: python-requests >= 2.10.0
Requires: python-simplejson >= 2.2.0
Requires: python-six >= 1.9.0
Requires: python-debtcollector >= 1.2.0
Requires: python-osc-lib >= 1.7.0
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-keystoneclient >= 1:3.8.0
Requires: python2-babel >= 2.3.4
Requires: python2-iso8601 >= 0.1.11
Requires: python2-os-client-config >= 1.28.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-log >= 3.36.0
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pbr
Requires: python2-requests >= 2.14.2
Requires: python2-six >= 1.10.0
Requires: python2-debtcollector >= 1.2.0
Requires: python2-osc-lib >= 1.10.0
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-keystoneclient >= 1:3.8.0
Requires: python2-cliff >= 2.8.0
%if 0%{?fedora} > 0
Requires: python2-netaddr >= 0.7.18
Requires: python2-simplejson >= 3.5.1
%else
Requires: python-netaddr >= 0.7.18
Requires: python-simplejson >= 3.5.1
%endif
%description -n python2-%{sname}
Client library and command line utility for interacting with OpenStack
Neutron's API.
%{common_desc}
%package -n python2-%{sname}-tests
Summary: Python API and CLI for OpenStack Neutron - Unit tests
%{?python_provide:%python_provide python2-%{sname}-tests}
Requires: python2-%{sname} == %{version}-%{release}
Requires: python2-osc-lib-tests
Requires: python2-oslotest
Requires: python2-testtools
Requires: python2-testrepository
Requires: python2-testscenarios
%description -n python2-%{sname}-tests
%{common_desc}
This package containts the unit tests.
%if 0%{?with_python3}
%package -n python3-%{sname}
@ -64,62 +93,73 @@ Summary: Python API and CLI for OpenStack Neutron
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
# Required for unit tests
BuildRequires: python3-osc-lib-tests
BuildRequires: python3-oslotest
BuildRequires: python3-testrepository
BuildRequires: python3-testtools
BuildRequires: python3-testscenarios
Requires: python3-babel >= 2.3.4
Requires: python3-cliff >= 2.8.0
Requires: python3-iso8601 >= 0.1.11
Requires: python3-netaddr >= 0.7.13
Requires: python3-netaddr >= 0.7.18
Requires: python3-os-client-config >= 1.28.0
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-serialization >= 1.10.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr
Requires: python3-requests >= 2.10.0
Requires: python3-simplejson >= 2.2.0
Requires: python3-six >= 1.9.0
Requires: python3-requests >= 2.14.2
Requires: python3-simplejson >= 3.5.1
Requires: python3-six >= 1.10.0
Requires: python3-debtcollector >= 1.2.0
Requires: python3-osc-lib >= 1.7.0
Requires: python3-keystoneauth1 >= 3.1.0
Requires: python3-osc-lib >= 1.10.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-keystoneclient >= 1:3.8.0
%description -n python3-%{sname}
Client library and command line utility for interacting with OpenStack
Neutron's API.
%{common_desc}
%package -n python3-%{sname}-tests
Summary: Python API and CLI for OpenStack Neutron - Unit tests
%{?python_provide:%python_provide python3-%{sname}-tests}
Requires: python3-%{sname} == %{version}-%{release}
Requires: python3-osc-lib-tests
Requires: python3-oslotest
Requires: python3-testrepository
Requires: python3-testtools
Requires: python3-testscenarios
%description -n python3-%{sname}-tests
%{common_desc}
This package containts the unit tests.
%endif
%package doc
Summary: Documentation for OpenStack Neutron API Client
BuildRequires: python-dateutil
BuildRequires: python-sphinx
BuildRequires: python-oslo-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-reno
BuildRequires: python-cliff
BuildRequires: python-keystoneauth1
BuildRequires: python-keystoneclient
BuildRequires: python-os-client-config
BuildRequires: python-osc-lib
BuildRequires: python-oslo-serialization
BuildRequires: python-oslo-utils
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-reno
BuildRequires: python2-keystoneauth1
BuildRequires: python2-keystoneclient
BuildRequires: python2-os-client-config
BuildRequires: python2-osc-lib >= 1.10.0
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-utils
BuildRequires: python2-cliff
%description doc
Client library and command line utility for interacting with OpenStack
Neutron's API.
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%{common_desc}
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Let RPM handle the dependencies
rm -f test-requirements.txt requirements.txt
%py_req_cleanup
%build
export PBR_VERSION=%{version}
@ -129,47 +169,56 @@ export PBR_VERSION=%{version}
%py3_build
%endif
# Build HTML docs
export PYTHONPATH=.
sphinx-build -W -b html doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -rf doc/build/html/.doctrees doc/build/html/.buildinfo
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/neutron %{buildroot}%{_bindir}/neutron-%{python3_version}
ln -s ./neutron-%{python3_version} %{buildroot}%{_bindir}/neutron-3
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/neutronclient/tests
%endif
%py2_install
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
mv %{buildroot}%{_bindir}/neutron %{buildroot}%{_bindir}/neutron-%{python2_version}
ln -s ./neutron-%{python2_version} %{buildroot}%{_bindir}/neutron-2
ln -s ./neutron-2 %{buildroot}%{_bindir}/neutron
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/neutron.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/neutron
# STX: stage wheel files
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/neutronclient/tests
%{__python2} setup.py build_sphinx -b html
# prep SDK package
# STX: prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients/%{name}
tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%check
# (TODO) Ignore unit tests results until https://bugs.launchpad.net/python-neutronclient/+bug/1783789
# is fixed.
%{__python2} setup.py testr || true
%if 0%{?with_python3}
rm -rf .testrepository
%{__python3} setup.py testr || true
%endif
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/neutronclient
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_bindir}/neutron
%{_bindir}/neutron-2
%{_bindir}/neutron-%{python2_version}
%exclude %{python2_sitelib}/neutronclient/tests
%files -n python2-%{sname}-tests
%{python2_sitelib}/neutronclient/tests
%if 0%{?with_python3}
%files -n python3-%{sname}
@ -177,15 +226,24 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --e
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_bindir}/neutron-3
%{_bindir}/neutron-%{python3_version}
%exclude %{python3_sitelib}/neutronclient/tests
%files -n python3-%{sname}-tests
%{python3_sitelib}/neutronclient/tests
%endif
%files doc
%doc doc/build/html
%license LICENSE
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz
@ -198,7 +256,11 @@ Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Mon Aug 14 2017 Alfredo Moralejo <amoralej@redhat.com> 6.5.0-1
- Update to 6.5.0
%changelog
* Thu Sep 20 2018 RDO <dev@lists.rdoproject.org> 6.9.1-1
- Update to 6.9.1
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 6.9.0-1
- Update to 6.9.0

View File

@ -0,0 +1,233 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname neutronclient
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
Client library and command line utility for interacting with OpenStack \
Neutron's API.
Name: python-neutronclient
Version: 6.9.1
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Neutron
License: ASL 2.0
URL: http://launchpad.net/%{name}/
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
Obsoletes: python-%{sname}-tests <= 4.1.1-3
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Neutron
%{?python_provide:%python_provide python2-neutronclient}
BuildRequires: git
BuildRequires: openstack-macros
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
# Required for unit tests
BuildRequires: python2-osc-lib-tests
BuildRequires: python2-oslotest
BuildRequires: python2-testtools
BuildRequires: python2-testrepository
BuildRequires: python2-testscenarios
Requires: python2-babel >= 2.3.4
Requires: python2-iso8601 >= 0.1.11
Requires: python2-os-client-config >= 1.28.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-log >= 3.36.0
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pbr
Requires: python2-requests >= 2.14.2
Requires: python2-six >= 1.10.0
Requires: python2-debtcollector >= 1.2.0
Requires: python2-osc-lib >= 1.10.0
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-keystoneclient >= 1:3.8.0
Requires: python2-cliff >= 2.8.0
%if 0%{?fedora} > 0
Requires: python2-netaddr >= 0.7.18
Requires: python2-simplejson >= 3.5.1
%else
Requires: python-netaddr >= 0.7.18
Requires: python-simplejson >= 3.5.1
%endif
%description -n python2-%{sname}
%{common_desc}
%package -n python2-%{sname}-tests
Summary: Python API and CLI for OpenStack Neutron - Unit tests
%{?python_provide:%python_provide python2-%{sname}-tests}
Requires: python2-%{sname} == %{version}-%{release}
Requires: python2-osc-lib-tests
Requires: python2-oslotest
Requires: python2-testtools
Requires: python2-testrepository
Requires: python2-testscenarios
%description -n python2-%{sname}-tests
%{common_desc}
This package containts the unit tests.
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Neutron
%{?python_provide:%python_provide python3-neutronclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
# Required for unit tests
BuildRequires: python3-osc-lib-tests
BuildRequires: python3-oslotest
BuildRequires: python3-testrepository
BuildRequires: python3-testtools
BuildRequires: python3-testscenarios
Requires: python3-babel >= 2.3.4
Requires: python3-cliff >= 2.8.0
Requires: python3-iso8601 >= 0.1.11
Requires: python3-netaddr >= 0.7.18
Requires: python3-os-client-config >= 1.28.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr
Requires: python3-requests >= 2.14.2
Requires: python3-simplejson >= 3.5.1
Requires: python3-six >= 1.10.0
Requires: python3-debtcollector >= 1.2.0
Requires: python3-osc-lib >= 1.10.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-keystoneclient >= 1:3.8.0
%description -n python3-%{sname}
%{common_desc}
%package -n python3-%{sname}-tests
Summary: Python API and CLI for OpenStack Neutron - Unit tests
%{?python_provide:%python_provide python3-%{sname}-tests}
Requires: python3-%{sname} == %{version}-%{release}
Requires: python3-osc-lib-tests
Requires: python3-oslotest
Requires: python3-testrepository
Requires: python3-testtools
Requires: python3-testscenarios
%description -n python3-%{sname}-tests
%{common_desc}
This package containts the unit tests.
%endif
%package doc
Summary: Documentation for OpenStack Neutron API Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-reno
BuildRequires: python2-keystoneauth1
BuildRequires: python2-keystoneclient
BuildRequires: python2-os-client-config
BuildRequires: python2-osc-lib
BuildRequires: python2-oslo-serialization
BuildRequires: python2-oslo-utils
BuildRequires: python2-cliff
%description doc
%{common_desc}
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Let RPM handle the dependencies
%py_req_cleanup
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# Build HTML docs
export PYTHONPATH=.
sphinx-build -W -b html doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -rf doc/build/html/.doctrees doc/build/html/.buildinfo
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/neutron %{buildroot}%{_bindir}/neutron-%{python3_version}
ln -s ./neutron-%{python3_version} %{buildroot}%{_bindir}/neutron-3
%endif
%py2_install
mv %{buildroot}%{_bindir}/neutron %{buildroot}%{_bindir}/neutron-%{python2_version}
ln -s ./neutron-%{python2_version} %{buildroot}%{_bindir}/neutron-2
ln -s ./neutron-2 %{buildroot}%{_bindir}/neutron
%check
# (TODO) Ignore unit tests results until https://bugs.launchpad.net/python-neutronclient/+bug/1783789
# is fixed.
%{__python2} setup.py testr || true
%if 0%{?with_python3}
rm -rf .testrepository
%{__python3} setup.py testr || true
%endif
%files -n python2-%{sname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/neutronclient
%{python2_sitelib}/*.egg-info
%{_bindir}/neutron
%{_bindir}/neutron-2
%{_bindir}/neutron-%{python2_version}
%exclude %{python2_sitelib}/neutronclient/tests
%files -n python2-%{sname}-tests
%{python2_sitelib}/neutronclient/tests
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_bindir}/neutron-3
%{_bindir}/neutron-%{python3_version}
%exclude %{python3_sitelib}/neutronclient/tests
%files -n python3-%{sname}-tests
%{python3_sitelib}/neutronclient/tests
%endif
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Thu Sep 20 2018 RDO <dev@lists.rdoproject.org> 6.9.1-1
- Update to 6.9.1
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 6.9.0-1
- Update to 6.9.0

View File

@ -1,4 +1,3 @@
TAR_NAME=python-novaclient
SRC_DIR=$CGCS_BASE/git/python-novaclient
TIS_BASE_SRCREV=a1c00740c5b709a7d2bc4289fa6e28eac7909b8f
TIS_PATCH_VER=GITREVCOUNT
TIS_PATCH_VER=0

View File

@ -1,54 +1,56 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname novaclient
%global with_doc 0
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the OpenStack Nova API. There's a Python API (the \
novaclient module), and a command-line script (nova). Each implements 100% of \
the OpenStack Nova API.
Name: python-novaclient
Epoch: 1
Version: 9.1.1
Version: 11.0.0
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: Python API and CLI for OpenStack Nova
License: ASL 2.0
URL: https://launchpad.net/python-novaclient
Source0: %{name}-%{version}.tar.gz
URL: https://launchpad.net/%{name}
Source0: https://pypi.io/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
This is a client for the OpenStack Nova API. There's a Python API (the
novaclient module), and a command-line script (nova). Each implements 100% of
the OpenStack Nova API.
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Nova
%{?python_provide:%python_provide python2-novaclient}
BuildRequires: python2-devel
BuildRequires: python-pbr
BuildRequires: git
BuildRequires: python-setuptools
BuildRequires: python2-pbr
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-dateutil
Requires: python-babel >= 2.3.4
Requires: python-iso8601 >= 0.1.11
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-oslo-i18n >= 2.1.0
Requires: python-oslo-serialization >= 1.10.0
Requires: python-oslo-utils >= 3.20.0
Requires: python-pbr >= 2.0.0
Requires: python-prettytable >= 0.7.1
Requires: python-requests
Requires: python-simplejson >= 2.2.0
Requires: python-six >= 1.9.0
Requires: python2-babel >= 2.3.4
Requires: python2-iso8601 >= 0.1.11
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pbr >= 2.0.0
Requires: python2-prettytable >= 0.7.2
Requires: python-simplejson >= 3.5.1
Requires: python2-six >= 1.10.0
%description -n python2-%{sname}
This is a client for the OpenStack Nova API. There's a Python API (the
novaclient module), and a command-line script (nova). Each implements 100% of
the OpenStack Nova API.
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
@ -61,50 +63,42 @@ BuildRequires: python3-setuptools
Requires: python3-babel >= 2.3.4
Requires: python3-iso8601 >= 0.1.11
Requires: python3-keystoneauth1 >= 3.1.0
Requires: python3-oslo-i18n >= 2.1.0
Requires: python3-oslo-serialization >= 1.10.0
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr >= 2.0.0
Requires: python3-prettytable >= 0.7.1
Requires: python3-requests
Requires: python3-simplejson >= 2.2.0
Requires: python3-six >= 1.9.0
Requires: python3-prettytable >= 0.7.2
Requires: python3-simplejson >= 3.5.1
Requires: python3-six >= 1.10.0
%description -n python3-%{sname}
This is a client for the OpenStack Nova API. There's a Python API (the
novaclient module), and a command-line script (nova). Each implements 100% of
the OpenStack Nova API.
%{common_desc}
%endif
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Nova API Client
BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-oslo-utils
BuildRequires: python-keystoneauth1
BuildRequires: python-oslo-serialization
BuildRequires: python-prettytable
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-oslo-utils
BuildRequires: python2-keystoneauth1
BuildRequires: python2-oslo-serialization
BuildRequires: python2-prettytable
BuildRequires: python2-sphinxcontrib-apidoc
%description doc
This is a client for the OpenStack Nova API. There's a Python API (the
novaclient module), and a command-line script (nova). Each implements 100% of
the OpenStack Nova API.
%{common_desc}
This package contains auto-generated documentation.
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Let RPM handle the requirements
rm -f test-requirements.txt
%py_req_cleanup
%build
export PBR_VERSION=%{version}
@ -128,9 +122,6 @@ rm -fr %{buildroot}%{python3_sitelib}/novaclient/tests
mv %{buildroot}%{_bindir}/nova %{buildroot}%{_bindir}/nova-%{python2_version}
ln -s ./nova-%{python2_version} %{buildroot}%{_bindir}/nova-2
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
ln -s ./nova-2 %{buildroot}%{_bindir}/nova
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
@ -140,25 +131,34 @@ install -pm 644 tools/nova.bash_completion \
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/novaclient/tests
%if 0%{?with_doc}
%{__python2} setup.py build_sphinx -b html
%{__python2} setup.py build_sphinx -b man
# generate man page
sphinx-build -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/nova.1 %{buildroot}%{_mandir}/man1/nova.1
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
%endif
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients/%{name}
tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%files -n python2-%{sname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{sname}
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%if 0%{?with_doc}
%{_mandir}/man1/nova.1.gz
%endif
%{_bindir}/nova
%{_bindir}/nova-2
%{_bindir}/nova-%{python2_version}
@ -171,14 +171,24 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --e
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%if 0%{?with_doc}
%{_mandir}/man1/nova.1.gz
%endif
%{_bindir}/nova-3
%{_bindir}/nova-%{python3_version}
%endif
%if 0%{?with_doc}
%files doc
%doc doc/build/html
%license LICENSE
%endif
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz
@ -192,10 +202,8 @@ Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Fri Oct 06 2017 rdo-trunk <javier.pena@redhat.com> 1:9.1.1-1
- Update to 9.1.1
* Mon Aug 14 2017 Alfredo Moralejo <amoralej@redhat.com> 1:9.1.0-1
- Update to 9.1.0
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 1:11.0.0-1
- Update to 11.0.0

View File

@ -0,0 +1,164 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname novaclient
%if 0%{?fedora}
%global with_python3 1
%endif
%global common_desc \
This is a client for the OpenStack Nova API. There's a Python API (the \
novaclient module), and a command-line script (nova). Each implements 100% of \
the OpenStack Nova API.
Name: python-novaclient
Epoch: 1
Version: 11.0.0
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Nova
License: ASL 2.0
URL: https://launchpad.net/%{name}
Source0: https://pypi.io/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python2-%{sname}
Summary: Python API and CLI for OpenStack Nova
%{?python_provide:%python_provide python2-novaclient}
BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-setuptools
Requires: python2-babel >= 2.3.4
Requires: python2-iso8601 >= 0.1.11
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-serialization >= 2.18.0
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-pbr >= 2.0.0
Requires: python2-prettytable >= 0.7.2
Requires: python-simplejson >= 3.5.1
Requires: python2-six >= 1.10.0
%description -n python2-%{sname}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Nova
%{?python_provide:%python_provide python3-novaclient}
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
Requires: python3-babel >= 2.3.4
Requires: python3-iso8601 >= 0.1.11
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-serialization >= 2.18.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr >= 2.0.0
Requires: python3-prettytable >= 0.7.2
Requires: python3-simplejson >= 3.5.1
Requires: python3-six >= 1.10.0
%description -n python3-%{sname}
%{common_desc}
%endif
%package doc
Summary: Documentation for OpenStack Nova API Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-oslo-utils
BuildRequires: python2-keystoneauth1
BuildRequires: python2-oslo-serialization
BuildRequires: python2-prettytable
%description doc
%{common_desc}
This package contains auto-generated documentation.
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# Let RPM handle the requirements
%py_req_cleanup
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/nova %{buildroot}%{_bindir}/nova-%{python3_version}
ln -s ./nova-%{python3_version} %{buildroot}%{_bindir}/nova-3
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/novaclient/tests
%endif
%py2_install
mv %{buildroot}%{_bindir}/nova %{buildroot}%{_bindir}/nova-%{python2_version}
ln -s ./nova-%{python2_version} %{buildroot}%{_bindir}/nova-2
ln -s ./nova-2 %{buildroot}%{_bindir}/nova
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/nova.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/nova
# Delete tests
rm -fr %{buildroot}%{python2_sitelib}/novaclient/tests
%{__python2} setup.py build_sphinx -b html
%{__python2} setup.py build_sphinx -b man
install -p -D -m 644 doc/build/man/nova.1 %{buildroot}%{_mandir}/man1/nova.1
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
%files -n python2-%{sname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{sname}
%{python2_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_mandir}/man1/nova.1.gz
%{_bindir}/nova
%{_bindir}/nova-2
%{_bindir}/nova-%{python2_version}
%if 0%{?with_python3}
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_mandir}/man1/nova.1.gz
%{_bindir}/nova-3
%{_bindir}/nova-%{python3_version}
%endif
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 1:11.0.0-1
- Update to 11.0.0

View File

@ -1 +1,3 @@
TIS_PATCH_VER=18
TAR_NAME=python-openstackclient
SRC_DIR="$CGCS_BASE/git/python-openstackclient"
TIS_PATCH_VER=0

View File

@ -1,13 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 62817fd..2c25c75 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -10,7 +10,7 @@
Name: python-openstackclient
Version: 3.12.0
-Release: 1%{?dist}
+Release: 2.el7%{?_tis_dist}.%{tis_patch_ver}
Summary: OpenStack Command-line Client
License: ASL 2.0

View File

@ -1,42 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 2c25c75..874e8a4 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -162,6 +162,13 @@ It is a thin wrapper to the stock python-*client modules that implement the
actual REST API client actions.
%endif
+%package sdk
+Summary: SDK files for %{name}
+
+%description sdk
+Contains SDK files for %{name} package
+
+
%prep
%autosetup -n %{name}-%{upstream_version} -S git
@@ -206,6 +213,12 @@ mv %{buildroot}%{python2_sitelib}/openstackclient/locale %{buildroot}%{_datadir}
rm -rf %{buildroot}%{python3_sitelib}/openstackclient/locale
%endif
+
+# prep SDK package
+mkdir -p %{buildroot}/usr/share/remote-clients/%{name}
+tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
+
+
# Find language files
%find_lang openstackclient --all-name
@@ -242,6 +255,10 @@ rm -rf .testrepository
%{python3_sitelib}/openstackclient
%{python3_sitelib}/*.egg-info
%endif
+
+%files sdk
+/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz
+
%changelog
* Mon Aug 21 2017 Alfredo Moralejo <amoralej@redhat.com> 3.12.0-1
- Update to 3.12.0

View File

@ -1,13 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 874e8a4..8cea3b8 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -173,7 +173,7 @@ Contains SDK files for %{name} package
%autosetup -n %{name}-%{upstream_version} -S git
# We handle requirements ourselves, pkg_resources only bring pain
-rm -rf requirements.txt test-requirements.txt
+rm -rf test-requirements.txt
%build
%py2_build

View File

@ -1,12 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 8cea3b8..dbb1daa 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -59,6 +59,7 @@ BuildRequires: python-reno
BuildRequires: python-requestsexceptions
BuildRequires: python-openstacksdk
BuildRequires: python-osprofiler
+BuildRequires: python-dateutil
Requires: python-pbr
Requires: python-babel

View File

@ -1,14 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index dbb1daa..3ef7f0d 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -17,6 +17,9 @@ License: ASL 2.0
URL: http://github.com/openstack/%{name}
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
+# WRS patches
+Patch0001: 0001-neutron-extensions.patch
+
BuildArch: noarch
%description

View File

@ -1,12 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 3ef7f0d..9f624f1 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -19,6 +19,7 @@ Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_vers
# WRS patches
Patch0001: 0001-neutron-extensions.patch
+Patch0002: openstackClient_Passwordchange_warning.patch
BuildArch: noarch

View File

@ -1,12 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 9f624f1..4791547 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -20,6 +20,7 @@ Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_vers
# WRS patches
Patch0001: 0001-neutron-extensions.patch
Patch0002: openstackClient_Passwordchange_warning.patch
+Patch0003: CGTS-7814-warning-only-when-the-admin-password-chang.patch
BuildArch: noarch

View File

@ -1,25 +0,0 @@
From bf24d1a99d29ab66feb4b2c7c7e5839e1cc23ec3 Mon Sep 17 00:00:00 2001
From: Andy Ning <andy.ning@windriver.com>
Date: Thu, 2 Nov 2017 10:45:40 -0400
Subject: CGTS-7947: add --os-keystone-region-name to identity client
Signed-off-by: Andy Ning <andy.ning@windriver.com>
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 4791547..5d3d7b4 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -21,6 +21,7 @@ Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_vers
Patch0001: 0001-neutron-extensions.patch
Patch0002: openstackClient_Passwordchange_warning.patch
Patch0003: CGTS-7814-warning-only-when-the-admin-password-chang.patch
+Patch0004: 0001-CGTS-7947-add-os-keystone-region-name-to-identity-cl.patch
BuildArch: noarch
--
2.7.4

View File

@ -1,33 +0,0 @@
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 5d3d7b4..44dd46b 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -70,17 +70,17 @@ BuildRequires: python-dateutil
Requires: python-pbr
Requires: python-babel
Requires: python-cliff
-Requires: python-openstacksdk >= 0.9.17
-Requires: python-oslo-i18n >= 2.1.0
-Requires: python-oslo-utils >= 3.20.0
-Requires: python-glanceclient >= 1:2.8.0
-Requires: python-keystoneauth1 >= 3.1.0
-Requires: python-keystoneclient >= 1:3.8.0
-Requires: python-novaclient >= 1:9.0.0
-Requires: python-cinderclient >= 3.1.0
-Requires: python-neutronclient >= 6.3.0
-Requires: python-six >= 1.9.0
-Requires: python-osc-lib >= 1.7.0
+Requires: python-openstacksdk
+Requires: python-oslo-i18n
+Requires: python-oslo-utils
+Requires: python-glanceclient
+Requires: python-keystoneauth1
+Requires: python-keystoneclient
+Requires: python-novaclient
+Requires: python-cinderclient
+Requires: python-neutronclient
+Requires: python-six
+Requires: python-osc-lib
Requires: python-%{client}-lang = %{version}-%{release}

View File

@ -1,36 +0,0 @@
From 18d4d4009e230d6d0b820496d210641ab79802af Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Thu, 19 Oct 2017 14:19:56 -0500
Subject: Turn off openstackclient check
---
SPECS/python-openstackclient.spec | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 44dd46b..9bca398 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -229,12 +229,13 @@ tar zcf %{buildroot}/usr/share/remote-clients/%{name}/%{name}-%{version}.tgz --e
# Find language files
%find_lang openstackclient --all-name
-%check
-%{__python2} setup.py test
-%if 0%{?with_python3}
-rm -rf .testrepository
-%{__python3} setup.py test
-%endif
+# WRS disable check.
+#%check
+#%{__python2} setup.py test
+#%if 0%{?with_python3}
+#rm -rf .testrepository
+#%{__python3} setup.py test
+#%endif
%files -n python2-%{client}
%license LICENSE
--
2.7.4

View File

@ -1,24 +0,0 @@
From 47de75f37476e81f627222417e652ac77b2a17ab Mon Sep 17 00:00:00 2001
From: Sen Yang <sen.yang@windriver.com>
Date: Wed, 20 Dec 2017 23:53:02 -0500
Subject: [PATCH 1/1] meta us101470
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 9bca398..3e184a9 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -22,6 +22,7 @@ Patch0001: 0001-neutron-extensions.patch
Patch0002: openstackClient_Passwordchange_warning.patch
Patch0003: CGTS-7814-warning-only-when-the-admin-password-chang.patch
Patch0004: 0001-CGTS-7947-add-os-keystone-region-name-to-identity-cl.patch
+Patch0005: 0001-US101470-Openstackclient-implementation-of-novaclien.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,24 +0,0 @@
From c330094f36df9e38c497d6cbfb03574e6ad368a0 Mon Sep 17 00:00:00 2001
From: Sen Yang <sen.yang@windriver.com>
Date: Fri, 5 Jan 2018 15:25:06 -0500
Subject: [PATCH 1/1] US101470 part2
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 3e184a9..1cf210a 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -23,6 +23,7 @@ Patch0002: openstackClient_Passwordchange_warning.patch
Patch0003: CGTS-7814-warning-only-when-the-admin-password-chang.patch
Patch0004: 0001-CGTS-7947-add-os-keystone-region-name-to-identity-cl.patch
Patch0005: 0001-US101470-Openstackclient-implementation-of-novaclien.patch
+Patch0006: 0002-US101470-Openstackclient-implementation-of-novaclien.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,25 +0,0 @@
From 12504bfa15db581d310f3e059b5c8dce0df1be9f Mon Sep 17 00:00:00 2001
From: Sen Yang <sen.yang@windriver.com>
Date: Thu, 1 Feb 2018 12:05:55 -0500
Subject: [PATCH 1/1] US106901 Openstack-CLI-Adoption for
Glance/Cinder/Ceilometer
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 1cf210a..6774444 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -24,6 +24,7 @@ Patch0003: CGTS-7814-warning-only-when-the-admin-password-chang.patch
Patch0004: 0001-CGTS-7947-add-os-keystone-region-name-to-identity-cl.patch
Patch0005: 0001-US101470-Openstackclient-implementation-of-novaclien.patch
Patch0006: 0002-US101470-Openstackclient-implementation-of-novaclien.patch
+Patch0007: 0001-US106901-Openstack-CLI-Adoption.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,25 +0,0 @@
From ddf5ea208a3ba122558e355fe8535bcba024d2c8 Mon Sep 17 00:00:00 2001
From: Sen Yang <sen.yang@windriver.com>
Date: Mon, 5 Feb 2018 15:37:29 -0500
Subject: [PATCH 1/1] US106901 Openstack CLI Adoption: Cinder/Glance/Ceilometer
CI part2
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 6774444..4b1682e 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -25,6 +25,7 @@ Patch0004: 0001-CGTS-7947-add-os-keystone-region-name-to-identity-cl.patc
Patch0005: 0001-US101470-Openstackclient-implementation-of-novaclien.patch
Patch0006: 0002-US101470-Openstackclient-implementation-of-novaclien.patch
Patch0007: 0001-US106901-Openstack-CLI-Adoption.patch
+Patch0008: 0002-US106901-Openstack-CLI-Adoption.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,26 +0,0 @@
From ac2faa010188a6d824a8958c2971bcefe2a56ab9 Mon Sep 17 00:00:00 2001
From: Angie Wang <angie.Wang@windriver.com>
Date: Fri, 8 Jun 2018 16:05:52 -0400
Subject: [PATCH] meta patch for endpoint groups
---
SPECS/python-openstackclient.spec | 3 +++
1 file changed, 3 insertions(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 4b1682e..c192b2b 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -26,6 +26,9 @@ Patch0005: 0001-US101470-Openstackclient-implementation-of-novaclien.patc
Patch0006: 0002-US101470-Openstackclient-implementation-of-novaclien.patch
Patch0007: 0001-US106901-Openstack-CLI-Adoption.patch
Patch0008: 0002-US106901-Openstack-CLI-Adoption.patch
+Patch0009: 0001-Optimize-getting-endpoint-list.patch
+Patch0010: 0002-Add-support-for-endpoing-filter-commands.patch
+Patch0011: 0003-Add-support-for-endpoint-group-commands.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,23 +0,0 @@
From 15a676bb74150546db8425ecae4976fb773661a0 Mon Sep 17 00:00:00 2001
From: Joseph Richard <Joseph.Richard@windriver.com>
Date: Tue, 25 Sep 2018 14:57:06 -0400
Subject: [PATCH 16/16] Allow setting wrs-binding:vif_model using osclient
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index c192b2b..29fec53 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -29,6 +29,7 @@ Patch0008: 0002-US106901-Openstack-CLI-Adoption.patch
Patch0009: 0001-Optimize-getting-endpoint-list.patch
Patch0010: 0002-Add-support-for-endpoing-filter-commands.patch
Patch0011: 0003-Add-support-for-endpoint-group-commands.patch
+Patch0012: 0001-Allow-setting-wrs-binding-vif_model-using-osclient.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,24 +0,0 @@
From 6cf8ebc9e09035d49cfb051c4c4b03c4b8607ba3 Mon Sep 17 00:00:00 2001
From: Teresa Ho <teresa.ho@windriver.com>
Date: Tue, 30 Oct 2018 11:16:53 -0400
Subject: [PATCH] Remove wrs-binding:mac_filtering and setting extension
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 29fec53..3dd52cb 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -30,6 +30,7 @@ Patch0009: 0001-Optimize-getting-endpoint-list.patch
Patch0010: 0002-Add-support-for-endpoing-filter-commands.patch
Patch0011: 0003-Add-support-for-endpoint-group-commands.patch
Patch0012: 0001-Allow-setting-wrs-binding-vif_model-using-osclient.patch
+Patch0013: 0001-Remove-wrs-binding-mac_filtering-and-setting-extensi.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -1,17 +0,0 @@
0001-Update-package-versioning-for-TIS-format.patch
0002-spec-remote-clients-sdk.patch
0003-meta-dont-remove-requirements-txt.patch
0004-added-missing-build-require-dateutil.patch
0005-meta-patch-for-neutron-extensions.patch
0006-openstackClient_Passwordchange_warning.patch
0007-CGTS-7814-warning-only-when-the-admin-password-chang.patch
0008-CGTS-7947-add-os-keystone-region-name-to-identity-cl.patch
1000-remove-version-requirements.patch
1001-Turn-off-openstackclient-check.patch
1002-meta-us101470.patch
1003-meta-us101470.patch
1004-meta-US106901-Openstack-CLI-Adoption.patch
1005-meta-US106901-Openstack-CLI-Adoption.patch
1006-meta-patch-for-endpoint-groups.patch
1007-Allow-setting-wrs-binding-vif_model-using-osclient.patch
1008-Remove-wrs-binding-mac_filtering-and-setting-extensi.patch

View File

@ -1,64 +0,0 @@
From 405e39f8a77c7f33dda80b2681ff53407b2aa256 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 25 Sep 2018 14:53:18 -0400
Subject: [PATCH] Allow setting wrs-binding:vif_model using osclient
---
openstackclient/network/v2/port.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py
index 4a29daf..22cba16 100644
--- a/openstackclient/network/v2/port.py
+++ b/openstackclient/network/v2/port.py
@@ -389,6 +389,12 @@ class CreatePort(command.ShowOne):
"ip-address=<ip-address>[,mac-address=<mac-address>] "
"(repeat option to set multiple allowed-address pairs)")
)
+ port_security.add_argument(
+ '--wrs-binding:vif_model',
+ dest='wrs_vif_model',
+ metavar='<wrs_vif_model>',
+ help=_("Set wrs-binding:vif_model for this port")
+ )
_tag.add_tag_option_to_parser_for_create(parser, _('port'))
return parser
@@ -421,6 +427,11 @@ class CreatePort(command.ShowOne):
if parsed_args.qos_policy:
attrs['qos_policy_id'] = client.find_qos_policy(
parsed_args.qos_policy, ignore_missing=False).id
+
+ if parsed_args.wrs_vif_model:
+ attrs['wrs-binding:vif_model'] = parsed_args.wrs_vif_model
+
+
obj = client.create_port(**attrs)
# tags cannot be set when created, so tags need to be set later.
_tag.update_tags_for_set(client, obj, parsed_args)
@@ -705,6 +716,13 @@ class SetPort(command.Command):
"Unset it to None with the 'port unset' command "
"(requires data plane status extension)")
)
+ port_security.add_argument(
+ '--wrs-binding:vif_model',
+ dest='wrs_vif_model',
+ metavar='<wrs_vif_model>',
+ help=_("Set wrs-binding:vif_model for this port")
+ )
+
_tag.add_tag_option_to_parser_for_set(parser, _('port'))
return parser
@@ -762,6 +780,9 @@ class SetPort(command.Command):
if parsed_args.data_plane_status:
attrs['data_plane_status'] = parsed_args.data_plane_status
+ if parsed_args.wrs_vif_model:
+ attrs['wrs-binding:vif_model'] = parsed_args.wrs_vif_model
+
if attrs:
client.update_port(obj, **attrs)
--
1.8.3.1

View File

@ -1,27 +0,0 @@
From 54d7b55413d3374911957f6327ebd73f70ee24b8 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 2 Nov 2017 10:40:15 -0400
Subject: [PATCH 1/1] CGTS-7947: add --os-keystone-region-name to identity
client
Signed-off-by: rpm-build <rpm-build>
---
openstackclient/identity/client.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/openstackclient/identity/client.py b/openstackclient/identity/client.py
index 0292aac..e2f4756 100644
--- a/openstackclient/identity/client.py
+++ b/openstackclient/identity/client.py
@@ -53,7 +53,7 @@ def make_client(instance):
client = identity_client(
session=instance.session,
- region_name=instance.region_name,
+ region_name=instance.keystone_region_name,
**kwargs
)
--
1.8.3.1

View File

@ -1,99 +0,0 @@
From f6f5ce03c5b8a03180db24a02dda5b30f40b4cee Mon Sep 17 00:00:00 2001
From: Anton Frolov <af9740@att.com>
Date: Mon, 25 Sep 2017 12:31:24 -0700
Subject: [PATCH] Optimize getting endpoint list
Currently ListEndpoint.take_action method unconditionally iterates
over all endpoints and issue GET /v3/services/<ep.service_id>
request for each endpoint. In case of HTTPS keystone endpoint this
can take significant amout of time, and it only getting worse in
case of multiple regions.
This commit change this logic to making just two GET requests: first
it gets endpoint list, then it gets service list, searching service
in the list instead of issuing GET /v3/services/<id> request.
Change-Id: I22b61c0b45b0205a2f5a4608c2473cb7814fe3cf
Closes-Bug: 1719413
---
openstackclient/identity/common.py | 10 ++++++++++
openstackclient/identity/v3/endpoint.py | 3 ++-
openstackclient/tests/unit/identity/v3/test_endpoint.py | 2 ++
releasenotes/notes/bug-1719413-0401d05c91cc9094.yaml | 8 ++++++++
4 files changed, 22 insertions(+), 1 deletion(-)
create mode 100644 releasenotes/notes/bug-1719413-0401d05c91cc9094.yaml
diff --git a/openstackclient/identity/common.py b/openstackclient/identity/common.py
index 3dc5adb..e119f66 100644
--- a/openstackclient/identity/common.py
+++ b/openstackclient/identity/common.py
@@ -26,6 +26,16 @@ from osc_lib import utils
from openstackclient.i18n import _
+def find_service_in_list(service_list, service_id):
+ """Find a service by id in service list."""
+
+ for service in service_list:
+ if service.id == service_id:
+ return service
+ raise exceptions.CommandError(
+ "No service with a type, name or ID of '%s' exists." % service_id)
+
+
def find_service(identity_client, name_type_or_id):
"""Find a service by id, name or type."""
diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py
index 15760a1..3b4dd0d 100644
--- a/openstackclient/identity/v3/endpoint.py
+++ b/openstackclient/identity/v3/endpoint.py
@@ -167,9 +167,10 @@ class ListEndpoint(command.Lister):
if parsed_args.region:
kwargs['region'] = parsed_args.region
data = identity_client.endpoints.list(**kwargs)
+ service_list = identity_client.services.list()
for ep in data:
- service = common.find_service(identity_client, ep.service_id)
+ service = common.find_service_in_list(service_list, ep.service_id)
ep.service_name = get_service_name(service)
ep.service_type = service.type
return (columns,
diff --git a/openstackclient/tests/unit/identity/v3/test_endpoint.py b/openstackclient/tests/unit/identity/v3/test_endpoint.py
index 765fbed..fad53fc 100644
--- a/openstackclient/tests/unit/identity/v3/test_endpoint.py
+++ b/openstackclient/tests/unit/identity/v3/test_endpoint.py
@@ -295,6 +295,7 @@ class TestEndpointList(TestEndpoint):
# This is the return value for common.find_resource(service)
self.services_mock.get.return_value = self.service
+ self.services_mock.list.return_value = [self.service]
# Get the command object to test
self.cmd = endpoint.ListEndpoint(self.app, None)
@@ -726,6 +727,7 @@ class TestEndpointListServiceWithoutName(TestEndpointList):
# This is the return value for common.find_resource(service)
self.services_mock.get.return_value = self.service
+ self.services_mock.list.return_value = [self.service]
# Get the command object to test
self.cmd = endpoint.ListEndpoint(self.app, None)
diff --git a/releasenotes/notes/bug-1719413-0401d05c91cc9094.yaml b/releasenotes/notes/bug-1719413-0401d05c91cc9094.yaml
new file mode 100644
index 0000000..784d19e
--- /dev/null
+++ b/releasenotes/notes/bug-1719413-0401d05c91cc9094.yaml
@@ -0,0 +1,8 @@
+---
+fixes:
+ - |
+ Fix an issue with ``endpoint list`` working slow because it is issuing one GET
+ request to /v3/services/<id> Keystone API for each endpoint. In case of HTTPS
+ keystone endpoint and multiple regions it can take significant amount of time.
+ [Bug `1719413 <https://bugs.launchpad.net/python-openstackclient/+bug/1719413>`_]
+
--
1.8.3.1

View File

@ -1,231 +0,0 @@
From 2554505ca186f59b4dd51081565c1d6a8be50db7 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 30 Oct 2018 11:07:43 -0400
Subject: [PATCH] Remove wrs-binding:mac_filtering and setting extension
---
openstackclient/network/v2/port.py | 1 -
openstackclient/network/v2/setting.py | 183 ----------------------------------
setup.cfg | 4 -
3 files changed, 188 deletions(-)
delete mode 100644 openstackclient/network/v2/setting.py
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py
index 22cba16..d158791 100644
--- a/openstackclient/network/v2/port.py
+++ b/openstackclient/network/v2/port.py
@@ -64,7 +64,6 @@ def _get_columns(item):
'tenant_id': 'project_id',
'mtu': 'wrs-binding:mtu',
'vif_model': 'wrs-binding:vif_model',
- 'mac_filtering': 'wrs-binding:mac_filtering',
}
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, column_map)
diff --git a/openstackclient/network/v2/setting.py b/openstackclient/network/v2/setting.py
deleted file mode 100644
index 6be88dd..0000000
--- a/openstackclient/network/v2/setting.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# Copyright (c) 2016 Wind River Systems, Inc.
-#
-#
-#
-#
-#
-
-"""Settings action implementations"""
-
-from osc_lib.command import command
-from osc_lib import exceptions
-from osc_lib import utils
-from openstackclient.i18n import _
-from openstackclient.identity import common as identity_common
-from openstackclient.network import common
-from openstackclient.network import sdk_utils
-
-_formatters = {}
-
-
-def _get_columns(item):
- column_map = {"id": "project_id"}
- invisible_columns = ["name"]
- return sdk_utils.get_osc_show_columns_for_sdk_resource(item, column_map,
- invisible_columns)
-
-
-def _get_attrs(client_manager, parsed_args):
- attrs = {key: parsed_args[key] for key in ["mac_filtering"]
- if key in parsed_args}
-
- if 'project' in parsed_args and parsed_args["project"] is not None:
- identity_client = client_manager.identity
- project_id = identity_common.find_project(
- identity_client,
- parsed_args["project"]
- ).id
- attrs['project_id'] = project_id
-
- return attrs
-
-
-class ListSetting(common.NetworkAndComputeLister):
- """List settings of all projects who have non-default setting values"""
-
- def update_parser_common(self, parser):
- return parser
-
- def take_action_network(self, client, parsed_args):
- columns = (
- 'mac_filtering',
- 'project_id'
- )
- column_headers = (
- 'Mac Filtering',
- 'Project ID'
- )
-
- args = {}
-
- data = client.settings(**args)
-
- return (column_headers,
- (utils.get_item_properties(
- s, columns,
- formatters=_formatters,
- ) for s in data))
-
- def take_action_compute(self, client, parsed_args):
- raise exceptions.CommandError("This command needs access to"
- " a network endpoint.")
- return
-
-
-class ShowSetting(common.NetworkAndComputeShowOne):
- """Show settings of a given project"""
-
- def update_parser_common(self, parser):
- parser.add_argument(
- '--project',
- metavar='<project>',
- help=_("Owner's project (name or ID)"),
- required=False
- )
- return parser
-
- def take_action_network(self, client, parsed_args):
- client = self.app.client_manager.network
- # if no project id is specified, operate on current project
- args = _get_attrs(self.app.client_manager, vars(parsed_args))
- if not "project_id" in args:
- args["project_id"] = client.find_tenant().project_id
- project_id = args["project_id"]
-
- obj = client.find_setting(project_id, ignore_missing=False)
-
- display_columns, columns = _get_columns(obj)
- data = utils.get_item_properties(obj, columns, formatters=_formatters)
- return (display_columns, data)
-
- def take_action_compute(self, client, parsed_args):
- raise exceptions.CommandError("This command needs access to"
- " a network endpoint.")
- return
-
-
-# this one uses NetworkAndComputeCommand because settings can be deleted
-# without a project id
-class DeleteSetting(common.NetworkAndComputeCommand):
- """Delete setting"""
-
- def update_parser_common(self, parser):
- parser.add_argument(
- '--project',
- metavar='<project>',
- help=_("Owner's project (name or ID)"),
- required=False
- )
- return parser
-
- def take_action_network(self, client, parsed_args):
- client = self.app.client_manager.network
- # if no project id is specified, operate on current project
- args = _get_attrs(self.app.client_manager, vars(parsed_args))
- if not "project_id" in args:
- args["project_id"] = client.find_tenant().project_id
- project_id = args["project_id"]
-
- client.delete_setting(project_id)
- return
-
- def take_action_compute(self, client, parsed_args):
- raise exceptions.CommandError("This command needs "
- "access to a network endpoint.")
- return
-
-
-class UpdateSetting(command.Command):
- """Set setting properties"""
-
- def get_parser(self, prog_name):
- parser = super(UpdateSetting, self).get_parser(prog_name)
- parser.add_argument(
- '--project',
- metavar='<project>',
- help=_("Owner's project (name or ID)"),
- required=False
- )
- parser.add_argument('--mac-filtering', metavar='mac_filtering',
- help="Enable/Disable source MAC filtering"
- " on all ports",
- required=True)
- return parser
-
- def take_action(self, parsed_args):
- client = self.app.client_manager.network
- # if no project id is specified, operate on current project
- args = _get_attrs(self.app.client_manager, vars(parsed_args))
- if not "project_id" in args:
- args["project_id"] = client.find_tenant().project_id
- project_id = args["project_id"]
- del args['project_id']
-
- client.find_setting(project_id, ignore_missing=False)
-
- if args == {}:
- msg = "Nothing specified to be set"
- raise exceptions.CommandError(msg)
-
- client.update_setting(project_id, **args)
- return
diff --git a/setup.cfg b/setup.cfg
index d87b387..3e107bb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -435,10 +435,6 @@ openstack.network.v2 =
portforwarding_create = openstackclient.network.v2.portforwarding:CreatePortforwarding
portforwarding_update = openstackclient.network.v2.portforwarding:UpdatePortforwarding
portforwarding_delete = openstackclient.network.v2.portforwarding:DeletePortforwarding
- setting_list = openstackclient.network.v2.setting:ListSetting
- setting_show = openstackclient.network.v2.setting:ShowSetting
- setting_update = openstackclient.network.v2.setting:UpdateSetting
- setting_delete = openstackclient.network.v2.setting:DeleteSetting
net_host_list = openstackclient.network.v2.host:ListHost
net_host_show = openstackclient.network.v2.host:ShowHost
net_host_create = openstackclient.network.v2.host:CreateHost
--
1.8.3.1

View File

@ -1,232 +0,0 @@
From 47122b746e16ffb3d35d14aa4f51f0f759400b71 Mon Sep 17 00:00:00 2001
From: Sen Yang <sen.yang@windriver.com>
Date: Mon, 18 Dec 2017 10:08:08 -0500
Subject: [PATCH 1/1] US101470 Openstackclient implementation of novaclient cli
with wrs extension
In this commit the following OSC equivalence of novaclient cli with
wrs extension is implemented:
openstack pcidevice list - nova device-list
openstack pcidevice show - nova device-show
openstack providernet pci show - nova providernet-show
---
openstackclient/compute/v2/wrs_pci.py | 88 ++++++++++++++++++++++++
openstackclient/compute/v2/wrs_providernets.py | 46 +++++++++++++
python_openstackclient.egg-info/SOURCES.txt | 4 +-
python_openstackclient.egg-info/entry_points.txt | 3 +
setup.cfg | 3 +
5 files changed, 143 insertions(+), 1 deletion(-)
create mode 100644 openstackclient/compute/v2/wrs_pci.py
create mode 100644 openstackclient/compute/v2/wrs_providernets.py
diff --git a/openstackclient/compute/v2/wrs_pci.py b/openstackclient/compute/v2/wrs_pci.py
new file mode 100644
index 0000000..c3fba81
--- /dev/null
+++ b/openstackclient/compute/v2/wrs_pci.py
@@ -0,0 +1,88 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# Copyright (c) 2015-2017 Wind River Systems, Inc.
+#
+#
+#
+#
+
+
+"""Compute v2 wrs_pci action implementations"""
+
+from osc_lib.cli import parseractions
+from osc_lib.command import command
+from osc_lib import utils
+import six
+
+from openstackclient.i18n import _
+
+
+class ListPciDevices(command.Lister):
+ """List pci device"""
+
+ def get_parser(self, prog_name):
+ parser = super(ListPciDevices, self).get_parser(prog_name)
+ parser.add_argument(
+ "--device",
+ metavar="<device>",
+ help=_("PCI devices matching a particular device id or alias.")
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ compute_client = self.app.client_manager.compute
+
+ columns = (
+ "PCI Alias",
+ "Device Id",
+ "Vendor Id",
+ "Class Id",
+ "pci_pfs_configured",
+ "pci_pfs_used",
+ "pci_vfs_configured",
+ "pci_vfs_used"
+ )
+
+ data = compute_client.wrs_pci.list(parsed_args.device)
+
+ return (columns,
+ (utils.get_item_properties(
+ s, columns,
+ ) for s in data))
+
+
+class ShowPciDevices(command.ShowOne):
+ """Show details of a given PCI device."""
+
+ def get_parser(self, prog_name):
+ parser = super(ShowPciDevices, self).get_parser(prog_name)
+ parser.add_argument(
+ "device",
+ metavar="<device>",
+ help=_("Device alias or device id of the PCI device.")
+ )
+ parser.add_argument(
+ "--host",
+ metavar="<hostname>",
+ help=_("Limit matches to PCI devices from a particular host")
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ compute_client = self.app.client_manager.compute
+ deviceInfo = compute_client.wrs_pci.get(parsed_args.device,
+ parsed_args.host)
+
+ data = deviceInfo._info.copy()
+ return zip(*sorted(six.iteritems(data)))
+
diff --git a/openstackclient/compute/v2/wrs_providernets.py b/openstackclient/compute/v2/wrs_providernets.py
new file mode 100644
index 0000000..b487fb6
--- /dev/null
+++ b/openstackclient/compute/v2/wrs_providernets.py
@@ -0,0 +1,46 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# Copyright (c) 2015-2017 Wind River Systems, Inc.
+#
+#
+#
+#
+
+
+"""Compute v2 wrs_providernet action implementations"""
+
+from osc_lib.cli import parseractions
+from osc_lib.command import command
+import six
+
+from openstackclient.i18n import _
+
+
+class ShowProvidernetPci(command.ShowOne):
+ """Show details of a given provider network"""
+
+ def get_parser(self, prog_name):
+ parser = super(ShowProvidernetPci, self).get_parser(prog_name)
+ parser.add_argument(
+ "providernet",
+ metavar="<providernet_id>",
+ help=_("Id of the provider network")
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ compute_client = self.app.client_manager.compute
+
+ providernet = compute_client.wrs_providernets.get(parsed_args.providernet)
+ stats = providernet._info.copy()
+ return zip(*sorted(six.iteritems(stats)))
diff --git a/python_openstackclient.egg-info/SOURCES.txt b/python_openstackclient.egg-info/SOURCES.txt
index 82dae1c..66b9513 100644
--- a/python_openstackclient.egg-info/SOURCES.txt
+++ b/python_openstackclient.egg-info/SOURCES.txt
@@ -187,6 +187,8 @@ openstackclient/compute/v2/server_group.py
openstackclient/compute/v2/server_image.py
openstackclient/compute/v2/service.py
openstackclient/compute/v2/usage.py
+openstackclient/compute/v2/wrs_pci.py
+openstackclient/compute/v2/wrs_providernets.py
openstackclient/identity/__init__.py
openstackclient/identity/client.py
openstackclient/identity/common.py
@@ -894,4 +896,4 @@ releasenotes/source/unreleased.rst
releasenotes/source/_static/.placeholder
releasenotes/source/_templates/.placeholder
tools/fast8.sh
-tools/tox_install.sh
\ No newline at end of file
+tools/tox_install.sh
diff --git a/python_openstackclient.egg-info/entry_points.txt b/python_openstackclient.egg-info/entry_points.txt
index 99aaf5e..9a717b8 100644
--- a/python_openstackclient.egg-info/entry_points.txt
+++ b/python_openstackclient.egg-info/entry_points.txt
@@ -45,6 +45,8 @@ compute_service_list = openstackclient.compute.v2.service:ListService
compute_service_set = openstackclient.compute.v2.service:SetService
console_log_show = openstackclient.compute.v2.console:ShowConsoleLog
console_url_show = openstackclient.compute.v2.console:ShowConsoleURL
+pcidevice_list = openstackclient.compute.v2.wrs_pci:ListPciDevices
+pcidevice_show = openstackclient.compute.v2.wrs_pci:ShowPciDevices
flavor_create = openstackclient.compute.v2.flavor:CreateFlavor
flavor_delete = openstackclient.compute.v2.flavor:DeleteFlavor
flavor_list = openstackclient.compute.v2.flavor:ListFlavor
@@ -65,6 +67,7 @@ keypair_create = openstackclient.compute.v2.keypair:CreateKeypair
keypair_delete = openstackclient.compute.v2.keypair:DeleteKeypair
keypair_list = openstackclient.compute.v2.keypair:ListKeypair
keypair_show = openstackclient.compute.v2.keypair:ShowKeypair
+providernet_pci_show = openstackclient.compute.v2.wrs_providernets:ShowProvidernetPci
server_add_fixed_ip = openstackclient.compute.v2.server:AddFixedIP
server_add_floating_ip = openstackclient.compute.v2.server:AddFloatingIP
server_add_port = openstackclient.compute.v2.server:AddPort
diff --git a/setup.cfg b/setup.cfg
index 1bff735..f162417 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -71,6 +71,8 @@ openstack.compute.v2 =
flavor_show = openstackclient.compute.v2.flavor:ShowFlavor
flavor_set = openstackclient.compute.v2.flavor:SetFlavor
flavor_unset = openstackclient.compute.v2.flavor:UnsetFlavor
+ pcidevice_list = openstackclient.compute.v2.wrs_pci:ListPciDevices
+ pcidevice_show = openstackclient.compute.v2.wrs_pci:ShowPciDevices
host_list = openstackclient.compute.v2.host:ListHost
host_set = openstackclient.compute.v2.host:SetHost
host_show = openstackclient.compute.v2.host:ShowHost
@@ -85,6 +87,7 @@ openstack.compute.v2 =
keypair_delete = openstackclient.compute.v2.keypair:DeleteKeypair
keypair_list = openstackclient.compute.v2.keypair:ListKeypair
keypair_show = openstackclient.compute.v2.keypair:ShowKeypair
+ providernet_pci_show = openstackclient.compute.v2.wrs_providernets:ShowProvidernetPci
server_add_fixed_ip = openstackclient.compute.v2.server:AddFixedIP
server_add_floating_ip = openstackclient.compute.v2.server:AddFloatingIP
server_add_port = openstackclient.compute.v2.server:AddPort
--
1.8.3.1

View File

@ -1,80 +0,0 @@
From 9ab2fc77ed85aee4c6b63b0113e309136de419f0 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 1 Feb 2018 10:20:53 -0500
Subject: [PATCH 1/1] US106901 Openstack CLI Adoption:
Neutron/Cinder/Glance/Ceilometer
CI partI - OSC cli support of "--cache-raw" and "--wait" i
options for "nova image-create"
---
openstackclient/image/v2/image.py | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index c2c5c59..f5d4acf 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -12,6 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
"""Image V2 Action Implementations"""
@@ -253,6 +259,25 @@ class CreateImage(command.ShowOne):
dest=deadopt.replace('-', '_'),
help=argparse.SUPPRESS,
)
+ #WRS extension
+ parser.add_argument(
+ "--cache-raw",
+ default=False,
+ action="store_true",
+ help=_("Convert the image to RAW in the background"
+ " and store it for fast access."),
+ )
+ #WRS extension
+ parser.add_argument(
+ "--wait",
+ metavar="<WAIT>",
+ nargs='?',
+ type=int,
+ default=None,
+ const=0,
+ help=_("Wait for the convertion of the image to RAW"
+ " to finish before returning the image."),
+ )
return parser
def take_action(self, parsed_args):
@@ -302,6 +327,9 @@ class CreateImage(command.ShowOne):
kwargs['visibility'] = 'community'
if parsed_args.shared:
kwargs['visibility'] = 'shared'
+ #WRS extension
+ if parsed_args.cache_raw:
+ kwargs['cache_raw'] = 'True'
# Handle deprecated --owner option
project_arg = parsed_args.project
if parsed_args.owner:
@@ -361,6 +389,11 @@ class CreateImage(command.ShowOne):
with fp:
try:
image_client.images.upload(image.id, fp)
+ #WRS extension
+ # If cache_raw and wait options were chosen, wait until
+ # image is cached.
+ if parsed_args.cache_raw is True and parsed_args.wait is not None:
+ gc_utils.wait_for_caching(parsed_args.wait, image_client, image.id)
except Exception:
# If the upload fails for some reason attempt to remove the
# dangling queued image made by the create() call above but
--
1.8.3.1

View File

@ -1,614 +0,0 @@
From 8d106e1f1b3e536127818e98e495343e3c85f6b1 Mon Sep 17 00:00:00 2001
From: Jose Castro Leon <jose.castro.leon@cern.ch>
Date: Wed, 25 Oct 2017 15:39:44 +0200
Subject: [PATCH] Add support for endpoing filter commands
Implements the commands that allow to link and endpoint to
a project for endpoint filter management.
Implements: blueprint keystone-endpoint-filter
Change-Id: Iecf61495664fb8413d35ef69f07ea929d190d002
Signed-off-by: Kam Nasim <kam.nasim@windriver.com>
---
doc/source/cli/command-objects/endpoint.rst | 79 +++++++++++
openstackclient/identity/v3/endpoint.py | 147 ++++++++++++++++++---
.../tests/functional/identity/v3/common.py | 1 +
.../tests/functional/identity/v3/test_endpoint.py | 42 ++++++
openstackclient/tests/unit/identity/v3/fakes.py | 27 ++++
.../tests/unit/identity/v3/test_endpoint.py | 139 +++++++++++++++++++
.../keystone-endpoint-filter-e930a7b72276fa2c.yaml | 5 +
setup.cfg | 9 +-
8 files changed, 429 insertions(+), 20 deletions(-)
create mode 100644 releasenotes/notes/keystone-endpoint-filter-e930a7b72276fa2c.yaml
diff --git a/doc/source/cli/command-objects/endpoint.rst b/doc/source/cli/command-objects/endpoint.rst
index 02a75be..030947c 100644
--- a/doc/source/cli/command-objects/endpoint.rst
+++ b/doc/source/cli/command-objects/endpoint.rst
@@ -4,6 +4,34 @@ endpoint
Identity v2, v3
+endpoint add project
+--------------------
+
+Associate a project to and endpoint for endpoint filtering
+
+.. program:: endpoint add project
+.. code:: bash
+
+ openstack endpoint add project
+ [--project-domain <project-domain>]
+ <endpoint>
+ <project>
+
+.. option:: --project-domain <project-domain>
+
+ Domain the project belongs to (name or ID).
+ This can be used in case collisions between project names exist.
+
+.. _endpoint_add_project-endpoint:
+.. describe:: <endpoint>
+
+ Endpoint to associate with specified project (name or ID)
+
+.. _endpoint_add_project-project:
+.. describe:: <project>
+
+ Project to associate with specified endpoint (name or ID)
+
endpoint create
---------------
@@ -107,6 +135,8 @@ List endpoints
[--interface <interface>]
[--region <region-id>]
[--long]
+ [--endpoint <endpoint> |
+ --project <project> [--project-domain <project-domain>]]
.. option:: --service <service>
@@ -132,6 +162,55 @@ List endpoints
*Identity version 2 only*
+.. option:: --endpoint
+
+ List projects that have access to that endpoint using
+ endpoint filtering
+
+ *Identity version 3 only*
+
+.. option:: --project
+
+ List endpoints available for the project using
+ endpoint filtering
+
+ *Identity version 3 only*
+
+.. option:: --project-domain
+
+ Domain the project belongs to (name or ID).
+ This can be used in case collisions between project names exist.
+
+ *Identity version 3 only*
+
+endpoint remove project
+-----------------------
+
+Dissociate a project from an endpoint.
+
+.. program:: endpoint remove project
+.. code:: bash
+
+ openstack endpoint remove project
+ [--project-domain <project-domain>]
+ <endpoint>
+ <project>
+
+.. option:: --project-domain <project-domain>
+
+ Domain the project belongs to (name or ID).
+ This can be used in case collisions between project names exist.
+
+.. _endpoint_remove_project-endpoint:
+.. describe:: <endpoint>
+
+ Endpoint to dissociate with specified project (name or ID)
+
+.. _endpoint_remove_project-project:
+.. describe:: <project>
+
+ Project to dissociate with specified endpoint (name or ID)
+
endpoint set
------------
diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py
index 3b4dd0d..649a230 100644
--- a/openstackclient/identity/v3/endpoint.py
+++ b/openstackclient/identity/v3/endpoint.py
@@ -36,6 +36,42 @@ def get_service_name(service):
return ''
+class AddProjectToEndpoint(command.Command):
+ _description = _("Associate a project to an endpoint")
+
+ def get_parser(self, prog_name):
+ parser = super(
+ AddProjectToEndpoint, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpoint',
+ metavar='<endpoint>',
+ help=_('Endpoint to associate with '
+ 'specified project (name or ID)'),
+ )
+ parser.add_argument(
+ 'project',
+ metavar='<project>',
+ help=_('Project to associate with '
+ 'specified endpoint name or ID)'),
+ )
+ common.add_project_domain_option_to_parser(parser)
+ return parser
+
+ def take_action(self, parsed_args):
+ client = self.app.client_manager.identity
+
+ endpoint = utils.find_resource(client.endpoints,
+ parsed_args.endpoint)
+
+ project = common.find_project(client,
+ parsed_args.project,
+ parsed_args.project_domain)
+
+ client.endpoint_filter.add_endpoint_to_project(
+ project=project.id,
+ endpoint=endpoint.id)
+
+
class CreateEndpoint(command.ShowOne):
_description = _("Create new endpoint")
@@ -152,27 +188,68 @@ class ListEndpoint(command.Lister):
metavar='<region-id>',
help=_('Filter by region ID'),
)
+ list_group = parser.add_mutually_exclusive_group()
+ list_group.add_argument(
+ '--endpoint',
+ metavar='<endpoint-group>',
+ help=_('Endpoint to list filters'),
+ )
+ list_group.add_argument(
+ '--project',
+ metavar='<project>',
+ help=_('Project to list filters (name or ID)'),
+ )
+ common.add_project_domain_option_to_parser(list_group)
return parser
def take_action(self, parsed_args):
identity_client = self.app.client_manager.identity
- columns = ('ID', 'Region', 'Service Name', 'Service Type',
- 'Enabled', 'Interface', 'URL')
- kwargs = {}
- if parsed_args.service:
- service = common.find_service(identity_client, parsed_args.service)
- kwargs['service'] = service.id
- if parsed_args.interface:
- kwargs['interface'] = parsed_args.interface
- if parsed_args.region:
- kwargs['region'] = parsed_args.region
- data = identity_client.endpoints.list(**kwargs)
- service_list = identity_client.services.list()
-
- for ep in data:
- service = common.find_service_in_list(service_list, ep.service_id)
- ep.service_name = get_service_name(service)
- ep.service_type = service.type
+
+ endpoint = None
+ if parsed_args.endpoint:
+ endpoint = utils.find_resource(identity_client.endpoints,
+ parsed_args.endpoint)
+ project = None
+ if parsed_args.project:
+ project = common.find_project(identity_client,
+ parsed_args.project,
+ parsed_args.project_domain)
+
+ if endpoint:
+ columns = ('ID', 'Name')
+ data = (
+ identity_client.endpoint_filter
+ .list_projects_for_endpoint(endpoint=endpoint.id)
+ )
+ else:
+ columns = ('ID', 'Region', 'Service Name', 'Service Type',
+ 'Enabled', 'Interface', 'URL')
+ kwargs = {}
+ if parsed_args.service:
+ service = common.find_service(identity_client,
+ parsed_args.service)
+ kwargs['service'] = service.id
+ if parsed_args.interface:
+ kwargs['interface'] = parsed_args.interface
+ if parsed_args.region:
+ kwargs['region'] = parsed_args.region
+
+ if project:
+ data = (
+ identity_client.endpoint_filter
+ .list_endpoints_for_project(project=project.id)
+ )
+ else:
+ data = identity_client.endpoints.list(**kwargs)
+
+ service_list = identity_client.services.list()
+
+ for ep in data:
+ service = common.find_service_in_list(service_list,
+ ep.service_id)
+ ep.service_name = get_service_name(service)
+ ep.service_type = service.type
+
return (columns,
(utils.get_item_properties(
s, columns,
@@ -180,6 +257,42 @@ class ListEndpoint(command.Lister):
) for s in data))
+class RemoveProjectFromEndpoint(command.Command):
+ _description = _("Dissociate a project from an endpoint")
+
+ def get_parser(self, prog_name):
+ parser = super(
+ RemoveProjectFromEndpoint, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpoint',
+ metavar='<endpoint>',
+ help=_('Endpoint to dissociate from '
+ 'specified project (name or ID)'),
+ )
+ parser.add_argument(
+ 'project',
+ metavar='<project>',
+ help=_('Project to dissociate from '
+ 'specified endpoint name or ID)'),
+ )
+ common.add_project_domain_option_to_parser(parser)
+ return parser
+
+ def take_action(self, parsed_args):
+ client = self.app.client_manager.identity
+
+ endpoint = utils.find_resource(client.endpoints,
+ parsed_args.endpoint)
+
+ project = common.find_project(client,
+ parsed_args.project,
+ parsed_args.project_domain)
+
+ client.endpoint_filter.delete_endpoint_from_project(
+ project=project.id,
+ endpoint=endpoint.id)
+
+
class SetEndpoint(command.Command):
_description = _("Set endpoint properties")
diff --git a/openstackclient/tests/functional/identity/v3/common.py b/openstackclient/tests/functional/identity/v3/common.py
index 6d7896d..33cb5d8 100644
--- a/openstackclient/tests/functional/identity/v3/common.py
+++ b/openstackclient/tests/functional/identity/v3/common.py
@@ -42,6 +42,7 @@ class IdentityTests(base.TestCase):
REGION_LIST_HEADERS = ['Region', 'Parent Region', 'Description']
ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type',
'Enabled', 'Interface', 'URL']
+ ENDPOINT_LIST_PROJECT_HEADERS = ['ID', 'Name']
IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids',
'domain_id']
diff --git a/openstackclient/tests/functional/identity/v3/test_endpoint.py b/openstackclient/tests/functional/identity/v3/test_endpoint.py
index 22dc1b6..41f0b4c 100644
--- a/openstackclient/tests/functional/identity/v3/test_endpoint.py
+++ b/openstackclient/tests/functional/identity/v3/test_endpoint.py
@@ -42,6 +42,29 @@ class EndpointTests(common.IdentityTests):
items = self.parse_listing(raw_output)
self.assert_table_structure(items, self.ENDPOINT_LIST_HEADERS)
+ def test_endpoint_list_filter(self):
+ endpoint_id = self._create_dummy_endpoint(add_clean_up=False)
+ project_id = self._create_dummy_project(add_clean_up=False)
+ raw_output = self.openstack(
+ 'endpoint add project '
+ '%(endpoint_id)s '
+ '%(project_id)s' % {
+ 'project_id': project_id,
+ 'endpoint_id': endpoint_id})
+ self.assertEqual(0, len(raw_output))
+ raw_output = self.openstack(
+ 'endpoint list --endpoint %s' % endpoint_id)
+ self.assertIn(project_id, raw_output)
+ items = self.parse_listing(raw_output)
+ self.assert_table_structure(items,
+ self.ENDPOINT_LIST_PROJECT_HEADERS)
+
+ raw_output = self.openstack(
+ 'endpoint list --project %s' % project_id)
+ self.assertIn(endpoint_id, raw_output)
+ items = self.parse_listing(raw_output)
+ self.assert_table_structure(items, self.ENDPOINT_LIST_HEADERS)
+
def test_endpoint_set(self):
endpoint_id = self._create_dummy_endpoint()
new_endpoint_url = data_utils.rand_url()
@@ -65,3 +88,22 @@ class EndpointTests(common.IdentityTests):
raw_output = self.openstack('endpoint show %s' % endpoint_id)
items = self.parse_show(raw_output)
self.assert_show_fields(items, self.ENDPOINT_FIELDS)
+
+ def test_endpoint_add_remove_project(self):
+ endpoint_id = self._create_dummy_endpoint(add_clean_up=False)
+ project_id = self._create_dummy_project(add_clean_up=False)
+ raw_output = self.openstack(
+ 'endpoint add project '
+ '%(endpoint_id)s '
+ '%(project_id)s' % {
+ 'project_id': project_id,
+ 'endpoint_id': endpoint_id})
+ self.assertEqual(0, len(raw_output))
+
+ raw_output = self.openstack(
+ 'endpoint remove project '
+ '%(endpoint_id)s '
+ '%(project_id)s' % {
+ 'project_id': project_id,
+ 'endpoint_id': endpoint_id})
+ self.assertEqual(0, len(raw_output))
diff --git a/openstackclient/tests/unit/identity/v3/fakes.py b/openstackclient/tests/unit/identity/v3/fakes.py
index c7d2988..549a1aa 100644
--- a/openstackclient/tests/unit/identity/v3/fakes.py
+++ b/openstackclient/tests/unit/identity/v3/fakes.py
@@ -491,6 +491,8 @@ class FakeIdentityv3Client(object):
self.credentials.resource_class = fakes.FakeResource(None, {})
self.endpoints = mock.Mock()
self.endpoints.resource_class = fakes.FakeResource(None, {})
+ self.endpoint_filter = mock.Mock()
+ self.endpoint_filter.resource_class = fakes.FakeResource(None, {})
self.groups = mock.Mock()
self.groups.resource_class = fakes.FakeResource(None, {})
self.oauth1 = mock.Mock()
@@ -909,6 +911,31 @@ class FakeEndpoint(object):
loaded=True)
return endpoint
+ @staticmethod
+ def create_one_endpoint_filter(attrs=None):
+ """Create a fake endpoint project relationship.
+
+ :param Dictionary attrs:
+ A dictionary with all attributes of endpoint filter
+ :return:
+ A FakeResource object with project, endpoint and so on
+ """
+ attrs = attrs or {}
+
+ # Set default attribute
+ endpoint_filter_info = {
+ 'project': 'project-id-' + uuid.uuid4().hex,
+ 'endpoint': 'endpoint-id-' + uuid.uuid4().hex,
+ }
+
+ # Overwrite default attributes if there are some attributes set
+ endpoint_filter_info.update(attrs)
+
+ endpoint_filter = fakes.FakeModel(
+ copy.deepcopy(endpoint_filter_info))
+
+ return endpoint_filter
+
class FakeService(object):
"""Fake one or more service."""
diff --git a/openstackclient/tests/unit/identity/v3/test_endpoint.py b/openstackclient/tests/unit/identity/v3/test_endpoint.py
index fad53fc..bfe930d 100644
--- a/openstackclient/tests/unit/identity/v3/test_endpoint.py
+++ b/openstackclient/tests/unit/identity/v3/test_endpoint.py
@@ -22,11 +22,23 @@ class TestEndpoint(identity_fakes.TestIdentityv3):
# Get a shortcut to the EndpointManager Mock
self.endpoints_mock = self.app.client_manager.identity.endpoints
self.endpoints_mock.reset_mock()
+ self.ep_filter_mock = (
+ self.app.client_manager.identity.endpoint_filter
+ )
+ self.ep_filter_mock.reset_mock()
# Get a shortcut to the ServiceManager Mock
self.services_mock = self.app.client_manager.identity.services
self.services_mock.reset_mock()
+ # Get a shortcut to the DomainManager Mock
+ self.domains_mock = self.app.client_manager.identity.domains
+ self.domains_mock.reset_mock()
+
+ # Get a shortcut to the ProjectManager Mock
+ self.projects_mock = self.app.client_manager.identity.projects
+ self.projects_mock.reset_mock()
+
class TestEndpointCreate(TestEndpoint):
@@ -750,3 +762,130 @@ class TestEndpointShowServiceWithoutName(TestEndpointShow):
# Get the command object to test
self.cmd = endpoint.ShowEndpoint(self.app, None)
+
+
+class TestAddProjectToEndpoint(TestEndpoint):
+
+ project = identity_fakes.FakeProject.create_one_project()
+ domain = identity_fakes.FakeDomain.create_one_domain()
+ service = identity_fakes.FakeService.create_one_service()
+ endpoint = identity_fakes.FakeEndpoint.create_one_endpoint(
+ attrs={'service_id': service.id})
+
+ new_ep_filter = identity_fakes.FakeEndpoint.create_one_endpoint_filter(
+ attrs={'endpoint': endpoint.id,
+ 'project': project.id}
+ )
+
+ def setUp(self):
+ super(TestAddProjectToEndpoint, self).setUp()
+
+ # This is the return value for utils.find_resource()
+ self.endpoints_mock.get.return_value = self.endpoint
+
+ # Update the image_id in the MEMBER dict
+ self.ep_filter_mock.create.return_value = self.new_ep_filter
+ self.projects_mock.get.return_value = self.project
+ self.domains_mock.get.return_value = self.domain
+ # Get the command object to test
+ self.cmd = endpoint.AddProjectToEndpoint(self.app, None)
+
+ def test_add_project_to_endpoint_no_option(self):
+ arglist = [
+ self.endpoint.id,
+ self.project.id,
+ ]
+ verifylist = [
+ ('endpoint', self.endpoint.id),
+ ('project', self.project.id),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+ self.ep_filter_mock.add_endpoint_to_project.assert_called_with(
+ project=self.project.id,
+ endpoint=self.endpoint.id
+ )
+ self.assertIsNone(result)
+
+ def test_add_project_to_endpoint_with_option(self):
+ arglist = [
+ self.endpoint.id,
+ self.project.id,
+ '--project-domain', self.domain.id,
+ ]
+ verifylist = [
+ ('endpoint', self.endpoint.id),
+ ('project', self.project.id),
+ ('project_domain', self.domain.id),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+ self.ep_filter_mock.add_endpoint_to_project.assert_called_with(
+ project=self.project.id,
+ endpoint=self.endpoint.id
+ )
+ self.assertIsNone(result)
+
+
+class TestRemoveProjectEndpoint(TestEndpoint):
+
+ project = identity_fakes.FakeProject.create_one_project()
+ domain = identity_fakes.FakeDomain.create_one_domain()
+ service = identity_fakes.FakeService.create_one_service()
+ endpoint = identity_fakes.FakeEndpoint.create_one_endpoint(
+ attrs={'service_id': service.id})
+
+ def setUp(self):
+ super(TestRemoveProjectEndpoint, self).setUp()
+
+ # This is the return value for utils.find_resource()
+ self.endpoints_mock.get.return_value = self.endpoint
+
+ self.projects_mock.get.return_value = self.project
+ self.domains_mock.get.return_value = self.domain
+ self.ep_filter_mock.delete.return_value = None
+
+ # Get the command object to test
+ self.cmd = endpoint.RemoveProjectFromEndpoint(self.app, None)
+
+ def test_remove_project_endpoint_no_options(self):
+ arglist = [
+ self.endpoint.id,
+ self.project.id,
+ ]
+ verifylist = [
+ ('endpoint', self.endpoint.id),
+ ('project', self.project.id),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+
+ self.ep_filter_mock.delete_endpoint_from_project.assert_called_with(
+ project=self.project.id,
+ endpoint=self.endpoint.id,
+ )
+ self.assertIsNone(result)
+
+ def test_remove_project_endpoint_with_options(self):
+ arglist = [
+ self.endpoint.id,
+ self.project.id,
+ '--project-domain', self.domain.id,
+ ]
+ verifylist = [
+ ('endpoint', self.endpoint.id),
+ ('project', self.project.id),
+ ('project_domain', self.domain.id),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+
+ self.ep_filter_mock.delete_endpoint_from_project.assert_called_with(
+ project=self.project.id,
+ endpoint=self.endpoint.id,
+ )
+ self.assertIsNone(result)
diff --git a/releasenotes/notes/keystone-endpoint-filter-e930a7b72276fa2c.yaml b/releasenotes/notes/keystone-endpoint-filter-e930a7b72276fa2c.yaml
new file mode 100644
index 0000000..5a633ee
--- /dev/null
+++ b/releasenotes/notes/keystone-endpoint-filter-e930a7b72276fa2c.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Add ``endpoint add project``, ``endpoint remove project`` and ``endpoint
+ list`` commands to manage endpoint filters in identity v3.
diff --git a/setup.cfg b/setup.cfg
index 1b8e006..d60657f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -195,12 +195,15 @@ openstack.identity.v3 =
ec2_credentials_delete = openstackclient.identity.v3.ec2creds:DeleteEC2Creds
ec2_credentials_list = openstackclient.identity.v3.ec2creds:ListEC2Creds
ec2_credentials_show = openstackclient.identity.v3.ec2creds:ShowEC2Creds
- endpoint_create = openstackclient.identity.v3.endpoint:CreateEndpoint
+
+ endpoint_add_project = openstackclient.identity.v3.endpoint:AddProjectToEndpoint
+ endpoint_create = openstackclient.identity.v3.endpoint:CreateEndpoint
endpoint_delete = openstackclient.identity.v3.endpoint:DeleteEndpoint
+ endpoint_list = openstackclient.identity.v3.endpoint:ListEndpoint
+ endpoint_remove_project = openstackclient.identity.v3.endpoint:RemoveProjectFromEndpoint
endpoint_set = openstackclient.identity.v3.endpoint:SetEndpoint
endpoint_show = openstackclient.identity.v3.endpoint:ShowEndpoint
- endpoint_list = openstackclient.identity.v3.endpoint:ListEndpoint
- group_add_user = openstackclient.identity.v3.group:AddUserToGroup
+ group_add_user = openstackclient.identity.v3.group:AddUserToGroup
group_contains_user = openstackclient.identity.v3.group:CheckUserInGroup
group_create = openstackclient.identity.v3.group:CreateGroup
group_delete = openstackclient.identity.v3.group:DeleteGroup
--
1.8.3.1

View File

@ -1,273 +0,0 @@
From 8fe2869469d3b853e24140e4ffb487d672232b1b Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 5 Jan 2018 15:01:24 -0500
Subject: [PATCH] US101470 OSC equivalence of nova cli with WRS extension
CI part2
---
openstackclient/compute/v2/server.py | 37 +++++++++++
openstackclient/compute/v2/server_group.py | 99 ++++++++++++++++++++++++++++--
setup.cfg | 2 +
3 files changed, 132 insertions(+), 6 deletions(-)
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 151c678..c7ffab9 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -12,6 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
+
"""Compute v2 Server action implementations"""
@@ -1714,6 +1721,36 @@ class ResumeServer(command.Command):
).resume()
+# WRS:extension
+class ScaleServer(command.Command):
+ _description = _("Scale server properties")
+
+ def get_parser(self, prog_name):
+ parser = super(ScaleServer, self).get_parser(prog_name)
+ parser.add_argument(
+ 'server',
+ metavar='<server>',
+ help=_('Name or ID of server'),
+ )
+ parser.add_argument(
+ 'resource',
+ metavar='<resource>',
+ help=_('Resource to scale. Currently only "cpu"'),
+ )
+ parser.add_argument(
+ 'direction',
+ metavar='<direction>',
+ help=_('Direction to scale ("up" or "down")'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ compute_client = self.app.client_manager.compute
+ compute_client.servers.scale(parsed_args.server,
+ parsed_args.resource,
+ parsed_args.direction)
+
+
class SetServer(command.Command):
_description = _("Set server properties")
diff --git a/openstackclient/compute/v2/server_group.py b/openstackclient/compute/v2/server_group.py
index c6e2161..551ed8e 100644
--- a/openstackclient/compute/v2/server_group.py
+++ b/openstackclient/compute/v2/server_group.py
@@ -12,6 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
"""Compute v2 Server Group action implementations"""
@@ -22,6 +28,7 @@ from osc_lib import exceptions
from osc_lib import utils
from openstackclient.i18n import _
+from novaclient import api_versions
LOG = logging.getLogger(__name__)
@@ -35,12 +42,40 @@ _formatters = {
def _get_columns(info):
columns = list(info.keys())
- if 'metadata' in columns:
- # NOTE(RuiChen): The metadata of server group is always empty since API
- # compatible, so hide it in order to avoid confusion.
- columns.remove('metadata')
return tuple(sorted(columns))
+#WRS:extension
+def _extract_metadata(args):
+ metadata = {}
+ for server_group in args.metadata:
+ for metadatum in server_group:
+ if metadatum.find('=') > -1:
+ (key, value) = metadatum.split('=', 1)
+ else:
+ key = metadatum
+ value = None
+ metadata[key] = value
+ return metadata
+
+# WRS:extension - type checking for key-value pair
+# returns text instead of tuple like above
+def _key_value_type(text):
+ try:
+ (k, v) = text.split('=', 1)
+ return text
+ except ValueError:
+ msg = "%r is not in the format of key=value" % text
+ raise argparse.ArgumentTypeError(msg)
+
+
+# WRS:extension - type checking for CSV key-value pairs
+def _csv_key_value_type(text):
+ try:
+ return map(_key_value_type, text.split(','))
+ except Exception as e:
+ raise exceptions.CommandError(
+ "Invalid csv key-value argument '%s'. %s" % (text, unicode(e)))
+
class CreateServerGroup(command.ShowOne):
_description = _("Create a new server group.")
@@ -52,6 +87,15 @@ class CreateServerGroup(command.ShowOne):
metavar='<name>',
help=_("New server group name")
)
+ # WRS:extension
+ parser.add_argument(
+ '--metadata',
+ metavar='<key1=value1[,key2=value2...>',
+ action='append',
+ default=[],
+ type=_csv_key_value_type,
+ help=_("Metadata for this server group")
+ )
parser.add_argument(
'--policy',
metavar='<policy>',
@@ -66,17 +110,21 @@ class CreateServerGroup(command.ShowOne):
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
info = {}
+
+ #WRS:extension
+ meta = _extract_metadata(parsed_args)
+ compute_client.api_version = api_versions.APIVersion("2.53")
server_group = compute_client.server_groups.create(
name=parsed_args.name,
+ metadata=meta,
policies=[parsed_args.policy])
- info.update(server_group._info)
+ info.update(server_group._info)
columns = _get_columns(info)
data = utils.get_dict_properties(info, columns,
formatters=_formatters)
return columns, data
-
class DeleteServerGroup(command.Command):
_description = _("Delete existing server group(s).")
@@ -133,8 +181,13 @@ class ListServerGroup(command.Lister):
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
+
+ #WRS:extension
+ compute_client.api_version = api_versions.APIVersion("2.53")
+
data = compute_client.server_groups.list(parsed_args.all_projects)
+ #WRS:extension list project_id, user_id fields and metadata fields
if parsed_args.long:
column_headers = columns = (
'ID',
@@ -143,12 +196,14 @@ class ListServerGroup(command.Lister):
'Members',
'Project Id',
'User Id',
+ 'Metadata',
)
else:
column_headers = columns = (
'ID',
'Name',
'Policies',
+ 'Metadata',
)
return (column_headers,
@@ -175,11 +230,43 @@ class ShowServerGroup(command.ShowOne):
def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
+ #WRS:extension
+ compute_client.api_version = api_versions.APIVersion("2.53")
+
group = utils.find_resource(compute_client.server_groups,
parsed_args.server_group)
+
info = {}
info.update(group._info)
columns = _get_columns(info)
data = utils.get_dict_properties(info, columns,
formatters=_formatters)
return columns, data
+
+#WRS:extension
+class SetServerGroupMetadata(command.Command):
+ _description = _("Set metadata of a server group")
+
+ def get_parser(self, prog_name):
+ parser = super(SetServerGroupMetadata, self).get_parser(prog_name)
+ parser.add_argument(
+ 'id',
+ metavar='<id>',
+ help=_("Unique ID of the server group")
+ )
+ parser.add_argument(
+ 'metadata',
+ metavar='<key1=value1[,key2=value2...]>',
+ action='append',
+ default=[],
+ type=_csv_key_value_type,
+ help=_("Metadata to set/unset")
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ compute_client = self.app.client_manager.compute
+ metadata = _extract_metadata(parsed_args)
+ compute_client.api_version = api_versions.APIVersion("2.53")
+ compute_client.server_groups.set_metadata(parsed_args.id, metadata)
+
diff --git a/setup.cfg b/setup.cfg
index f162417..627ff87 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -110,6 +110,7 @@ openstack.compute.v2 =
server_resize = openstackclient.compute.v2.server:ResizeServer
server_restore = openstackclient.compute.v2.server:RestoreServer
server_resume = openstackclient.compute.v2.server:ResumeServer
+ server_scale = openstackclient.compute.v2.server:ScaleServer
server_set = openstackclient.compute.v2.server:SetServer
server_shelve = openstackclient.compute.v2.server:ShelveServer
server_show = openstackclient.compute.v2.server:ShowServer
@@ -129,6 +130,7 @@ openstack.compute.v2 =
server_group_create = openstackclient.compute.v2.server_group:CreateServerGroup
server_group_delete = openstackclient.compute.v2.server_group:DeleteServerGroup
server_group_list = openstackclient.compute.v2.server_group:ListServerGroup
+ server_group_set_metadata = openstackclient.compute.v2.server_group:SetServerGroupMetadata
server_group_show = openstackclient.compute.v2.server_group:ShowServerGroup
server_image_create = openstackclient.compute.v2.server_image:CreateServerImage
usage_list = openstackclient.compute.v2.usage:ListUsage
--
1.8.3.1

View File

@ -1,330 +0,0 @@
From c4f2db9901b54217e1737987a19a8b48209f40ab Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 5 Feb 2018 14:06:32 -0500
Subject: [PATCH 1/1] US106901 Openstack CLI Adoption: Cinder/Glance/Ceilometer
CI partII: OSC equivalence of cinder cli with WRS extension
---
openstackclient/volume/v1/volume.py | 58 ++++++++++++++++++++++++++++
openstackclient/volume/v1/volume_snapshot.py | 26 +++++++++++++
openstackclient/volume/v2/volume.py | 57 +++++++++++++++++++++++++++
openstackclient/volume/v2/volume_snapshot.py | 27 +++++++++++++
setup.cfg | 11 +++++-
5 files changed, 178 insertions(+), 1 deletion(-)
diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py
index b29429e..85caf3e 100644
--- a/openstackclient/volume/v1/volume.py
+++ b/openstackclient/volume/v1/volume.py
@@ -12,6 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
+
"""Volume v1 Volume action implementations"""
@@ -25,6 +32,7 @@ from osc_lib import utils
import six
from openstackclient.i18n import _
+from cinderclient import utils as cinder_utils
LOG = logging.getLogger(__name__)
@@ -624,3 +632,53 @@ class UnsetVolume(command.Command):
volume.id,
parsed_args.property,
)
+
+
+# WRS extension
+class ExportVolume(command.Command):
+ _description = _("Export volume to a file.")
+
+ def get_parser(self, prog_name):
+ parser = super(ExportVolume, self).get_parser(prog_name)
+ parser.add_argument(
+ 'volume',
+ metavar='<volume>',
+ help=_('Name or ID of the volume to export'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ volume_client = self.app.client_manager.volume
+ volume = utils.find_resource(
+ volume_client.volumes, parsed_args.volume)
+ volume_client.volumes.export(volume)
+
+
+# WRS extension
+class ImportVolume(command.Command):
+ _description = _("Import a volume from a file.")
+
+ def get_parser(self, prog_name):
+ parser = super(ImportVolume, self).get_parser(prog_name)
+ parser.add_argument(
+ 'file_name',
+ metavar='<file-name>',
+ help=_('Name of the file to import'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ volume_client = self.app.client_manager.volume
+
+ # Parse the volume ID from the filename which is in this format:
+ # volume-<id>-<timestamp>.tgz
+ if(parsed_args.file_name.find("volume-") != 0 or
+ parsed_args.file_name.rfind(".tgz") == -1 or
+ len(parsed_args.file_name) < 28):
+ raise exceptions.CommandError(
+ "Invalid filename - volume files must have the following format: "
+ "volume-<id>-<timestamp>.tgz")
+
+ volume_id = parsed_args.file_name[7:-20]
+ volume = cinder_utils.find_volume(volume_client, volume_id)
+ volume_client.volumes.import_volume(volume, parsed_args.file_name)
diff --git a/openstackclient/volume/v1/volume_snapshot.py b/openstackclient/volume/v1/volume_snapshot.py
index 3e83da5..a4d44a8 100644
--- a/openstackclient/volume/v1/volume_snapshot.py
+++ b/openstackclient/volume/v1/volume_snapshot.py
@@ -12,6 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
"""Volume v1 Snapshot action implementations"""
@@ -25,6 +31,7 @@ from osc_lib import utils
import six
from openstackclient.i18n import _
+from cinderclient import utils as cinder_utils
LOG = logging.getLogger(__name__)
@@ -352,3 +359,22 @@ class UnsetVolumeSnapshot(command.Command):
snapshot.id,
parsed_args.property,
)
+
+# WRS extension
+class ExportVolumeSnapshot(command.Command):
+ _description = _("Export a snapshot to a file.")
+
+ def get_parser(self, prog_name):
+ parser = super(ExportVolumeSnapshot, self).get_parser(prog_name)
+ parser.add_argument(
+ 'snapshot',
+ metavar='<snapshot>',
+ help=_('Name or ID of the snapshot to export'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ volume_client = self.app.client_manager.volume
+ snapshot = cinder_utils.find_resource(
+ volume_client.volume_snapshots, parsed_args.snapshot)
+ volume_client.volume_snapshots.export(snapshot)
diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py
index 61f846b..c2ea7a4 100644
--- a/openstackclient/volume/v2/volume.py
+++ b/openstackclient/volume/v2/volume.py
@@ -11,6 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
"""Volume V2 Volume action implementations"""
@@ -25,6 +31,7 @@ import six
from openstackclient.i18n import _
from openstackclient.identity import common as identity_common
+from cinderclient import utils as cinder_utils
LOG = logging.getLogger(__name__)
@@ -784,3 +791,53 @@ class UnsetVolume(command.Command):
if result > 0:
raise exceptions.CommandError(_("One or more of the "
"unset operations failed"))
+
+
+# WRS extension
+class ExportVolume(command.Command):
+ _description = _("Export volume to a file.")
+
+ def get_parser(self, prog_name):
+ parser = super(ExportVolume, self).get_parser(prog_name)
+ parser.add_argument(
+ 'volume',
+ metavar='<volume>',
+ help=_('Name or ID of the volume to export'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ volume_client = self.app.client_manager.volume
+ volume = cinder_utils.find_resource(
+ volume_client.volumes, parsed_args.volume)
+ volume_client.volumes.export(volume)
+
+
+# WRS extension
+class ImportVolume(command.Command):
+ _description = _("Import a volume from a file.")
+
+ def get_parser(self, prog_name):
+ parser = super(ImportVolume, self).get_parser(prog_name)
+ parser.add_argument(
+ 'file_name',
+ metavar='<file-name>',
+ help=_('Name of the file to import'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ volume_client = self.app.client_manager.volume
+
+ # Parse the volume ID from the filename which is in this format:
+ # volume-<id>-<timestamp>.tgz
+ if(parsed_args.file_name.find("volume-") != 0 or
+ parsed_args.file_name.rfind(".tgz") == -1 or
+ len(parsed_args.file_name) < 28):
+ raise exceptions.CommandError(
+ "Invalid filename - volume files must have the following format: "
+ "volume-<id>-<timestamp>.tgz")
+
+ volume_id = parsed_args.file_name[7:-20]
+ volume = cinder_utils.find_volume(volume_client, volume_id)
+ volume_client.volumes.import_volume(volume, parsed_args.file_name)
diff --git a/openstackclient/volume/v2/volume_snapshot.py b/openstackclient/volume/v2/volume_snapshot.py
index fe96941..704ef75 100644
--- a/openstackclient/volume/v2/volume_snapshot.py
+++ b/openstackclient/volume/v2/volume_snapshot.py
@@ -11,6 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
+# SPDX-License-Identifier: Apache-2.0
+#
+#
+#
+#
"""Volume v2 snapshot action implementations"""
@@ -25,6 +31,7 @@ import six
from openstackclient.i18n import _
from openstackclient.identity import common as identity_common
+from cinderclient import utils as cinder_utils
LOG = logging.getLogger(__name__)
@@ -437,3 +444,23 @@ class UnsetVolumeSnapshot(command.Command):
snapshot.id,
parsed_args.property,
)
+
+
+# WRS extension
+class ExportVolumeSnapshot(command.Command):
+ _description = _("Export a snapshot to a file.")
+
+ def get_parser(self, prog_name):
+ parser = super(ExportVolumeSnapshot, self).get_parser(prog_name)
+ parser.add_argument(
+ 'snapshot',
+ metavar='<snapshot>',
+ help=_('Name or ID of the snapshot to export'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ volume_client = self.app.client_manager.volume
+ snapshot = cinder_utils.find_resource(
+ volume_client.volume_snapshots, parsed_args.snapshot)
+ volume_client.volume_snapshots.export(snapshot)
diff --git a/setup.cfg b/setup.cfg
index 627ff87..11f7261 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -468,6 +468,8 @@ openstack.volume.v1 =
snapshot_unset = openstackclient.volume.v1.snapshot:UnsetSnapshot
volume_create = openstackclient.volume.v1.volume:CreateVolume
volume_delete = openstackclient.volume.v1.volume:DeleteVolume
+ volume_export = openstackclient.volume.v1.volume:ExportVolume
+ volume_import = openstackclient.volume.v1.volume:ImportVolume
volume_list = openstackclient.volume.v1.volume:ListVolume
volume_migrate = openstackclient.volume.v1.volume:MigrateVolume
volume_set = openstackclient.volume.v1.volume:SetVolume
@@ -480,6 +482,7 @@ openstack.volume.v1 =
volume_backup_show = openstackclient.volume.v1.backup:ShowVolumeBackup
volume_snapshot_create = openstackclient.volume.v1.volume_snapshot:CreateVolumeSnapshot
volume_snapshot_delete = openstackclient.volume.v1.volume_snapshot:DeleteVolumeSnapshot
+ volume_snapshot_export = openstackclient.volume.v1.volume_snapshot:ExportVolumeSnapshot
volume_snapshot_list = openstackclient.volume.v1.volume_snapshot:ListVolumeSnapshot
volume_snapshot_set = openstackclient.volume.v1.volume_snapshot:SetVolumeSnapshot
volume_snapshot_show = openstackclient.volume.v1.volume_snapshot:ShowVolumeSnapshot
@@ -529,7 +532,9 @@ openstack.volume.v2 =
snapshot_show = openstackclient.volume.v2.snapshot:ShowSnapshot
snapshot_unset = openstackclient.volume.v2.snapshot:UnsetSnapshot
volume_create = openstackclient.volume.v2.volume:CreateVolume
- volume_delete = openstackclient.volume.v2.volume:DeleteVolume
+ volume_delete = openstackclient.volume.v2.volume:DeleteVolume
+ volume_export = openstackclient.volume.v2.volume:ExportVolume
+ volume_import = openstackclient.volume.v2.volume:ImportVolume
volume_list = openstackclient.volume.v2.volume:ListVolume
volume_migrate = openstackclient.volume.v2.volume:MigrateVolume
volume_set = openstackclient.volume.v2.volume:SetVolume
@@ -545,6 +550,7 @@ openstack.volume.v2 =
volume_host_set = openstackclient.volume.v2.volume_host:SetVolumeHost
volume_snapshot_create = openstackclient.volume.v2.volume_snapshot:CreateVolumeSnapshot
volume_snapshot_delete = openstackclient.volume.v2.volume_snapshot:DeleteVolumeSnapshot
+ volume_snapshot_export = openstackclient.volume.v2.volume_snapshot:ExportVolumeSnapshot
volume_snapshot_list = openstackclient.volume.v2.volume_snapshot:ListVolumeSnapshot
volume_snapshot_set = openstackclient.volume.v2.volume_snapshot:SetVolumeSnapshot
volume_snapshot_show = openstackclient.volume.v2.volume_snapshot:ShowVolumeSnapshot
@@ -584,6 +590,8 @@ openstack.volume.v3 =
consistency_group_snapshot_show = openstackclient.volume.v2.consistency_group_snapshot:ShowConsistencyGroupSnapshot
volume_create = openstackclient.volume.v2.volume:CreateVolume
volume_delete = openstackclient.volume.v2.volume:DeleteVolume
+ volume_export = openstackclient.volume.v2.volume:ExportVolume
+ volume_import = openstackclient.volume.v2.volume:ImportVolume
volume_list = openstackclient.volume.v2.volume:ListVolume
volume_migrate = openstackclient.volume.v2.volume:MigrateVolume
volume_set = openstackclient.volume.v2.volume:SetVolume
@@ -598,6 +606,7 @@ openstack.volume.v3 =
volume_host_set = openstackclient.volume.v2.volume_host:SetVolumeHost
volume_snapshot_create = openstackclient.volume.v2.volume_snapshot:CreateVolumeSnapshot
volume_snapshot_delete = openstackclient.volume.v2.volume_snapshot:DeleteVolumeSnapshot
+ volume_snapshot_export = openstackclient.volume.v2.volume_snapshot:ExportVolumeSnapshot
volume_snapshot_list = openstackclient.volume.v2.volume_snapshot:ListVolumeSnapshot
volume_snapshot_set = openstackclient.volume.v2.volume_snapshot:SetVolumeSnapshot
volume_snapshot_show = openstackclient.volume.v2.volume_snapshot:ShowVolumeSnapshot
--
1.8.3.1

View File

@ -1,472 +0,0 @@
From d800b1821e4aa3e3e49173be6c5b1ea370200d96 Mon Sep 17 00:00:00 2001
From: Jose Castro Leon <jose.castro.leon@cern.ch>
Date: Wed, 25 Oct 2017 15:39:44 +0200
Subject: [PATCH] Add support for endpoint group commands
Implements the commands for endpoint group filter management.
Includes the CRUD management of the endpoint groups and the
association management between them and the projects that are
using this method.
Implements: blueprint keystone-endpoint-filter
Change-Id: I4265f7f8598d028191e90d76781b7b6ece6fef64
Signed-off-by: Kam Nasim <kam.nasim@windriver.com>
---
doc/source/cli/command-objects/endpoint_group.rst | 28 ++
doc/source/cli/commands.rst | 1 +
openstackclient/identity/v3/endpoint_group.py | 324 +++++++++++++++++++++
openstackclient/tests/unit/identity/v3/fakes.py | 16 +
.../keystone-endpoint-group-0c55debbb66844f2.yaml | 7 +
setup.cfg | 9 +
6 files changed, 385 insertions(+)
create mode 100644 doc/source/cli/command-objects/endpoint_group.rst
create mode 100644 openstackclient/identity/v3/endpoint_group.py
create mode 100644 releasenotes/notes/keystone-endpoint-group-0c55debbb66844f2.yaml
diff --git a/doc/source/cli/command-objects/endpoint_group.rst b/doc/source/cli/command-objects/endpoint_group.rst
new file mode 100644
index 0000000..ccfe5f6
--- /dev/null
+++ b/doc/source/cli/command-objects/endpoint_group.rst
@@ -0,0 +1,28 @@
+==============
+endpoint group
+==============
+
+A **endpoint group** is used to create groups of endpoints that then
+can be used to filter the endpoints that are available to a project.
+Applicable to Identity v3
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group add project
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group create
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group delete
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group list
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group remove project
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group set
+
+.. autoprogram-cliff:: openstack.identity.v3
+ :command: endpoint group show
diff --git a/doc/source/cli/commands.rst b/doc/source/cli/commands.rst
index 5a7977e..50a6f6e 100644
--- a/doc/source/cli/commands.rst
+++ b/doc/source/cli/commands.rst
@@ -91,6 +91,7 @@ referring to both Compute and Volume quotas.
* ``domain``: (**Identity**) a grouping of projects
* ``ec2 credentials``: (**Identity**) AWS EC2-compatible credentials
* ``endpoint``: (**Identity**) the base URL used to contact a specific service
+* ``endpoint group``: (**Identity**) group endpoints to be used as filters
* ``extension``: (**Compute**, **Identity**, **Network**, **Volume**) OpenStack server API extensions
* ``federation protocol``: (**Identity**) the underlying protocol used while federating identities
* ``flavor``: (**Compute**) predefined server configurations: ram, root disk and so on
diff --git a/openstackclient/identity/v3/endpoint_group.py b/openstackclient/identity/v3/endpoint_group.py
new file mode 100644
index 0000000..e254973
--- /dev/null
+++ b/openstackclient/identity/v3/endpoint_group.py
@@ -0,0 +1,324 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+"""Identity v3 Endpoint Group action implementations"""
+
+import json
+import logging
+
+from osc_lib.command import command
+from osc_lib import exceptions
+from osc_lib import utils
+import six
+
+from openstackclient.i18n import _
+from openstackclient.identity import common
+
+
+LOG = logging.getLogger(__name__)
+
+
+class _FiltersReader(object):
+ _description = _("Helper class capable of reading filters from files")
+
+ def _read_filters(self, path):
+ """Read and parse rules from path
+
+ Expect the file to contain a valid JSON structure.
+
+ :param path: path to the file
+ :return: loaded and valid dictionary with filters
+ :raises exception.CommandError: In case the file cannot be
+ accessed or the content is not a valid JSON.
+
+ Example of the content of the file:
+ {
+ "interface": "admin",
+ "service_id": "1b501a"
+ }
+ """
+ blob = utils.read_blob_file_contents(path)
+ try:
+ rules = json.loads(blob)
+ except ValueError as e:
+ msg = _("An error occurred when reading filters from file "
+ "%(path)s: %(error)s") % {"path": path, "error": e}
+ raise exceptions.CommandError(msg)
+ else:
+ return rules
+
+
+class AddProjectToEndpointGroup(command.Command):
+ _description = _("Add a project to an endpoint group")
+
+ def get_parser(self, prog_name):
+ parser = super(
+ AddProjectToEndpointGroup, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpointgroup',
+ metavar='<endpoint-group>',
+ help=_('Endpoint group (name or ID)'),
+ )
+ parser.add_argument(
+ 'project',
+ metavar='<project>',
+ help=_('Project to associate (name or ID)'),
+ )
+ common.add_project_domain_option_to_parser(parser)
+ return parser
+
+ def take_action(self, parsed_args):
+ client = self.app.client_manager.identity
+
+ endpointgroup = utils.find_resource(client.endpoint_groups,
+ parsed_args.endpointgroup)
+
+ project = common.find_project(client,
+ parsed_args.project,
+ parsed_args.project_domain)
+
+ client.endpoint_filter.add_endpoint_group_to_project(
+ endpoint_group=endpointgroup.id,
+ project=project.id)
+
+
+class CreateEndpointGroup(command.ShowOne, _FiltersReader):
+ _description = _("Create new endpoint group")
+
+ def get_parser(self, prog_name):
+ parser = super(CreateEndpointGroup, self).get_parser(prog_name)
+ parser.add_argument(
+ 'name',
+ metavar='<name>',
+ help=_('Name of the endpoint group'),
+ )
+ parser.add_argument(
+ 'filters',
+ metavar='<filename>',
+ help=_('Filename that contains a new set of filters'),
+ )
+ parser.add_argument(
+ '--description',
+ help=_('Description of the endpoint group'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ identity_client = self.app.client_manager.identity
+
+ filters = None
+ if parsed_args.filters:
+ filters = self._read_filters(parsed_args.filters)
+
+ endpoint_group = identity_client.endpoint_groups.create(
+ name=parsed_args.name,
+ filters=filters,
+ description=parsed_args.description
+ )
+
+ info = {}
+ endpoint_group._info.pop('links')
+ info.update(endpoint_group._info)
+ return zip(*sorted(six.iteritems(info)))
+
+
+class DeleteEndpointGroup(command.Command):
+ _description = _("Delete endpoint group(s)")
+
+ def get_parser(self, prog_name):
+ parser = super(DeleteEndpointGroup, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpointgroup',
+ metavar='<endpoint-group>',
+ nargs='+',
+ help=_('Endpoint group(s) to delete (name or ID)'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ identity_client = self.app.client_manager.identity
+ result = 0
+ for i in parsed_args.endpointgroup:
+ try:
+ endpoint_id = utils.find_resource(
+ identity_client.endpoint_groups, i).id
+ identity_client.endpoint_groups.delete(endpoint_id)
+ except Exception as e:
+ result += 1
+ LOG.error(_("Failed to delete endpoint group with "
+ "ID '%(endpointgroup)s': %(e)s"),
+ {'endpointgroup': i, 'e': e})
+
+ if result > 0:
+ total = len(parsed_args.endpointgroup)
+ msg = (_("%(result)s of %(total)s endpointgroups failed "
+ "to delete.") % {'result': result, 'total': total})
+ raise exceptions.CommandError(msg)
+
+
+class ListEndpointGroup(command.Lister):
+ _description = _("List endpoint groups")
+
+ def get_parser(self, prog_name):
+ parser = super(ListEndpointGroup, self).get_parser(prog_name)
+ list_group = parser.add_mutually_exclusive_group()
+ list_group.add_argument(
+ '--endpointgroup',
+ metavar='<endpoint-group>',
+ help=_('Endpoint Group (name or ID)'),
+ )
+ list_group.add_argument(
+ '--project',
+ metavar='<project>',
+ help=_('Project (name or ID)'),
+ )
+ parser.add_argument(
+ '--domain',
+ metavar='<domain>',
+ help=_('Domain owning <project> (name or ID)'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ client = self.app.client_manager.identity
+
+ endpointgroup = None
+ if parsed_args.endpointgroup:
+ endpointgroup = utils.find_resource(client.endpoint_groups,
+ parsed_args.endpointgroup)
+ project = None
+ if parsed_args.project:
+ project = common.find_project(client,
+ parsed_args.project,
+ parsed_args.domain)
+
+ if endpointgroup:
+ # List projects associated to the endpoint group
+ columns = ('ID', 'Name')
+ data = client.endpoint_filter.list_projects_for_endpoint_group(
+ endpoint_group=endpointgroup.id)
+ elif project:
+ columns = ('ID', 'Name')
+ data = client.endpoint_filter.list_endpoint_groups_for_project(
+ project=project.id)
+ else:
+ columns = ('ID', 'Name', 'Description')
+ data = client.endpoint_groups.list()
+
+ return (columns,
+ (utils.get_item_properties(
+ s, columns,
+ formatters={},
+ ) for s in data))
+
+
+class RemoveProjectFromEndpointGroup(command.Command):
+ _description = _("Remove project from endpoint group")
+
+ def get_parser(self, prog_name):
+ parser = super(
+ RemoveProjectFromEndpointGroup, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpointgroup',
+ metavar='<endpoint-group>',
+ help=_('Endpoint group (name or ID)'),
+ )
+ parser.add_argument(
+ 'project',
+ metavar='<project>',
+ help=_('Project to remove (name or ID)'),
+ )
+ common.add_project_domain_option_to_parser(parser)
+ return parser
+
+ def take_action(self, parsed_args):
+ client = self.app.client_manager.identity
+
+ endpointgroup = utils.find_resource(client.endpoint_groups,
+ parsed_args.endpointgroup)
+
+ project = common.find_project(client,
+ parsed_args.project,
+ parsed_args.project_domain)
+
+ client.endpoint_filter.delete_endpoint_group_to_project(
+ endpoint_group=endpointgroup.id,
+ project=project.id)
+
+
+class SetEndpointGroup(command.Command, _FiltersReader):
+ _description = _("Set endpoint group properties")
+
+ def get_parser(self, prog_name):
+ parser = super(SetEndpointGroup, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpointgroup',
+ metavar='<endpoint-group>',
+ help=_('Endpoint Group to modify (name or ID)'),
+ )
+ parser.add_argument(
+ '--name',
+ metavar='<name>',
+ help=_('New enpoint group name'),
+ )
+ parser.add_argument(
+ '--filters',
+ metavar='<filename>',
+ help=_('Filename that contains a new set of filters'),
+ )
+ parser.add_argument(
+ '--description',
+ metavar='<description>',
+ default='',
+ help=_('New endpoint group description'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ identity_client = self.app.client_manager.identity
+ endpointgroup = utils.find_resource(identity_client.endpoint_groups,
+ parsed_args.endpointgroup)
+
+ filters = None
+ if parsed_args.filters:
+ filters = self._read_filters(parsed_args.filters)
+
+ identity_client.endpoint_groups.update(
+ endpointgroup.id,
+ name=parsed_args.name,
+ filters=filters,
+ description=parsed_args.description
+ )
+
+
+class ShowEndpointGroup(command.ShowOne):
+ _description = _("Display endpoint group details")
+
+ def get_parser(self, prog_name):
+ parser = super(ShowEndpointGroup, self).get_parser(prog_name)
+ parser.add_argument(
+ 'endpointgroup',
+ metavar='<endpointgroup>',
+ help=_('Endpoint group (name or ID)'),
+ )
+ return parser
+
+ def take_action(self, parsed_args):
+ identity_client = self.app.client_manager.identity
+ endpoint_group = utils.find_resource(identity_client.endpoint_groups,
+ parsed_args.endpointgroup)
+
+ info = {}
+ endpoint_group._info.pop('links')
+ info.update(endpoint_group._info)
+ return zip(*sorted(six.iteritems(info)))
diff --git a/openstackclient/tests/unit/identity/v3/fakes.py b/openstackclient/tests/unit/identity/v3/fakes.py
index 549a1aa..76431b1 100644
--- a/openstackclient/tests/unit/identity/v3/fakes.py
+++ b/openstackclient/tests/unit/identity/v3/fakes.py
@@ -221,6 +221,20 @@ ENDPOINT = {
'links': base_url + 'endpoints/' + endpoint_id,
}
+endpoint_group_id = 'eg-123'
+endpoint_group_description = 'eg 123 description'
+endpoint_group_filters = {
+ 'service_id': service_id,
+ 'region_id': endpoint_region,
+}
+
+ENDPOINT_GROUP = {
+ 'id': endpoint_group_id,
+ 'filters': endpoint_group_filters,
+ 'description': endpoint_group_description,
+ 'links': base_url + 'endpoint_groups/' + endpoint_group_id,
+}
+
user_id = 'bbbbbbb-aaaa-aaaa-aaaa-bbbbbbbaaaa'
user_name = 'paul'
user_description = 'Sir Paul'
@@ -493,6 +507,8 @@ class FakeIdentityv3Client(object):
self.endpoints.resource_class = fakes.FakeResource(None, {})
self.endpoint_filter = mock.Mock()
self.endpoint_filter.resource_class = fakes.FakeResource(None, {})
+ self.endpoint_groups = mock.Mock()
+ self.endpoint_groups.resource_class = fakes.FakeResource(None, {})
self.groups = mock.Mock()
self.groups.resource_class = fakes.FakeResource(None, {})
self.oauth1 = mock.Mock()
diff --git a/releasenotes/notes/keystone-endpoint-group-0c55debbb66844f2.yaml b/releasenotes/notes/keystone-endpoint-group-0c55debbb66844f2.yaml
new file mode 100644
index 0000000..dc3c5be
--- /dev/null
+++ b/releasenotes/notes/keystone-endpoint-group-0c55debbb66844f2.yaml
@@ -0,0 +1,7 @@
+---
+features:
+ - |
+ Add endpoint group commands: ``endpoint group add project``, ``endpoint group create``,
+ ``endpoint group delete``, ``endpoint group list``, ``endpoint group remove project``,
+ ``endpoint group set`` and ``endpoint group show``.
+ [Blueprint `keystone-endpoint-filter <https://blueprints.launchpad.net/python-openstackclient/+spec/keystone-endpoint-filter>`_]
diff --git a/setup.cfg b/setup.cfg
index 5f9c04a..d87b387 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -202,6 +202,15 @@ openstack.identity.v3 =
endpoint_remove_project = openstackclient.identity.v3.endpoint:RemoveProjectFromEndpoint
endpoint_set = openstackclient.identity.v3.endpoint:SetEndpoint
endpoint_show = openstackclient.identity.v3.endpoint:ShowEndpoint
+
+ endpoint_group_add_project = openstackclient.identity.v3.endpoint_group:AddProjectToEndpointGroup
+ endpoint_group_create = openstackclient.identity.v3.endpoint_group:CreateEndpointGroup
+ endpoint_group_delete = openstackclient.identity.v3.endpoint_group:DeleteEndpointGroup
+ endpoint_group_list = openstackclient.identity.v3.endpoint_group:ListEndpointGroup
+ endpoint_group_remove_project = openstackclient.identity.v3.endpoint_group:RemoveProjectFromEndpointGroup
+ endpoint_group_set = openstackclient.identity.v3.endpoint_group:SetEndpointGroup
+ endpoint_group_show = openstackclient.identity.v3.endpoint_group:ShowEndpointGroup
+
group_add_user = openstackclient.identity.v3.group:AddUserToGroup
group_contains_user = openstackclient.identity.v3.group:CheckUserInGroup
group_create = openstackclient.identity.v3.group:CreateGroup
--
1.8.3.1

View File

@ -1,42 +0,0 @@
From a2f2306ae12c65d0758a63781ace5d3e6cf0df7f Mon Sep 17 00:00:00 2001
From: jmckenna <jason.mckenna@windriver.com>
Date: Fri, 6 Oct 2017 10:40:12 -0400
Subject: [PATCH] [PATCH] CGTS-7814: warning only when the admin password
change accepted
Currently admin password change CLI warning coming even when new
Password Change is not accepted. The patch fixed this by moving
the warning from keystoneclient to openstackclienti, after the
password update call.
diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py
index 201d217..e94ec1f 100644
--- a/openstackclient/identity/v3/user.py
+++ b/openstackclient/identity/v3/user.py
@@ -392,7 +392,7 @@ class SetUser(command.Command):
kwargs['enabled'] = False
identity_client.users.update(user.id, **kwargs)
- if user.name == 'admin' :
+ if user.name == 'admin' and 'password' in kwargs :
print("Warning: '%s' password changed. Please wait 5 minutes "
"before Locking/Unlocking the controllers for the password "
"change to come into effect\n" %(user.name))
@@ -456,6 +456,17 @@ class SetPasswordUser(command.Command):
identity_client.users.update_password(current_password, password)
+ # retrieve the authentication information from the cached token session
+ session_auth = identity_client.session.auth
+ username = ""
+ if "username" in session_auth.__dict__:
+ username = session_auth.username
+ elif "_username" in session_auth.__dict__:
+ username = session_auth._username
+ if username == 'admin' :
+ print("Warning: '%s' password changed. Please wait 5 minutes "
+ "before Locking/Unlocking the controllers for the password "
+ "change to come into effect\n" %(username))
class ShowUser(command.ShowOne):
_description = _("Display user details")

View File

@ -1,22 +0,0 @@
From be8b4cdf2939d5cd2bf3f2a38534f0d760f63413 Mon Sep 17 00:00:00 2001
From: jmckenna <jason.mckenna@windriver.com>
Date: Fri, 6 Oct 2017 10:38:33 -0400
Subject: [PATCH] CGTS-6766: Openstack client logging a warning message when
'admin' user password is changed using 'openstack user set'CLI command
diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py
index 5f4fb54..201d217 100644
--- a/openstackclient/identity/v3/user.py
+++ b/openstackclient/identity/v3/user.py
@@ -392,6 +392,10 @@ class SetUser(command.Command):
kwargs['enabled'] = False
identity_client.users.update(user.id, **kwargs)
+ if user.name == 'admin' :
+ print("Warning: '%s' password changed. Please wait 5 minutes "
+ "before Locking/Unlocking the controllers for the password "
+ "change to come into effect\n" %(user.name))
class SetPasswordUser(command.Command):

View File

@ -0,0 +1,304 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
# Python3 support in OpenStack starts with version 3.5,
# which is only in Fedora 24+
%if 0%{?fedora} >= 24
%global with_python3 1
%endif
%global client openstackclient
%global with_doc 0
%global with_check 0
%global common_desc \
python-openstackclient is a unified command-line client for the OpenStack APIs. \
It is a thin wrapper to the stock python-*client modules that implement the \
actual REST API client actions.
Name: python-openstackclient
Version: 3.16.2
Release: 1%{?_tis_dist}.%{tis_patch_ver}
Summary: OpenStack Command-line Client
License: ASL 2.0
URL: http://launchpad.net/%{name}
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python2-%{client}
Summary: OpenStack Command-line Client
%{?python_provide:%python_provide python2-%{client}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python2-pbr
BuildRequires: python2-six
BuildRequires: python2-oslo-i18n
BuildRequires: python2-oslo-utils
BuildRequires: python2-requests
BuildRequires: python2-glanceclient
BuildRequires: python2-keystoneclient
BuildRequires: python2-novaclient
BuildRequires: python2-cinderclient
BuildRequires: python2-mock
BuildRequires: python2-os-client-config
%if 0%{?fedora} > 0
BuildRequires: python2-d2to1
BuildRequires: python2-cliff
BuildRequires: python2-simplejson
BuildRequires: python2-requests-mock
%else
BuildRequires: python-d2to1
BuildRequires: python-cliff
BuildRequires: python-simplejson
BuildRequires: python-requests-mock
%endif
# Required to compile translation files
BuildRequires: python2-babel
# Required for unit tests
BuildRequires: python2-os-testr
BuildRequires: python2-osc-lib-tests
BuildRequires: python2-fixtures
BuildRequires: python2-oslotest
BuildRequires: python2-reno
BuildRequires: python2-requestsexceptions
BuildRequires: python2-openstacksdk
BuildRequires: python2-osprofiler
Requires: python2-pbr
Requires: python2-babel
Requires: python2-openstacksdk >= 0.11.2
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-glanceclient >= 1:2.8.0
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-keystoneclient >= 1:3.17.0
Requires: python2-novaclient >= 9.1.0
Requires: python2-cinderclient >= 3.3.0
Requires: python2-neutronclient >= 6.7.0
Requires: python2-six >= 1.10.0
Requires: python2-osc-lib >= 1.10.0
%if 0%{?fedora} > 0
Requires: python2-cliff
%else
Requires: python-cliff
%endif
Requires: python-%{client}-lang = %{version}-%{release}
%description -n python2-%{client}
%{common_desc}
%if 0%{?with_doc}
%package -n python-%{client}-doc
Summary: Documentation for OpenStack Command-line Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-sphinxcontrib-apidoc
Requires: %{name} = %{version}-%{release}
%description -n python-%{client}-doc
%{common_desc}
This package contains auto-generated documentation.
%endif
%package -n python-%{client}-lang
Summary: Translation files for Openstackclient
%description -n python-%{client}-lang
Translation files for Openstackclient
%if 0%{?with_python3}
%package -n python3-%{client}
Summary: OpenStack Command-line Client
%{?python_provide:%python_provide python3-%{client}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-d2to1
BuildRequires: python3-oslo-sphinx
BuildRequires: python3-six
BuildRequires: python3-cliff
BuildRequires: python3-oslo-i18n
BuildRequires: python3-oslo-utils
BuildRequires: python3-simplejson
BuildRequires: python3-requests
BuildRequires: python3-glanceclient
BuildRequires: python3-keystoneclient
BuildRequires: python3-novaclient
BuildRequires: python3-cinderclient
BuildRequires: python3-mock
BuildRequires: python3-requests-mock
BuildRequires: python3-os-client-config
# Required to compile translation files
BuildRequires: python3-babel
# Required for unit tests
BuildRequires: python3-os-testr
BuildRequires: python3-osc-lib-tests
BuildRequires: python3-coverage
BuildRequires: python3-fixtures
BuildRequires: python3-oslotest
BuildRequires: python3-reno
BuildRequires: python3-requestsexceptions
BuildRequires: python3-openstacksdk
BuildRequires: python3-osprofiler
Requires: python3-pbr
Requires: python3-babel
Requires: python3-cliff
Requires: python3-openstacksdk >= 0.11.2
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-glanceclient >= 1:2.8.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-keystoneclient >= 1:3.17.0
Requires: python3-novaclient >= 9.1.0
Requires: python3-cinderclient >= 3.3.0
Requires: python3-neutronclient >= 6.7.0
Requires: python3-six >= 1.10.0
Requires: python3-osc-lib >= 1.10.0
Requires: python-%{client}-lang = %{version}-%{release}
%description -n python3-%{client}
%{common_desc}
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# We handle requirements ourselves, pkg_resources only bring pain
%py_req_cleanup
%build
export PBR_VERSION=%{version}
%py2_build
%py2_build_wheel
%if 0%{?with_python3}
%py3_build
%endif
# Generate i18n files
%{__python2} setup.py compile_catalog -d build/lib/openstackclient/locale
%install
export PBR_VERSION=%{version}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/openstack %{buildroot}%{_bindir}/openstack-%{python3_version}
ln -s ./openstack-%{python3_version} %{buildroot}%{_bindir}/openstack-3
%endif
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
ln -s ./openstack %{buildroot}%{_bindir}/openstack-2
ln -s ./openstack %{buildroot}%{_bindir}/openstack-%{python2_version}
%if 0%{?with_doc}
sphinx-build -b html doc/source doc/build/html
sphinx-build -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/openstack.1 %{buildroot}%{_mandir}/man1/openstack.1
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo doc/build/html/.htaccess
%endif
# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python2_sitelib}/openstackclient/locale/*/LC_*/openstackclient*po
rm -f %{buildroot}%{python2_sitelib}/openstackclient/locale/*pot
mv %{buildroot}%{python2_sitelib}/openstackclient/locale %{buildroot}%{_datadir}/locale
%if 0%{?with_python3}
rm -rf %{buildroot}%{python3_sitelib}/openstackclient/locale
%endif
# Find language files
%find_lang openstackclient --all-name
# STX: stage wheels
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
# STX: prep SDK package
mkdir -p %{buildroot}/usr/share/remote-clients
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
%check
%if 0%{?with_check}
%{__python2} setup.py test
%if 0%{?with_python3}
rm -rf .testrepository
%{__python3} setup.py test
%endif
%endif
%files -n python2-%{client}
%license LICENSE
%doc README.rst
%{_bindir}/openstack
%{_bindir}/openstack-2
%{_bindir}/openstack-%{python2_version}
%{python2_sitelib}/openstackclient
%{python2_sitelib}/*.egg-info
%if 0%{?with_doc}
%{_mandir}/man1/openstack.1*
%files -n python-%{client}-doc
%license LICENSE
%doc doc/build/html
%endif
%files -n python-%{client}-lang -f openstackclient.lang
%license LICENSE
%if 0%{?with_python3}
%files -n python3-%{client}
%license LICENSE
%doc README.rst
%{_bindir}/openstack-3
%{_bindir}/openstack-%{python3_version}
%{python3_sitelib}/openstackclient
%{python3_sitelib}/*.egg-info
%endif
%package sdk
Summary: SDK files for %{name}
%description sdk
Contains SDK files for %{name} package
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*
%changelog
* Tue Nov 27 2018 RDO <dev@lists.rdoproject.org> 3.16.2-1
- Update to 3.16.2
* Thu Sep 20 2018 RDO <dev@lists.rdoproject.org> 3.16.1-1
- Update to 3.16.1
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 3.16.0-1
- Update to 3.16.0

View File

@ -0,0 +1,268 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
# Python3 support in OpenStack starts with version 3.5,
# which is only in Fedora 24+
%if 0%{?fedora} >= 24
%global with_python3 1
%endif
%global client openstackclient
%global with_doc 1
%global common_desc \
python-openstackclient is a unified command-line client for the OpenStack APIs. \
It is a thin wrapper to the stock python-*client modules that implement the \
actual REST API client actions.
Name: python-openstackclient
Version: 3.16.2
Release: 1%{?dist}
Summary: OpenStack Command-line Client
License: ASL 2.0
URL: http://launchpad.net/%{name}
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: openstack-macros
%description
%{common_desc}
%package -n python2-%{client}
Summary: OpenStack Command-line Client
%{?python_provide:%python_provide python2-%{client}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
BuildRequires: python2-six
BuildRequires: python2-oslo-i18n
BuildRequires: python2-oslo-utils
BuildRequires: python2-requests
BuildRequires: python2-glanceclient
BuildRequires: python2-keystoneclient
BuildRequires: python2-novaclient
BuildRequires: python2-cinderclient
BuildRequires: python2-mock
BuildRequires: python2-os-client-config
%if 0%{?fedora} > 0
BuildRequires: python2-d2to1
BuildRequires: python2-cliff
BuildRequires: python2-simplejson
BuildRequires: python2-requests-mock
%else
BuildRequires: python-d2to1
BuildRequires: python-cliff
BuildRequires: python-simplejson
BuildRequires: python-requests-mock
%endif
# Required to compile translation files
BuildRequires: python2-babel
# Required for unit tests
BuildRequires: python2-os-testr
BuildRequires: python2-osc-lib-tests
BuildRequires: python2-fixtures
BuildRequires: python2-oslotest
BuildRequires: python2-reno
BuildRequires: python2-requestsexceptions
BuildRequires: python2-openstacksdk
BuildRequires: python2-osprofiler
Requires: python2-pbr
Requires: python2-babel
Requires: python2-openstacksdk >= 0.11.2
Requires: python2-oslo-i18n >= 3.15.3
Requires: python2-oslo-utils >= 3.33.0
Requires: python2-glanceclient >= 1:2.8.0
Requires: python2-keystoneauth1 >= 3.4.0
Requires: python2-keystoneclient >= 1:3.17.0
Requires: python2-novaclient >= 9.1.0
Requires: python2-cinderclient >= 3.3.0
Requires: python2-neutronclient >= 6.7.0
Requires: python2-six >= 1.10.0
Requires: python2-osc-lib >= 1.10.0
%if 0%{?fedora} > 0
Requires: python2-cliff
%else
Requires: python-cliff
%endif
Requires: python-%{client}-lang = %{version}-%{release}
%description -n python2-%{client}
%{common_desc}
%if 0%{?with_doc}
%package -n python-%{client}-doc
Summary: Documentation for OpenStack Command-line Client
BuildRequires: python2-sphinx
BuildRequires: python2-openstackdocstheme
BuildRequires: python2-sphinxcontrib-apidoc
Requires: %{name} = %{version}-%{release}
%description -n python-%{client}-doc
%{common_desc}
This package contains auto-generated documentation.
%endif
%package -n python-%{client}-lang
Summary: Translation files for Openstackclient
%description -n python-%{client}-lang
Translation files for Openstackclient
%if 0%{?with_python3}
%package -n python3-%{client}
Summary: OpenStack Command-line Client
%{?python_provide:%python_provide python3-%{client}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-d2to1
BuildRequires: python3-oslo-sphinx
BuildRequires: python3-six
BuildRequires: python3-cliff
BuildRequires: python3-oslo-i18n
BuildRequires: python3-oslo-utils
BuildRequires: python3-simplejson
BuildRequires: python3-requests
BuildRequires: python3-glanceclient
BuildRequires: python3-keystoneclient
BuildRequires: python3-novaclient
BuildRequires: python3-cinderclient
BuildRequires: python3-mock
BuildRequires: python3-requests-mock
BuildRequires: python3-os-client-config
# Required to compile translation files
BuildRequires: python3-babel
# Required for unit tests
BuildRequires: python3-os-testr
BuildRequires: python3-osc-lib-tests
BuildRequires: python3-coverage
BuildRequires: python3-fixtures
BuildRequires: python3-oslotest
BuildRequires: python3-reno
BuildRequires: python3-requestsexceptions
BuildRequires: python3-openstacksdk
BuildRequires: python3-osprofiler
Requires: python3-pbr
Requires: python3-babel
Requires: python3-cliff
Requires: python3-openstacksdk >= 0.11.2
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-glanceclient >= 1:2.8.0
Requires: python3-keystoneauth1 >= 3.4.0
Requires: python3-keystoneclient >= 1:3.17.0
Requires: python3-novaclient >= 9.1.0
Requires: python3-cinderclient >= 3.3.0
Requires: python3-neutronclient >= 6.7.0
Requires: python3-six >= 1.10.0
Requires: python3-osc-lib >= 1.10.0
Requires: python-%{client}-lang = %{version}-%{release}
%description -n python3-%{client}
%{common_desc}
%endif
%prep
%autosetup -n %{name}-%{upstream_version} -S git
# We handle requirements ourselves, pkg_resources only bring pain
%py_req_cleanup
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# Generate i18n files
%{__python2} setup.py compile_catalog -d build/lib/openstackclient/locale
%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/openstack %{buildroot}%{_bindir}/openstack-%{python3_version}
ln -s ./openstack-%{python3_version} %{buildroot}%{_bindir}/openstack-3
%endif
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
ln -s ./openstack %{buildroot}%{_bindir}/openstack-2
ln -s ./openstack %{buildroot}%{_bindir}/openstack-%{python2_version}
%if 0%{?with_doc}
sphinx-build -b html doc/source doc/build/html
sphinx-build -b man doc/source doc/build/man
install -p -D -m 644 doc/build/man/openstack.1 %{buildroot}%{_mandir}/man1/openstack.1
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo doc/build/html/.htaccess
%endif
# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python2_sitelib}/openstackclient/locale/*/LC_*/openstackclient*po
rm -f %{buildroot}%{python2_sitelib}/openstackclient/locale/*pot
mv %{buildroot}%{python2_sitelib}/openstackclient/locale %{buildroot}%{_datadir}/locale
%if 0%{?with_python3}
rm -rf %{buildroot}%{python3_sitelib}/openstackclient/locale
%endif
# Find language files
%find_lang openstackclient --all-name
%check
%{__python2} setup.py test
%if 0%{?with_python3}
rm -rf .testrepository
%{__python3} setup.py test
%endif
%files -n python2-%{client}
%license LICENSE
%doc README.rst
%{_bindir}/openstack
%{_bindir}/openstack-2
%{_bindir}/openstack-%{python2_version}
%{python2_sitelib}/openstackclient
%{python2_sitelib}/*.egg-info
%if 0%{?with_doc}
%{_mandir}/man1/openstack.1*
%files -n python-%{client}-doc
%license LICENSE
%doc doc/build/html
%endif
%files -n python-%{client}-lang -f openstackclient.lang
%license LICENSE
%if 0%{?with_python3}
%files -n python3-%{client}
%license LICENSE
%doc README.rst
%{_bindir}/openstack-3
%{_bindir}/openstack-%{python3_version}
%{python3_sitelib}/openstackclient
%{python3_sitelib}/*.egg-info
%endif
%changelog
* Tue Nov 27 2018 RDO <dev@lists.rdoproject.org> 3.16.2-1
- Update to 3.16.2
* Thu Sep 20 2018 RDO <dev@lists.rdoproject.org> 3.16.1-1
- Update to 3.16.1
* Thu Aug 09 2018 RDO <dev@lists.rdoproject.org> 3.16.0-1
- Update to 3.16.0

View File

@ -1 +0,0 @@
mirror:Source/python-openstackclient-3.12.0-1.el7.src.rpm

Some files were not shown because too many files have changed in this diff Show More