Skip to content

Commit 6c02695

Browse files
committed
Avoid duplicate transaction IDs, which cause cleanup failures
If `pkg` is already installed but `core.rpm_is_installed()` doesn't catch it (if the pkg is by dependency instead of name, for example), then yum will do nothing and not create a new transaction. - Catch this ("Nothing to do." in the output) and don't add a new transaction ID to the list. - Also just avoid adding a transaction ID if it's already in the list.
1 parent 4936360 commit 6c02695

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

osgtest/tests/special_install.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ def test_02_install_packages(self):
5757
command += ['install', pkg]
5858

5959
retry_fail, _, stdout, _ = yum.retry_command(command)
60-
if retry_fail == '': # the command succeeded
61-
core.state['install.transaction_ids'].append(yum.get_transaction_id())
60+
if retry_fail == '' and 'Nothing to do.' not in stdout: # the command succeeded
61+
id = yum.get_transaction_id()
62+
if id not in core.state['install.transaction_ids']:
63+
core.state['install.transaction_ids'].append(id)
6264
if not pkg.startswith("/"):
6365
# ^^ rpm --verify doesn't work if you asked for a file instead of a package
6466
command = ('rpm', '--verify', pkg)

0 commit comments

Comments
 (0)