Commit cbab8f39 authored by Maciej Delmanowski's avatar Maciej Delmanowski

Merge branch 'drybjed-py3-future'

parents 4ad21425 a3061ecd
Pipeline #25859928 passed with stages
in 3 minutes and 51 seconds
......@@ -78,6 +78,14 @@ Added
.. __: http://www.dnspython.org/
- The DebOps installation now depends on the `future`__ Python library which
provides compatibility between Python 2.7 and Python 3.x environments. It is
currently used in the custom Ansible filter plugin provided by DebOps, but
its use will be extended to other scripts in the future to make the code more
readable.
.. __: http://python-future.org/
Changed
~~~~~~~
......
......@@ -34,6 +34,7 @@ RUN apt-get -q update \
levee \
python-apt \
python-dnspython \
python-future \
python-ldap \
python-pip \
python-wheel \
......
......@@ -112,6 +112,13 @@ can usually be installed using a system package manager.
.. __: https://docs.ansible.com/ansible/latest/ldap_attr_module.html
.. __: https://docs.ansible.com/ansible/latest/ldap_entry_module.html
`python-future`__
This module provides a compatibility layer between Python 2.7 and Python 3.x
versions. It allows creation of code that can be run in both old and new
Python environments without changes.
.. __: http://python-future.org/
`python-netaddr`__
This is a Python library which can be used to manipulate IP addresses in
different ways. It's used by the ``ipaddr()`` Ansible filter plugin used in
......
......@@ -24,7 +24,7 @@ pkgdesc="Your Debian-based data center in a box"
arch=('any')
url="https://github.com/debops/debops/"
license=('GPL3')
depends=('python' 'ansible' 'python-dnspython' 'python-netaddr' 'python-ldap' 'python-passlib' 'util-linux' 'encfs' 'gnupg')
depends=('python' 'ansible' 'python-dnspython' 'python-netaddr' 'python-ldap' 'python-passlib' 'python-future' 'util-linux' 'encfs' 'gnupg')
makedepends=('python-setuptools' 'git')
provides=('debops')
conflicts=('debops')
......
......@@ -259,6 +259,7 @@ EOF
make \
python-apt \
python-dnspython \
python-future \
python-jinja2 \
python-ldap \
python-nose2 \
......
......@@ -21,14 +21,9 @@
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
from past.builtins import basestring
from operator import itemgetter
try:
unicode = unicode
except NameError:
# py3
unicode = str
__metaclass__ = type
......@@ -42,7 +37,7 @@ def _parse_kv_value(current_data, new_data, data_index, *args, **kwargs):
old_state = current_data.get('state', 'present')
new_value = new_data.get('value')
if isinstance(new_value, (str, unicode, int, float, bool)):
if isinstance(new_value, (basestring, int, float, bool)):
if (old_value is None or isinstance(old_value,
(str, unicode, int,
float, bool, dict))):
......
......@@ -60,7 +60,7 @@ try:
name="debops",
version=unicode(RELEASE),
install_requires=['netaddr', 'argparse', 'passlib', 'ansible',
'python-ldap', 'dnspython'],
'python-ldap', 'dnspython', 'future'],
scripts=SCRIPTS,
packages=find_packages(exclude=['tests']),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment