Commit bdfccbfb by Matt Wright

Move conditional that accounts for variances in distros/versions to work when removing and adding.

parent 00c4c5c4
......@@ -39,6 +39,8 @@ def _find_binary(module):
'%s' % binaries)
def _run(cmd):
if platform.dist()[0] == 'debian' or float(platform.dist()[1]) >= 11.10:
cmd = cmd + ' -y'
# returns (rc, stdout, stderr) from shell command
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=True)
......@@ -72,9 +74,6 @@ def main():
cmd = '%s "%s"' % (add_apt_repository, repo)
if platform.dist()[0] == 'debian' or float(platform.dist()[1]) >= 11.10:
cmd = cmd + ' -y'
rc, out, err = _run(cmd)
changed = rc == 0 and not existed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment