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
2ad4d77c
Commit
2ad4d77c
authored
Oct 16, 2013
by
Yap Sok Ann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git: Remove unnecessary return code checking.
The functions either return rc=0 or call fail_json themselves.
parent
9af05f4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
library/source_control/git
+4
-10
No files found.
library/source_control/git
View file @
2ad4d77c
...
@@ -337,7 +337,7 @@ def main():
...
@@ -337,7 +337,7 @@ def main():
if
not
os
.
path
.
exists
(
gitconfig
):
if
not
os
.
path
.
exists
(
gitconfig
):
if
module
.
check_mode
:
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
module
.
exit_json
(
changed
=
True
)
(
rc
,
out
,
err
)
=
clone
(
git_path
,
module
,
repo
,
dest
,
remote
,
depth
,
version
)
clone
(
git_path
,
module
,
repo
,
dest
,
remote
,
depth
,
version
)
elif
not
update
:
elif
not
update
:
# Just return having found a repo already in the dest path
# Just return having found a repo already in the dest path
# this does no checking that the repo is the actual repo
# this does no checking that the repo is the actual repo
...
@@ -351,9 +351,7 @@ def main():
...
@@ -351,9 +351,7 @@ def main():
# if force, do a reset
# if force, do a reset
if
local_mods
and
module
.
check_mode
:
if
local_mods
and
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
,
msg
=
'Local modifications exist'
)
module
.
exit_json
(
changed
=
True
,
msg
=
'Local modifications exist'
)
(
rc
,
out
,
err
)
=
reset
(
git_path
,
module
,
dest
,
force
)
reset
(
git_path
,
module
,
dest
,
force
)
if
rc
!=
0
:
module
.
fail_json
(
msg
=
err
)
# exit if already at desired sha version
# exit if already at desired sha version
if
before
==
version
:
if
before
==
version
:
module
.
exit_json
(
changed
=
False
)
module
.
exit_json
(
changed
=
False
)
...
@@ -375,15 +373,11 @@ def main():
...
@@ -375,15 +373,11 @@ def main():
else
:
else
:
changed
=
False
changed
=
False
module
.
exit_json
(
changed
=
changed
,
before
=
before
,
after
=
remote_head
)
module
.
exit_json
(
changed
=
changed
,
before
=
before
,
after
=
remote_head
)
(
rc
,
out
,
err
)
=
fetch
(
git_path
,
module
,
repo
,
dest
,
version
,
remote
)
fetch
(
git_path
,
module
,
repo
,
dest
,
version
,
remote
)
if
rc
!=
0
:
module
.
fail_json
(
msg
=
err
)
# switch to version specified regardless of whether
# switch to version specified regardless of whether
# we cloned or pulled
# we cloned or pulled
(
rc
,
out
,
err
)
=
switch_version
(
git_path
,
module
,
dest
,
remote
,
version
)
switch_version
(
git_path
,
module
,
dest
,
remote
,
version
)
if
rc
!=
0
:
module
.
fail_json
(
msg
=
err
)
# determine if we changed anything
# determine if we changed anything
after
=
get_version
(
git_path
,
dest
)
after
=
get_version
(
git_path
,
dest
)
...
...
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