From eb8c4eaa01683f3c0008c4329cab2c006bbbc4d7 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 13 Jun 2019 10:17:24 -0500 Subject: [PATCH] assign a sane default to yum/dnf lock_timeout, in line with cli (#57383) * assign a sane default to yum/dnf lock_timeout, in line with cli Fixes #57189 Signed-off-by: Adam Miller * fix typo in changelog snippet Signed-off-by: Adam Miller (cherry picked from commit d2dc4c9bc43aae4e1b46098ac1e006fa3dda00ae) --- changelogs/fragments/yum-sane-default-lockfile-timeout.yml | 3 +++ lib/ansible/module_utils/yumdnf.py | 2 +- lib/ansible/modules/packaging/os/dnf.py | 2 +- lib/ansible/modules/packaging/os/yum.py | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/yum-sane-default-lockfile-timeout.yml diff --git a/changelogs/fragments/yum-sane-default-lockfile-timeout.yml b/changelogs/fragments/yum-sane-default-lockfile-timeout.yml new file mode 100644 index 0000000000..5cf8c2e833 --- /dev/null +++ b/changelogs/fragments/yum-sane-default-lockfile-timeout.yml @@ -0,0 +1,3 @@ +minor_changes: + - yum - set lock_timeout to a sane default (30 seconds, as is the cli) + - dnf - set lock_timeout to a sane default (30 seconds, as is the cli) diff --git a/lib/ansible/module_utils/yumdnf.py b/lib/ansible/module_utils/yumdnf.py index 0763446840..b3ed22bd24 100644 --- a/lib/ansible/module_utils/yumdnf.py +++ b/lib/ansible/module_utils/yumdnf.py @@ -46,7 +46,7 @@ yumdnf_argument_spec = dict( update_cache=dict(type='bool', default=False, aliases=['expire-cache']), update_only=dict(required=False, default="no", type='bool'), validate_certs=dict(type='bool', default=True), - lock_timeout=dict(type='int', default=0), + lock_timeout=dict(type='int', default=30), ), required_one_of=[['name', 'list', 'update_cache']], mutually_exclusive=[['name', 'list']], diff --git a/lib/ansible/modules/packaging/os/dnf.py b/lib/ansible/modules/packaging/os/dnf.py index c45a89ba42..995180667e 100644 --- a/lib/ansible/modules/packaging/os/dnf.py +++ b/lib/ansible/modules/packaging/os/dnf.py @@ -181,7 +181,7 @@ options: description: - Amount of time to wait for the dnf lockfile to be freed. required: false - default: 0 + default: 30 type: int version_added: "2.8" install_weak_deps: diff --git a/lib/ansible/modules/packaging/os/yum.py b/lib/ansible/modules/packaging/os/yum.py index 58aaf4f1a5..13e0967d85 100644 --- a/lib/ansible/modules/packaging/os/yum.py +++ b/lib/ansible/modules/packaging/os/yum.py @@ -187,7 +187,7 @@ options: description: - Amount of time to wait for the yum lockfile to be freed. required: false - default: 0 + default: 30 type: int version_added: "2.8" install_weak_deps: