Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
bdfccbfb
Commit
bdfccbfb
authored
Aug 30, 2012
by
Matt Wright
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move conditional that accounts for variances in distros/versions to work when removing and adding.
parent
00c4c5c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
library/apt_repository
+2
-3
No files found.
library/apt_repository
View file @
bdfccbfb
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment