1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

deploy_helper: fix a bug when not defining release on state=clean (#1859) (#1877)

* Fix a bug when not defining release on state=clean

* Add changelog fragment

(cherry picked from commit abfbe2a48d)

Co-authored-by: Ramon de la Fuente <ramon@future500.nl>
This commit is contained in:
patchback[bot] 2021-02-22 09:29:36 +01:00 committed by GitHub
parent 76a64ea733
commit 0cf2a5ad05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- deploy_helper - allow ``state=clean`` to be used without defining a ``release`` (https://github.com/ansible-collections/community.general/issues/1852).

View file

@ -408,6 +408,9 @@ class DeployHelper(object):
def remove_unfinished_link(self, path):
changed = False
if not self.release:
return changed
tmp_link_name = os.path.join(path, self.release + '.' + self.unfinished_filename)
if not self.module.check_mode and os.path.exists(tmp_link_name):
changed = True