Change default translation for py2 in RDO

RDO does not have python2-foo packages for everything but python2-foo
packages usually Provides python-foo packages. So change the default
translation for python2 packages to python-foo (instead of
python2-foo).

Change-Id: I51cacf2de8fd108b224f442bd760fa8ba43daec9
This commit is contained in:
Thomas Bechtold 2017-10-11 14:40:14 +02:00
parent a5858acd90
commit 9eb8f76e64
2 changed files with 6 additions and 2 deletions

View File

@ -79,7 +79,7 @@ def default_rdo_tr(mod):
pkg = pkg.replace('_', '-').replace('.', '-').lower()
if not pkg.startswith('python-'):
pkg = 'python-' + pkg
py2pkg = re.sub('python', 'python2', pkg)
py2pkg = pkg
py3pkg = re.sub('python', 'python3', pkg)
return (pkg, py2pkg, py3pkg)

View File

@ -150,7 +150,11 @@ class Pymod2PkgTests(unittest.TestCase):
def test_default_translation_py2py3_rdo(self):
self.assertEqual(pymod2pkg.module2package('oslo.db', 'fedora',
py_vers=['py2', 'py3']),
['python2-oslo-db', 'python3-oslo-db'])
['python-oslo-db', 'python3-oslo-db'])
self.assertEqual(pymod2pkg.module2package('foobar', 'fedora',
py_vers=['py', 'py2', 'py3']),
['python-foobar', 'python-foobar', 'python3-foobar'])
self.assertEqual(pymod2pkg.module2package('Babel', 'fedora',
py_vers=['py2', 'py3']),
['python-babel', 'python3-babel'])