Cleanup deprecated projects

This commit removes the following deprecated projects:

- monasca-log-api [1]
- monasca-transform [2]
- os-xenapi. This project is still supported by Nova, but it is no
  longer supported in Neutron and we are explicitly patching it out in
  Nova unit tests.
- oslosphinx. There are some old projects still requiring it, but we are
  patching them out.
- python-glareclient. While not officially abandoned, it has not been
  updated for several years, and no other package requires it.

[1] - https://opendev.org/openstack/monasca-log-api/src/branch/master/README.rst
[2] - https://opendev.org/openstack/monasca-transform/src/branch/master/README.rst

Change-Id: I62d960b47a9e65c595a587c8d832e8b1bd5cc748
This commit is contained in:
Javier Pena
2021-09-03 13:29:39 +02:00
parent 8fd68277bf
commit 4be4362d0a
13 changed files with 2 additions and 743 deletions

View File

@@ -30,7 +30,6 @@ BuildRequires: {{ py3('oslo.i18n') }}
BuildRequires: {{ py3('oslo.log') }}
BuildRequires: {{ py3('oslo.policy') }}
BuildRequires: {{ py3('oslo.versionedobjects') }}
BuildRequires: {{ py3('oslosphinx') }}
BuildRequires: {{ py3('oslotest') }}
BuildRequires: {{ py3('pecan') }}
BuildRequires: {{ py3('psutil') }}

View File

@@ -2,7 +2,7 @@
{% set source = fetch_source('https://tarballs.openstack.org/masakari/masakari-master.tar.gz') %}
{% set upstream_version = upstream_version() %}
{% set rpm_release = '1' %}
%global with_doc 1
Name: {{ py2name() }}
Version: {{ py2rpmversion() }}
Release: {{ py2rpmrelease() }}
@@ -54,7 +54,7 @@ Masakari is a service providing high availability for VMs in OpenStack.
%package doc
Summary: Documentation for OpenStack Masakari Service
BuildRequires: {{ py3('Sphinx') }}
BuildRequires: {{ py3('oslosphinx') }}
BuildRequires: {{ py3('openstackdocstheme') }}
%description doc
Masakari is a service providing high availability for VMs in OpenStack.

View File

@@ -1,143 +0,0 @@
{% set pypi_name = 'monasca-log-api' %}
{% set source = fetch_source('https://tarballs.openstack.org/monasca-log-api/monasca-log-api-master.tar.gz') %}
{% set upstream_version = upstream_version() %}
{% set rpm_release = '1' %}
Name: {{ py2name() }}
Version: {{ py2rpmversion() }}
Release: {{ py2rpmrelease() }}
Summary: OpenStack Monasca Log Api plugin
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://wiki.openstack.org/wiki/Monasca
Source0: {{ source|basename }}
Source1: %{name}-wsgi.conf
BuildRequires: fdupes
BuildRequires: openstack-macros
BuildRequires: {{ py3('falcon') }}
BuildRequires: {{ py3('fixtures') }}
BuildRequires: {{ py3('keystonemiddleware') }}
BuildRequires: {{ py3('mock') }}
BuildRequires: {{ py3('monasca-common') }}
BuildRequires: {{ py3('monasca-statsd') }}
BuildRequires: {{ py3('oslo.config') }}
BuildRequires: {{ py3('oslo.context') }}
BuildRequires: {{ py3('oslo.log') }}
BuildRequires: {{ py3('oslo.middleware') }}
BuildRequires: {{ py3('oslo.serialization') }}
BuildRequires: {{ py3('oslo.utils') }}
BuildRequires: {{ py3('oslotest') }}
BuildRequires: {{ py3('pbr') }}
BuildRequires: {{ py3('simplejson') }}
BuildRequires: {{ py3('stestr') }}
Requires: python3-{{ pypi_name }} = %{version}-%{release}
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: apache2-mod_wsgi-python3
Requires: apache2-mod_wsgi-python3
%else
BuildRequires: python3-mod_wsgi
Requires: python3-mod_wsgi
%endif
%description
monasca-log-api is a RESTful API server receiving logs from the deployed
log agents.
%package -n python3-{{ pypi_name }}
Summary: OpenStack Monasca Log Api plugin
Group: Development/Languages/Python
Requires: {{ py3('eventlet') }}
Requires: {{ py3('falcon') }}
Requires: {{ py3('keystonemiddleware') }}
Requires: {{ py3('monasca-common') }}
Requires: {{ py3('monasca-statsd') }}
Requires: {{ py3('oslo.config') }}
Requires: {{ py3('oslo.context') }}
Requires: {{ py3('oslo.log') }}
Requires: {{ py3('oslo.middleware') }}
Requires: {{ py3('oslo.serialization') }}
Requires: {{ py3('oslo.utils') }}
Requires: {{ py3('pbr') }}
BuildArch: noarch
%description -n python3-{{ pypi_name }}
monasca-log-api is a RESTful API server receiving logs from the deployed
log agents.
%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup
%build
%py3_build
oslo-config-generator \
--config-file config-generator/monasca-log-api.conf \
--output-file etc/monasca/log-api.conf
%install
%py3_install
## directories
install -d -m 755 %{buildroot}%{_sysconfdir}/monasca
install -d -m 750 %{buildroot}%{_var}/log/monasca
install -d -m 755 %{buildroot}%{_var}/lib/monasca-log-api
install -d -m 755 %{buildroot}%{apache_site_dir}
## configuration directory
find %{buildroot}%{_prefix}%{_sysconfdir}/ -type f -name 'log-api-*' -print0 | xargs -0 mv -t %{buildroot}%{_sysconfdir}/monasca/
rm -rf %{buildroot}%{_prefix}%{_sysconfdir}/monasca
# configuration bits
# NOTEtrebskit) file names are hardcoded in monasca-log-api
# should be refactored when Bug#1670277 is resolved
install -D -m 640 etc/monasca/log-api.conf %{buildroot}%{_sysconfdir}/monasca/log-api.conf
install -D -m 640 etc/monasca/log-api-paste.ini %{buildroot}%{_sysconfdir}/monasca/log-api-paste.ini
install -D -m 640 etc/monasca/log-api-logging.conf %{buildroot}%{_sysconfdir}/monasca/log-api-logging.conf
## install apache configuration
install -p -D -m 640 %{SOURCE1} %{buildroot}%{apache_site_dir}/{{ pypi_name }}.conf.sample
sed -e "
s|__APACHE_NAME__|%{apache_name}|g;
" -i %{buildroot}%{apache_site_dir}/{{ pypi_name }}.conf.sample
# there is extra directory /etc/monasca/monasca created, get rid of it
rm -rf %{_sysconfdir}/monasca/monasca || true
%fdupes %{buildroot}%{python3_sitelib}
%check
find . -type f -name *.pyc -delete
OS_TEST_PATH=./monasca_log_api/tests PYTHONPATH=. python3 -m stestr.cli run
%pre
%openstack_pre_user_group_create monasca-log-api monasca
%postun
if [ $1 -eq 0 ] ; then
getent passwd monasca-log-api > /dev/null
if [ "$?" == "0" ] ; then
userdel monasca-log-api
fi
fi
%files
%doc README.rst ChangeLog
%{_bindir}/monasca-log-api
%{_bindir}/monasca-log-api-wsgi
%dir %attr(-, root, monasca) %{_sysconfdir}/monasca
%dir %attr(0750, root, monasca) %{_var}/log/monasca
%dir %attr(0750, monasca-log-api, monasca) %{_var}/lib/monasca-log-api
%config(noreplace) %attr(0640, root, monasca) %{_sysconfdir}/monasca/log-api.conf
%config(noreplace) %attr(0640, root, monasca) %{_sysconfdir}/monasca/log-api-logging.conf
%config(noreplace) %attr(0640, root, monasca) %{_sysconfdir}/monasca/log-api-paste.ini
%config(noreplace) %attr(0640, root, monasca) %{apache_site_dir}/{{ pypi_name }}.conf.sample
%files -n python3-{{ pypi_name }}
%license LICENSE
%{python3_sitelib}/monasca_log_api
%{python3_sitelib}/*.egg-info
%changelog

View File

@@ -1,22 +0,0 @@
Listen 5607
<VirtualHost *:5607>
WSGIDaemonProcess monasca-log-api processes=2 threads=1 socket-timeout=120 user=monasca-log-api group=monasca display-name=%{GROUP}
WSGIProcessGroup monasca-log-api
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /usr/bin/monasca-log-api-wsgi
WSGIPassAuthorization On
LogLevel info
ErrorLog /var/log/__APACHE_NAME__/monasca-log-api.log
CustomLog /var/log/__APACHE_NAME__/monasca-log-api_access.log combined
SetEnv no-gzip 1
AddDefaultCharset utf-8
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>

View File

@@ -1,80 +0,0 @@
From 0b44c4d0805a1cc417f8d8e73e2885290ebf9ddf Mon Sep 17 00:00:00 2001
From: Thomas Bechtold <tbechtold@suse.com>
Date: Wed, 4 Sep 2019 14:50:48 +0200
Subject: [PATCH] Switch to openstackdocstheme
The current code does not work with python3.7 on openSUSE
Tumbleweed. It fails with:
Exception occurred:
File ".tox/docs/lib/python3.7/site-packages/oslosphinx/__init__.py", \
line 76, in builder_inited
app.info('Using openstack theme from %s' % theme_dir)
AttributeError: 'Sphinx' object has no attribute 'info'
Switching to openstackdocstheme and also calling sphinx-build directly
instead of relying on the pbr doc build integration fixes that problem.
Change-Id: I6def2f7006fedfe57f9736c75abbf082294e635e
---
doc/source/conf.py | 6 +++++-
test-requirements.txt | 1 -
tox.ini | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 9468074..10e35a7 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -71,7 +71,7 @@ extensions = [
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.graphviz',
- 'oslosphinx'
+ 'openstackdocstheme'
]
# Add any paths that contain templates here, relative to this directory.
@@ -140,6 +140,7 @@ modindex_common_prefix = ['monasca.']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# html_theme = 'default'
+html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -302,3 +303,6 @@ texinfo_documents = [
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
+
+# openstackdocstheme options
+repository_name = 'openstack/monasca-statsd'
diff --git a/test-requirements.txt b/test-requirements.txt
index 67fa8e7..4eaaf73 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -6,7 +6,6 @@ bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
-oslosphinx>=4.7.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
diff --git a/tox.ini b/tox.ini
index bee413c..dededac 100644
--- a/tox.ini
+++ b/tox.ini
@@ -40,7 +40,7 @@ commands =
basepython = python3
commands =
rm -rf doc/build
- python setup.py build_sphinx
+ sphinx-build -b html doc/source doc/build/html
[testenv:bandit]
basepython = python3
--
2.23.0

View File

@@ -1,37 +0,0 @@
Monasca Transform (https://wiki.openstack.org/wiki/Monasca/Transform) is an
OpenStack service that works with the other Monasca Services.
Thus it needs some additional configuration after installation to establish
the connections between services.
To configure the .rpm installation manually, you will need:
- A running zookeeper server installation
-- zookeeper.service running
- MySQL installation with a Monasca Transform user created and configured
-- sql configuration TBD
- If Apache Spark was installed by hand, ensure all needed .jar files are in
place. Consult the values in /etc/monasca-transform.conf under
spark_jars_list for a list of required .jar files.
-- The monasca-transform Devstack configuration expects .jar files installed
in /opt/spark/current/lib/. However, the recommended install location
for SUSE installs is /usr/share/spark/lib.
-- Ensure all paths and version numbers match what is installed on the
target system.
-- This requirement includes a JDBC driver which will be used by Spark
on behalf of Monasca Transform. Drizzle-jdbc works well for this.
- A running Apache Spark installation
-- spark-master.service and spark-worker.service running
-- Note: spark will be connecting through drizzle-jdbc to a mysql instance
- The IP address and port that spark is listening on (this can be a
comma-separated list if spark is running on more than one host)
-- Replace this in the spark_master_list of /etc/monasca-transform.conf
-- Default is spark://localhost:7078, though the monasca-transform.conf
used with Devstack specifies spark://192.168.10.4:7077,192.168.10.5:7077
- And to fully use Monasca Transform, an installation of the other Monasca
services along with Kafka for communication. See documentation included
with the other Monasca services for their configuration options.
Other deployments of Monasca Transform have made use of local state file in
/var/run/monasca/monasca-transform.pid and a work_dir in
/var/run/monasca/monasca-transform/, but in the configuration used by this
.spec file those should not be needed.

View File

@@ -1,176 +0,0 @@
{% set monasca_transform_source = fetch_source('https://tarballs.openstack.org/monasca-transform/monasca-transform-master.tar.gz') %}
{% set pypi_name = 'monasca-transform' %}
{% set pypi_tar_name = 'monasca_transform' %}
{% set upstream_version = upstream_version() %}
{% set rpm_release = '1' %}
{% set spark_req_version = '1.6.3' %}
%global sname {{ pypi_name }}
%define username monasca-transform
%define groupname monasca
Name: {{ py2name() }}
Version: {{ py2rpmversion() }}
Release: {{ py2rpmrelease() }}
Summary: A transformation and aggregation engine for Monasca
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://wiki.openstack.org/wiki/Monasca/Transform
Source0: {{ monasca_transform_source|basename }}
Source1: openstack-monasca-transform.service
BuildRequires: crudini
BuildRequires: fdupes
BuildRequires: openstack-macros
BuildRequires: {{ py3('PyMySQL') }}
BuildRequires: {{ py3('SQLAlchemy') }}
BuildRequires: {{ py3('kazoo') }}
BuildRequires: {{ py3('mock') }}
BuildRequires: {{ py3('monasca-common') }}
BuildRequires: {{ py3('nose') }}
BuildRequires: {{ py3('oslo.config') }}
BuildRequires: {{ py3('oslo.log') }}
BuildRequires: {{ py3('oslo.service') }}
BuildRequires: {{ py3('oslotest') }}
BuildRequires: {{ py3('pbr') }}
BuildRequires: {{ py3('psutil') }}
BuildRequires: {{ py3('six') }}
BuildRequires: {{ py3('stestr') }}
BuildRequires: {{ py3('stevedore') }}
BuildRequires: {{ py3('tooz') }}
BuildRequires: zip
#BuildRequires: spark == 1.6.3
Requires: python3-%{sname} = %{version}-%{release}
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: systemd-rpm-macros
Requires(pre): pwdutils
%{?systemd_requires}
%else
BuildRequires: systemd
Requires(post): systemd
Requires(postun): systemd
Requires(preun): systemd
%endif
%description
A transformation and aggregation engine for Monasca. Collects, groups and
aggregates existing individual Monasca metrics according to business
requirements and publishes new transformed (derived) metrics to the Monasca
Kafka queue.
Requires an installation of Apache Spark {{ spark_req_version }}, either on
this server or another, and configured in %{_sysconfdir}/monasca-transform.conf
as spark_master_list.
%package -n python3-%{sname}
Summary: Python core module for monasca-transform
Group: Development/Languages/Python
Requires: {{ py3('PyMySQL') }}
Requires: {{ py3('SQLAlchemy') }}
Requires: {{ py3('kazoo') }}
Requires: {{ py3('monasca-common') }}
Requires: {{ py3('oslo.config') }}
Requires: {{ py3('oslo.log') }}
Requires: {{ py3('six') }}
Requires: {{ py3('stevedore') }}
Requires: {{ py3('tooz') }}
#Requires: spark == 1.6.3
%description -n python3-%{sname}
A transformation and aggregation engine for Monasca. Collects, groups and
aggregates existing individual Monasca metrics according to business
requirements and publishes new transformed (derived) metrics to the Monasca
Kafka queue.
Requires an installation of Apache Spark {{ spark_req_version }}, either on this server or
another, and configured in %{_sysconfdir}/monasca-transform.conf as spark_master_list.
%prep
# Unfortunately again, .tgz has _ in directory name so can't use sname
%autosetup -n {{ pypi_tar_name }}-{{ upstream_version }}
%py_req_cleanup
# Add entry point for service startup by appending console_scripts after [entry_points].
sed -i '/\[entry_points\]/aconsole_scripts =\n monasca-transform = monasca_transform.service.transform_service:main_service\n' setup.cfg
%build
export LANG=en_US.UTF-8
%{py3_build}
# copy, compile and create a zip file to be fed to spark
python3 -m compileall monasca_transform
zip -r %{sname}.zip monasca_transform -i '*.pyc'
%install
export LANG=en_US.UTF-8
%{py3_install}
install -d -m 755 %{buildroot}%{_sysconfdir}/monasca
install -d -m 750 %{buildroot}%{_sysconfdir}/monasca_transform
install -d -m 750 %{buildroot}%{_sysconfdir}/monasca_transform/monasca_transform.conf.d
install -D -m 640 etc/monasca-transform.conf %{buildroot}%{_sysconfdir}/monasca-transform.conf
install -d -m 750 %{buildroot}%{_var}/log/monasca
install -d -m 750 %{buildroot}%{_var}/log/monasca/transform
# systemd unit file
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
%if 0%{?suse_version}
mkdir -p %{buildroot}%{_sbindir}
ln -sr %{buildroot}%{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%endif
install -d -m 750 %{buildroot}%{_datadir}/%{sname}
install -D -m 644 %{sname}.zip %{buildroot}%{_datadir}/%{sname}/%{sname}.zip
# reconfigure for rpm install
%define mon_trans_conf %{buildroot}%{_sysconfdir}/monasca-transform.conf
crudini --set %{mon_trans_conf} service service_log_path %{_var}/log/monasca/transform/
crudini --del %{mon_trans_conf} service setup_file
crudini --set %{mon_trans_conf} service spark_driver %{python3_sitelib}/monasca_transform/driver/mon_metrics_kafka.py
# disable spark event logging - mon-trans only keeps 10 jobs so history not needed
crudini --set %{mon_trans_conf} service spark_event_logging_enabled false
# NOTE: Special handling for spark_jars_list will need to be done after install
crudini --set %{mon_trans_conf} service spark_home $"$spark_home"
crudini --set %{mon_trans_conf} service work_dir %{_rundir}/monasca/monasca-transform
crudini --set %{mon_trans_conf} service spark_master_list spark://localhost:7078
# for the .zip file created above
crudini --set %{mon_trans_conf} service spark_python_files %{_datadir}/%{sname}/%{sname}.zip
%fdupes %{buildroot}%{python3_sitelib}
%check
# automated tests need to be restricted, as functional tests require running Spark
find . -type f -name *.pyc -delete
python3 -m stestr.cli run
%pre
# create user and groups
%openstack_pre_user_group_create %{username} %{groupname} /sbin/nologin
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun %{name}.service
%files
%license LICENSE
%doc README.rst ChangeLog
%dir %attr(-, root, %{groupname}) %{_sysconfdir}/monasca
%config(noreplace) %attr(0640, root, %{groupname}) %{_sysconfdir}/monasca-transform.conf
%{_unitdir}/%{name}.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}
%endif
%{_bindir}/monasca-transform
%dir %attr(0750, root, %{groupname}) %{_var}/log/monasca
%dir %attr(0750, %{username}, %{groupname}) %{_var}/log/monasca/transform
%files -n python3-{{ pypi_name }}
%license LICENSE
%{python3_sitelib}/monasca_transform
%{python3_sitelib}/*.egg-info
%dir %attr(0750, %{username}, %{groupname}) %{_datadir}/%{sname}
%{_datadir}/%{sname}/%{sname}.zip
%changelog

View File

@@ -1,10 +0,0 @@
[Unit]
Description=Monasca Transform Daemon
After=zookeeper.service spark-master.service spark-worker.service
[Service]
Type=simple
LimitNOFILE=32768
ExecStart=/usr/bin/monasca-transform
[Install]
WantedBy=multi-user.target

View File

@@ -85,7 +85,6 @@ Contains the OVSvApp agent services for %{name}
Summary: Documentation for %{name}
Group: Documentation/HTML
BuildRequires: {{ py3('Sphinx') }}
BuildRequires: {{ py3('oslosphinx') }}
%description doc
This package contains extra documentation for %{name}.

View File

@@ -52,7 +52,6 @@ BuildRequires: {{ py3('python-novaclient') }}
BuildRequires: {{ py3('os-ken') }}
BuildRequires: {{ py3('os-resource-classes') }}
BuildRequires: {{ py3('os-vif') }}
BuildRequires: {{ py3('os-xenapi') }}
BuildRequires: {{ py3('oslo.cache') }}
BuildRequires: {{ py3('oslo.privsep') }}
BuildRequires: {{ py3('oslo.reports') }}
@@ -116,7 +115,6 @@ Requires: {{ py3('python-novaclient') }}
Requires: {{ py3('os-ken') }}
Requires: {{ py3('os-resource-classes') }}
Requires: {{ py3('os-vif') }}
Requires: {{ py3('os-xenapi') }}
Requires: {{ py3('oslo.cache') }}
Requires: {{ py3('oslo.concurrency') }}
Requires: {{ py3('oslo.config') }}

View File

@@ -1,92 +0,0 @@
%define with_tests 1
%define with_doc 0
{% set pypi_name = 'os-xenapi' %}
{% set upstream_version = upstream_version('0.3.4') %}
{% set rpm_release = '1' %}
Name: {{ py2name() }}
Version: {{ py2rpmversion() }}
Release: {{ py2rpmrelease() }}
Summary: XenAPI library for OpenStack projects
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://docs.openstack.org/{{ pypi_name }}
Source0: https://files.pythonhosted.org/packages/source/o/{{ pypi_name }}/{{ pypi_name }}-%{version}.tar.gz
BuildRequires: openstack-macros
BuildRequires: {{ py3('devel') }}
BuildRequires: {{ py3('eventlet') }}
BuildRequires: {{ py3('oslo.concurrency') }}
BuildRequires: {{ py3('oslo.i18n') }}
BuildRequires: {{ py3('oslo.log') }}
BuildRequires: {{ py3('oslo.utils') }}
BuildRequires: {{ py3('oslotest') }}
BuildRequires: {{ py3('paramiko') }}
BuildRequires: {{ py3('pbr') }}
BuildRequires: {{ py3('six') }}
BuildRequires: {{ py3('stestr') }}
BuildRequires: {{ py3('testscenarios') }}
BuildRequires: {{ py3('testtools') }}
BuildArch: noarch
%description
XenAPI library for OpenStack projects.
%package -n {{ py2name(py_versions='py3') }}
Summary: XenAPI library for OpenStack projects
Requires: {{ py3('Babel') }}
Requires: {{ py3('eventlet') }}
Requires: {{ py3('oslo.concurrency') }}
Requires: {{ py3('oslo.i18n') }}
Requires: {{ py3('oslo.log') }}
Requires: {{ py3('oslo.utils') }}
Requires: {{ py3('paramiko') }}
Requires: {{ py3('pbr') }}
Requires: {{ py3('six') }}
%description -n {{ py2name(py_versions='py3') }}
XenAPI library for OpenStack projects.
%if 0%{?with_doc}
%package -n {{ py2name() }}-doc
Summary: Documentation for OpenStack log library
BuildRequires: {{ py3('Sphinx') }}
BuildRequires: {{ py3('oslosphinx') }}
%description -n {{ py2name() }}-doc
Documentation for the os-xenapi module.
%endif
%prep
%autosetup -p1 -n {{pypi_name }}-%{version}
%py_req_cleanup
%build
%{py3_build}
%if 0%{?with_doc}
# generate html docs
PBR_VERSION=%{version} %sphinx_build -b html doc/source doc/build/html
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
%install
%{py3_install}
%if 0%{?with_tests}
%check
python3 -m stestr.cli run --test-path ./os_xenapi/tests --black-regex 'os_xenapi.tests.plugins.*'
%endif
%files -n {{ py2name(py_versions='py3') }}
%license LICENSE
%doc ChangeLog README.rst
%{python3_sitelib}/os_xenapi
%{python3_sitelib}/*.egg-info
%{_bindir}/xenapi_bootstrap
%if 0%{?with_doc}
%files -n {{ py2name() }}-doc
%license LICENSE
%doc doc/build/html
%endif
%changelog

View File

@@ -1,84 +0,0 @@
From b1364646f78cf9e24ca9f74a7af093d240c094c0 Mon Sep 17 00:00:00 2001
From: Corey Bryant <corey.bryant@canonical.com>
Date: Tue, 31 Jul 2018 17:10:20 -0400
Subject: [PATCH] python3 compatibility for failing unit tests
Handle StopIteration for Py3.7. PEP 0479,
https://www.python.org/dev/peps/pep-0479/, makes the following
change: "when StopIteration is raised inside a generator, it is
replaced it with RuntimeError". And states: "If raise StopIteration
occurs directly in a generator, simply replace it with return."
Also fix test cases that make assumptions about the ordering of
**kwargs. Python, up to 3.6, doesn't preserve any ordering for those.
And the behavior differs between various Python versions.
For details see PEP 0468 (https://www.python.org/dev/peps/pep-0468/)
Change-Id: I9847053534ffd47c4559d504be647be0de25b651
Closes-Bug: #1784714
Closes-Bug: #1711469
---
glareclient/tests/unit/v1/test_artifacts.py | 26 +++++++++++----------
glareclient/v1/artifacts.py | 2 +-
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/glareclient/tests/unit/v1/test_artifacts.py b/glareclient/tests/unit/v1/test_artifacts.py
index 2fd0450..41d4468 100644
--- a/glareclient/tests/unit/v1/test_artifacts.py
+++ b/glareclient/tests/unit/v1/test_artifacts.py
@@ -50,17 +50,19 @@ class TestController(testtools.TestCase):
body = self.c.update('test-id', type_name='test_name',
remove_props=remove_props, update1=1, update2=2)
self.assertEqual(self.mock_body, body)
- patch_kwargs = {
- 'headers': {'Content-Type': 'application/json-patch+json'},
- 'json': [
- {'path': '/remove1', 'value': None, 'op': 'replace'},
- {'path': '/remove2', 'value': None, 'op': 'replace'},
- {'path': '/update2', 'value': 2, 'op': 'add'},
- {'path': '/update1', 'value': 1, 'op': 'add'}
- ]
- }
- self.mock_http_client.patch.assert_called_once_with(
- '/artifacts/checked_name/test-id', **patch_kwargs)
+ headers = {'Content-Type': 'application/json-patch+json'}
+ json = [
+ {'path': '/remove1', 'value': None, 'op': 'replace'},
+ {'path': '/remove2', 'value': None, 'op': 'replace'},
+ {'path': '/update1', 'value': 1, 'op': 'add'},
+ {'path': '/update2', 'value': 2, 'op': 'add'}
+ ]
+
+ args, kwargs = self.mock_http_client.patch.call_args
+ self.assertEqual(args, ('/artifacts/checked_name/test-id',))
+ self.assertEqual(kwargs['headers'], headers)
+ sorted_json = sorted(kwargs['json'], key=lambda k: k['path'])
+ self.assertEqual(sorted_json, json)
self.c._check_type_name.assert_called_once_with('test_name')
def test_get(self):
@@ -169,7 +171,7 @@ class TestController(testtools.TestCase):
schemas = {'schemas': {'a': {'version': 1}, 'b': {'version': 2}}}
self.mock_http_client.get.return_value = (None, schemas)
expected_types = [('a', 1), ('b', 2)]
- self.assertEqual(expected_types, self.c.get_type_list())
+ self.assertEqual(expected_types, sorted(self.c.get_type_list()))
def test_get_type_schema(self):
test_schema = {'schemas': {'checked_name': 'test-schema'}}
diff --git a/glareclient/v1/artifacts.py b/glareclient/v1/artifacts.py
index bfe549b..cf55975 100644
--- a/glareclient/v1/artifacts.py
+++ b/glareclient/v1/artifacts.py
@@ -171,7 +171,7 @@ class Controller(object):
if limit:
limit -= 1
if limit <= 0:
- raise StopIteration
+ return
try:
next_url = body['next']
--
2.23.0

View File

@@ -1,93 +0,0 @@
{% set pypi_name = 'python-glareclient' %}
{% set upstream_version = upstream_version('0.5.3') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}
# Tempoary disable docs. They currently don't build with python3
# https://bugs.launchpad.net/python-glareclient/+bug/1843407
# and don't contain much useful information anyways.
%global with_doc 0
Name: {{ py2name(py_versions='py3') }}
Version: {{ py2rpmversion() }}
Release: {{ py2rpmrelease() }}
Epoch: {{ epoch(' {{ pypi_name }} ') }}
Summary: Python API and CLI for OpenStack Glare
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://docs.openstack.org/{{ pypi_name }}
Source0: {{ source }}
Patch1: 0001-python3-compatibility-for-failing-unit-tests.patch
BuildRequires: openstack-macros
BuildRequires: {{ py3('PyYAML') }}
BuildRequires: {{ py3('coverage') }}
BuildRequires: {{ py3('fixtures') }}
BuildRequires: {{ py3('mock') }}
BuildRequires: {{ py3('os-client-config') }}
BuildRequires: {{ py3('osc-lib') }}
BuildRequires: {{ py3('oslo.log') }}
BuildRequires: {{ py3('oslo.utils') }}
BuildRequires: {{ py3('reno') }}
BuildRequires: {{ py3('requests-mock') }}
BuildRequires: {{ py3('testrepository') }}
BuildRequires: {{ py3('testscenarios') }}
Requires: {{ py3('Babel') }}
Requires: {{ py3('PrettyTable') }}
Requires: {{ py3('keystoneauth1') }}
Requires: {{ py3('osc-lib') }}
Requires: {{ py3('oslo.i18n') }}
Requires: {{ py3('oslo.log') }}
Requires: {{ py3('oslo.utils') }}
Requires: {{ py3('pbr') }}
Requires: {{ py3('requests') }}
Requires: {{ py3('six') }}
BuildArch: noarch
%description
Python bindings to the Glare Artifact Repository
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Glare API Client
Group: Documentation/HTML
BuildRequires: {{ py3('Sphinx') }}
BuildRequires: {{ py3('openstackdocstheme') }}
%description doc
Python bindings to the Glare Artifact Repository
This package contains auto-generated documentation.
%endif
%prep
%autosetup -p1 -n {{ pypi_name }}-%{version}
%py_req_cleanup
%build
%py3_build
%if 0%{?with_doc}
## generate html docs
#PYTHONPATH=. PBR_VERSION={{ upstream_version }} %sphinx_build -b html doc/source doc/build/html
## remove the sphinx-build leftovers
#rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
%install
%py3_install
%check
PYTHON=%{__python3} PYTHONPATH=. %{__python3} setup.py testr
%files
%license LICENSE
%doc README.rst ChangeLog
%{_bindir}/glare
%{python3_sitelib}/glareclient
%{python3_sitelib}/*.egg-info
%if 0%{?with_doc}
%files doc
%license LICENSE
%doc doc/build/html
%endif
%changelog