[PR #10523/a96684ef backport][stable-11] bzr: command args as list rather than string (#10587)

bzr: command args as list rather than string (#10523)

* bzr: command args as list rather than string

* add changelog frag

(cherry picked from commit a96684ef40)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-08-04 20:50:30 +02:00 committed by GitHub
commit 124f465819
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- bzr - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10523).

View file

@ -80,7 +80,7 @@ class Bzr(object):
def get_version(self):
'''samples the version of the bzr branch'''
cmd = "%s revno" % self.bzr_path
cmd = [self.bzr_path, "revno"]
rc, stdout, stderr = self.module.run_command(cmd, cwd=self.dest)
revno = stdout.strip()
return revno
@ -100,7 +100,7 @@ class Bzr(object):
def has_local_mods(self):
cmd = "%s status -S" % self.bzr_path
cmd = [self.bzr_path, "status", "-S"]
rc, stdout, stderr = self.module.run_command(cmd, cwd=self.dest)
lines = stdout.splitlines()