From 83eb5d632d00b4b5fd590dbf1ff232457dd256fa Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sat, 4 Mar 2023 09:53:22 +0000 Subject: automatic import of python-ceph-deploy --- .gitignore | 1 + 0001-py2-to-py3.patch | 251 ++++++++++++++++++++++++++++++++++++++++++++++++ python-ceph-deploy.spec | 76 +++++++++++++++ sources | 1 + 4 files changed, 329 insertions(+) create mode 100644 0001-py2-to-py3.patch create mode 100644 python-ceph-deploy.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..7121af4 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/v2.1.0.tar.gz diff --git a/0001-py2-to-py3.patch b/0001-py2-to-py3.patch new file mode 100644 index 0000000..666c4a1 --- /dev/null +++ b/0001-py2-to-py3.patch @@ -0,0 +1,251 @@ +From 4cef3c285b8246e606ac8947a5d4341cd82c81ac Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 5 Sep 2022 09:05:03 +0000 +Subject: [PATCH] py2 to py3 + +--- + ceph_deploy/cli.py | 2 +- + ceph_deploy/hosts/debian/install.py | 2 +- + ceph_deploy/hosts/remotes.py | 2 +- + ceph_deploy/install.py | 2 +- + ceph_deploy/new.py | 2 +- + ceph_deploy/osd.py | 5 ++--- + ceph_deploy/tests/test_conf.py | 2 +- + ceph_deploy/tests/unit/hosts/test_remotes.py | 2 +- + ceph_deploy/tests/unit/test_conf.py | 2 +- + ceph_deploy/tests/unit/util/test_net.py | 4 ++-- + ceph_deploy/tests/util.py | 2 +- + ceph_deploy/util/log.py | 2 +- + ceph_deploy/util/net.py | 7 ++++--- + ceph_deploy/util/pkg_managers.py | 2 +- + ceph_deploy/util/versions.py | 2 +- + 15 files changed, 20 insertions(+), 20 deletions(-) + +diff --git a/ceph_deploy/cli.py b/ceph_deploy/cli.py +index ccd6df8..2243fb6 100644 +--- a/ceph_deploy/cli.py ++++ b/ceph_deploy/cli.py +@@ -30,7 +30,7 @@ def log_flags(args, logger=None): + logger = logger or LOG + logger.info('ceph-deploy options:') + +- for k, v in args.__dict__.items(): ++ for k, v in list(args.__dict__.items()): + if k.startswith('_'): + continue + logger.info(' %-30s: %s' % (k, v)) +diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py +index 1aa4431..fec1784 100644 +--- a/ceph_deploy/hosts/debian/install.py ++++ b/ceph_deploy/hosts/debian/install.py +@@ -1,7 +1,7 @@ + try: + from urllib.parse import urlparse + except ImportError: +- from urlparse import urlparse ++ from urllib.parse import urlparse + import logging + from ceph_deploy.util.paths import gpg + from ceph_deploy.util import net +diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py +index 049ebff..3be9b4e 100644 +--- a/ceph_deploy/hosts/remotes.py ++++ b/ceph_deploy/hosts/remotes.py +@@ -1,7 +1,7 @@ + try: + import configparser + except ImportError: +- import ConfigParser as configparser ++ import configparser as configparser + import errno + import socket + import os +diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py +index 12c5f79..ae6ef73 100644 +--- a/ceph_deploy/install.py ++++ b/ceph_deploy/install.py +@@ -84,7 +84,7 @@ def detect_components(args, distro): + return defaults + else: + components = [] +- for k, v in flags.items(): ++ for k, v in list(flags.items()): + if getattr(args, k, False): + components.append(v) + # if we have some components selected from flags then return that, +diff --git a/ceph_deploy/new.py b/ceph_deploy/new.py +index 842117b..b561e2f 100644 +--- a/ceph_deploy/new.py ++++ b/ceph_deploy/new.py +@@ -38,7 +38,7 @@ def ssh_copy_keys(hostname, username=None): + LOG.warning('could not connect via SSH') + + # Create the key if it doesn't exist: +- id_rsa_pub_file = os.path.expanduser(u'~/.ssh/id_rsa.pub') ++ id_rsa_pub_file = os.path.expanduser('~/.ssh/id_rsa.pub') + id_rsa_file = id_rsa_pub_file.split('.pub')[0] + if not os.path.exists(id_rsa_file): + LOG.info('creating a passwordless id_rsa.pub key file') +diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py +index cece242..1b46575 100644 +--- a/ceph_deploy/osd.py ++++ b/ceph_deploy/osd.py +@@ -75,7 +75,7 @@ def osd_tree(conn, cluster): + loaded_json = json.loads(''.join(out)) + # convert boolean strings to actual booleans because + # --format=json fails to do this properly +- for k, v in loaded_json.items(): ++ for k, v in list(loaded_json.items()): + if v == 'true': + loaded_json[k] = True + elif v == 'false': +@@ -128,7 +128,7 @@ def osd_status_check(conn, cluster): + loaded_json = json.loads(''.join(out)) + # convert boolean strings to actual booleans because + # --format=json fails to do this properly +- for k, v in loaded_json.items(): ++ for k, v in list(loaded_json.items()): + if v == 'true': + loaded_json[k] = True + elif v == 'false': +@@ -372,7 +372,6 @@ def disk_list(args, cfg): + command, + ) + for line in out: +- line = line.decode('utf-8') + if line.startswith('Disk /'): + distro.conn.logger.info(line) + +diff --git a/ceph_deploy/tests/test_conf.py b/ceph_deploy/tests/test_conf.py +index 8d435df..23ecb6f 100644 +--- a/ceph_deploy/tests/test_conf.py ++++ b/ceph_deploy/tests/test_conf.py +@@ -1,5 +1,5 @@ + try: +- from cStringIO import StringIO ++ from io import StringIO + except ImportError: + from io import StringIO + from ceph_deploy import conf +diff --git a/ceph_deploy/tests/unit/hosts/test_remotes.py b/ceph_deploy/tests/unit/hosts/test_remotes.py +index 69ee4f7..d459763 100644 +--- a/ceph_deploy/tests/unit/hosts/test_remotes.py ++++ b/ceph_deploy/tests/unit/hosts/test_remotes.py +@@ -1,5 +1,5 @@ + try: +- from cStringIO import StringIO ++ from io import StringIO + except ImportError: + from io import StringIO + +diff --git a/ceph_deploy/tests/unit/test_conf.py b/ceph_deploy/tests/unit/test_conf.py +index 685acbb..3280ec7 100644 +--- a/ceph_deploy/tests/unit/test_conf.py ++++ b/ceph_deploy/tests/unit/test_conf.py +@@ -1,5 +1,5 @@ + try: +- from cStringIO import StringIO ++ from io import StringIO + except ImportError: + from io import StringIO + from textwrap import dedent +diff --git a/ceph_deploy/tests/unit/util/test_net.py b/ceph_deploy/tests/unit/util/test_net.py +index 9c71bad..3c1120d 100644 +--- a/ceph_deploy/tests/unit/util/test_net.py ++++ b/ceph_deploy/tests/unit/util/test_net.py +@@ -1,10 +1,10 @@ + try: + from urllib.error import HTTPError + except ImportError: +- from urllib2 import HTTPError ++ from urllib.error import HTTPError + + try: +- from StringIO import StringIO ++ from io import StringIO + except ImportError: + from io import StringIO + +diff --git a/ceph_deploy/tests/util.py b/ceph_deploy/tests/util.py +index 50932da..ccecf66 100644 +--- a/ceph_deploy/tests/util.py ++++ b/ceph_deploy/tests/util.py +@@ -24,7 +24,7 @@ class Empty(object): + instantiation. + """ + def __init__(self, **kw): +- for k, v in kw.items(): ++ for k, v in list(kw.items()): + setattr(self, k, v) + + +diff --git a/ceph_deploy/util/log.py b/ceph_deploy/util/log.py +index c72303c..754f0bb 100644 +--- a/ceph_deploy/util/log.py ++++ b/ceph_deploy/util/log.py +@@ -1,7 +1,7 @@ + import logging + import sys + +-BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) ++BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = list(range(8)) + + COLORS = { + 'WARNING': YELLOW, +diff --git a/ceph_deploy/util/net.py b/ceph_deploy/util/net.py +index fe30efe..9f56b2f 100644 +--- a/ceph_deploy/util/net.py ++++ b/ceph_deploy/util/net.py +@@ -2,7 +2,8 @@ try: + from urllib.request import urlopen + from urllib.error import HTTPError + except ImportError: +- from urllib2 import urlopen, HTTPError ++ from urllib.request import urlopen ++ from urllib.error import HTTPError + + from ceph_deploy import exc + import logging +@@ -85,11 +86,11 @@ def ip_addresses(conn, interface=None, include_loopback=False): + if interface is None: + target_ifaces = ifaces + else: +- target_ifaces = dict((k, v) for k, v in ifaces.items() ++ target_ifaces = dict((k, v) for k, v in list(ifaces.items()) + if k == interface) + if not target_ifaces: + LOG.error('Interface {0} not found.'.format(interface)) +- for info in target_ifaces.values(): ++ for info in list(target_ifaces.values()): + for ipv4 in info.get('inet', []): + loopback = in_subnet('127.0.0.0/8', [ipv4.get('address')]) or ipv4.get('label') == 'lo' + if not loopback or include_loopback: +diff --git a/ceph_deploy/util/pkg_managers.py b/ceph_deploy/util/pkg_managers.py +index d05db5d..344d51c 100644 +--- a/ceph_deploy/util/pkg_managers.py ++++ b/ceph_deploy/util/pkg_managers.py +@@ -2,7 +2,7 @@ import os + try: + from urllib.parse import urlparse + except ImportError: +- from urlparse import urlparse ++ from urllib.parse import urlparse + + from ceph_deploy.lib import remoto + from ceph_deploy.util import templates +diff --git a/ceph_deploy/util/versions.py b/ceph_deploy/util/versions.py +index 810eb38..af2609d 100644 +--- a/ceph_deploy/util/versions.py ++++ b/ceph_deploy/util/versions.py +@@ -34,7 +34,7 @@ class NormalizedVersion(object): + + # safe int versions that remove non-numerical chars + # for example 'rc1' in a version like '1-rc1 +- for name, value in version_map.items(): ++ for name, value in list(version_map.items()): + if '-' in value: # get rid of garbage like -dev1 or -rc1 + value = value.split('-')[0] + value = float(''.join(c for c in value if c.isdigit()) or 0) +-- +2.33.0 + diff --git a/python-ceph-deploy.spec b/python-ceph-deploy.spec new file mode 100644 index 0000000..ac89936 --- /dev/null +++ b/python-ceph-deploy.spec @@ -0,0 +1,76 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ceph-deploy +Version: 2.1.0 +Release: 2 +Summary: Deploy Ceph with minimal infrastructure +License: MIT +URL: https://github.com/ceph/ceph-deploy +Source0: https://github.com/ceph/ceph-deploy/archive/refs/tags/v2.1.0.tar.gz +BuildArch: noarch +Patch1: 0001-py2-to-py3.patch + + +%description + + +%package -n python3-ceph-deploy +Summary: Deploy Ceph with minimal infrastructure +Provides: python-ceph-deploy +BuildRequires: python3-devel +BuildRequires: python3-setuptools +Requires: python3-remoto +%description -n python3-ceph-deploy + + +%package help +Summary: Development documents and examples for ceph-deploy +Provides: python3-ceph-deploy-doc +%description help + + +%prep +%autosetup -p1 -n ceph-deploy-2.1.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-ceph-deploy -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 13 2022 wangzengliang - 2.1.0-2 +- modify some code py2 to py3 + +* Wed Apr 13 2022 Python_Bot - 2.1.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..cfec6ab --- /dev/null +++ b/sources @@ -0,0 +1 @@ +2e5b96084fe616c248b639c06a3b5e3c v2.1.0.tar.gz -- cgit v1.2.3