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

* bzr: command args as list rather than string

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-08-05 06:00:30 +12:00 committed by GitHub
commit a96684ef40
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): def get_version(self):
'''samples the version of the bzr branch''' '''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) rc, stdout, stderr = self.module.run_command(cmd, cwd=self.dest)
revno = stdout.strip() revno = stdout.strip()
return revno return revno
@ -100,7 +100,7 @@ class Bzr(object):
def has_local_mods(self): 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) rc, stdout, stderr = self.module.run_command(cmd, cwd=self.dest)
lines = stdout.splitlines() lines = stdout.splitlines()