Skip to content

Python cryptography #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
From be5714cddc9aa535da42fc995480233530fbc6cc Mon Sep 17 00:00:00 2001
From: "cheng.tang" <[email protected]>
Date: Mon, 10 Jul 2017 15:29:40 +0800
Subject: [PATCH] Fix fallback to use old version oslo lib

Fixes: redmine #10517

Signed-off-by: cheng.tang <[email protected]>
---
barbicanclient/_i18n.py | 2 +-
barbicanclient/acls.py | 2 +-
barbicanclient/cas.py | 2 +-
barbicanclient/common/config.py | 2 +-
barbicanclient/containers.py | 2 +-
barbicanclient/orders.py | 2 +-
barbicanclient/secrets.py | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/barbicanclient/_i18n.py b/barbicanclient/_i18n.py
index a283bc0..3b78a40 100644
--- a/barbicanclient/_i18n.py
+++ b/barbicanclient/_i18n.py
@@ -16,7 +16,7 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html .

"""

-import oslo_i18n as i18n
+import oslo.i18n as i18n


_translators = i18n.TranslatorFactory(domain='python-barbicanclient')
diff --git a/barbicanclient/acls.py b/barbicanclient/acls.py
index cec8378..d85dada 100644
--- a/barbicanclient/acls.py
+++ b/barbicanclient/acls.py
@@ -15,7 +15,7 @@

import logging

-from oslo_utils.timeutils import parse_isotime
+from oslo.utils.timeutils import parse_isotime

from barbicanclient import base
from barbicanclient import formatter
diff --git a/barbicanclient/cas.py b/barbicanclient/cas.py
index 5fa3288..14b7131 100644
--- a/barbicanclient/cas.py
+++ b/barbicanclient/cas.py
@@ -16,7 +16,7 @@ import functools
import logging
import traceback

-from oslo_utils.timeutils import parse_isotime
+from oslo.utils.timeutils import parse_isotime

from barbicanclient import base
from barbicanclient import formatter
diff --git a/barbicanclient/common/config.py b/barbicanclient/common/config.py
index eeb5b6a..6ec9209 100644
--- a/barbicanclient/common/config.py
+++ b/barbicanclient/common/config.py
@@ -21,7 +21,7 @@ import os
import sys

from barbicanclient.version import __version__
-from oslo_config import cfg
+from oslo.config import cfg

CONF = cfg.CONF

diff --git a/barbicanclient/containers.py b/barbicanclient/containers.py
index a2c17f3..a2d18d5 100644
--- a/barbicanclient/containers.py
+++ b/barbicanclient/containers.py
@@ -16,7 +16,7 @@ import functools
import logging
import six

-from oslo_utils.timeutils import parse_isotime
+from oslo.utils.timeutils import parse_isotime

from barbicanclient import acls as acl_manager
from barbicanclient import base
diff --git a/barbicanclient/orders.py b/barbicanclient/orders.py
index 91d4e34..9eec817 100644
--- a/barbicanclient/orders.py
+++ b/barbicanclient/orders.py
@@ -16,7 +16,7 @@ import abc
import functools
import logging

-from oslo_utils.timeutils import parse_isotime
+from oslo.utils.timeutils import parse_isotime
import six

from barbicanclient import base
diff --git a/barbicanclient/secrets.py b/barbicanclient/secrets.py
index cf707ba..a260135 100644
--- a/barbicanclient/secrets.py
+++ b/barbicanclient/secrets.py
@@ -16,7 +16,7 @@ import base64
import functools
import logging

-from oslo_utils.timeutils import parse_isotime
+from oslo.utils.timeutils import parse_isotime
import six

from barbicanclient import acls as acl_manager
--
2.7.4

11 changes: 11 additions & 0 deletions packaging/python-barbicanclient/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
srpm_repo = http://192.168.2.65:11080/pulp/repos/rdo/openstack-juno/epel-7
base_srpm = python-barbicanclient-4.1.0-1.el7.src.rpm
spec_file = python-barbicanclient.spec

sources:
mv $(spec_file) $(spec_file).new
wget "$(srpm_repo)/$(base_srpm)" && \
rpm2cpio $(base_srpm) | cpio -idmv && \
rm -f $(spec_file) && \
mv $(spec_file).new $(spec_file) && \
rm -f $(base_srpm)
182 changes: 182 additions & 0 deletions packaging/python-barbicanclient/python-barbicanclient.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}

%global sname barbicanclient
%if 0%{?fedora}
%global with_python3 1
%endif

%global dist_eayunstack .eayunstack.dev


Name: python-barbicanclient
Version: 4.1.0
Release: 2%{?dist_eayunstack}
Summary: Client Library for OpenStack Barbican Key Management API

License: ASL 2.0
URL: https://pypi.io/pypi/python-barbicanclient
Source0: https://pypi.io/packages/source/p/%{name}/%{name}-%{version}%{?milestone}.tar.gz

Patch0001: 0001-Fix-fallback-to-use-old-version-oslo-lib.patch

BuildArch: noarch


%description
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).


%package -n python2-%{sname}
Summary: Client Library for OpenStack Barbican Key Management API

BuildRequires: python2-devel
BuildRequires: python-pbr
BuildRequires: python-setuptools

Requires: python-setuptools
Requires: python-requests
Requires: python-six >= 1.7.0
Requires: python-keystoneclient
Requires: python-cliff
Requires: python-oslo-i18n
Requires: python-oslo-serialization
Requires: python-oslo-utils
Requires: python-iso8601
Requires: python-babel
Requires: python-oslo-config
Requires: python-netaddr
Requires: python-prettytable
Requires: python-stevedore
Requires: pyparsing
Requires: python-cmd2
Requires: pytz
Requires: python-msgpack

%{?python_provide:%python_provide python2-%{sname}}

%description -n python2-%{sname}
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).


%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-setuptools
Requires: python3-requests
Requires: python3-six >= 1.9.0
Requires: python3-keystoneclient
Requires: python3-cliff
Requires: python3-oslo-i18n
Requires: python3-oslo-serialization
Requires: python3-oslo-utils
Requires: python3-iso8601
Requires: python3-babel
Requires: python3-oslo-config
Requires: python3-netaddr
Requires: python3-prettytable
Requires: python3-stevedore
Requires: python3-pyparsing
Requires: python3-cmd2
Requires: python3-pytz
Requires: python3-msgpack

%{?python_provide:%python_provide python3-%{sname}}

%description -n python3-%{sname}
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).
%endif


%package doc
Summary: Documentation for OpenStack Barbican API client

BuildRequires: python-sphinx
BuildRequires: python-oslo-sphinx
BuildRequires: python-oslo-utils
BuildRequires: dos2unix
BuildRequires: python-oslo-i18n
BuildRequires: python-prettytable
BuildRequires: python-keystoneclient

%description doc
Documentation for the barbicanclient module

%prep
%setup -q -n %{name}-%{upstream_version}
%patch0001 -p 1

# 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
export PYTHONPATH="$( pwd ):$PYTHONPATH"
pushd doc
sphinx-build -b html -d build/doctrees source build/html
popd
# 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

dos2unix doc/build/html/_static/jquery.js


%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 Jul 11 2017 Tang Cheng <[email protected]> 4.1.0-2
- Change python-six build requires from 1.9.0 to 1.7.0
- Add patch 0001-Fix-fallback-to-use-old-version-oslo-lib.patch

* Mon Sep 12 2016 Haikel Guemar <[email protected]> 4.1.0-1
- Update to 4.1.0

11 changes: 11 additions & 0 deletions packaging/python-cryptography/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
srpm_repo = http://192.168.2.65:11080/pulp/repos/rdo/openstack-juno/epel-7
base_srpm = python-cryptography-1.2.1-3.el7.src.rpm
spec_file = python-cryptography.spec

sources:
mv $(spec_file) $(spec_file).new
wget "$(srpm_repo)/$(base_srpm)" && \
rpm2cpio $(base_srpm) | cpio -idmv && \
rm -f $(spec_file) && \
mv $(spec_file).new $(spec_file) && \
rm -f $(base_srpm)
Loading