| |
@@ -128,6 +128,16 @@
|
| |
with io.open(clog_file, 'w', encoding='utf-8') as f:
|
| |
f.write(os.linesep.join(self.fake_clog))
|
| |
|
| |
+ # Get 'bodhi_client' version. Particular versions have differences
|
| |
+ # across distributions.
|
| |
+ self.bodhi_version = None
|
| |
+ try:
|
| |
+ version_object = pkg_resources.get_distribution('bodhi_client')
|
| |
+ if version_object.has_version():
|
| |
+ self.bodhi_version = int(version_object.version.split('.')[0])
|
| |
+ except pkg_resources.DistributionNotFound:
|
| |
+ pass
|
| |
+
|
| |
def tearDown(self):
|
| |
if os.path.exists('bodhi.template'):
|
| |
os.unlink('bodhi.template')
|
| |
@@ -179,6 +189,7 @@
|
| |
expected_data = {
|
| |
'autokarma': 'True',
|
| |
'bugs': '1000,2000',
|
| |
+ 'display_name': six.u(''),
|
| |
'builds': ' {0} '.format(self.mock_nvr.return_value),
|
| |
'close_bugs': True,
|
| |
'request': 'testing',
|
| |
@@ -195,6 +206,11 @@
|
| |
else:
|
| |
expected_data['notes'] = self.fake_clog[0]
|
| |
|
| |
+ # there wasn't the option in older releases of bodhi, but these
|
| |
+ # releases are still active (epel7, epel8)
|
| |
+ if self.bodhi_version <= 4:
|
| |
+ del expected_data["display_name"]
|
| |
+
|
| |
with patch('os.unlink') as unlink:
|
| |
cli.update()
|
| |
|
| |
Bodhi version 5 adds 'display_name' option.
This change (first commit) already works as an active (released) patch. But its use required not to apply it into branches with older bodhi - epel7. When there is a requirement to have also epel8 (it has also an older version of bodhi), a separate update of branches is more and more complicated. Branches are more easily maintained when they are same. The second commit of the change makes unification of the branches possible.
During
fedpkg update
"display_name" option (when filled) is not working for older versions despite user can see it in the template.The goal is not to make conditions on bodhi versions in the product. It was acceptable in tests.