Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
da32c5af
Commit
da32c5af
authored
7 years ago
by
Jeremy Bowman
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15531 from edx/jmbowman/PLAT-1629
PLAT-1629 Retry abspath() failures
parents
c3e1d592
c0f81cc8
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pavelib/utils/envs.py
+29
-1
29 additions, 1 deletion
pavelib/utils/envs.py
with
29 additions
and
1 deletion
pavelib/utils/envs.py
+
29
−
1
View file @
da32c5af
...
...
@@ -6,6 +6,7 @@ from __future__ import print_function
import
json
import
os
import
sys
from
time
import
sleep
import
memcache
from
lazy
import
lazy
...
...
@@ -15,13 +16,40 @@ from paver.easy import sh
from
pavelib.utils.cmd
import
django_cmd
def
repo_root
():
"""
Get the root of the git repository (edx-platform).
This sometimes fails on Docker Devstack, so it
'
s been broken
down with some additional error handling. It usually starts
working within 30 seconds or so; for more details, see
https://openedx.atlassian.net/browse/PLAT-1629 and
https://github.com/docker/for-mac/issues/1509
"""
file_path
=
path
(
__file__
)
attempt
=
1
while
True
:
try
:
absolute_path
=
file_path
.
abspath
()
break
except
OSError
:
print
(
'
Attempt {}/60 to get an absolute path failed
'
.
format
(
attempt
))
if
attempt
<=
60
:
attempt
+=
1
sleep
(
1
)
else
:
print
(
'
Unable to determine the absolute path of the edx-platform repo, aborting
'
)
raise
return
absolute_path
.
parent
.
parent
.
parent
class
Env
(
object
):
"""
Load information about the execution environment.
"""
# Root of the git repository (edx-platform)
REPO_ROOT
=
path
(
__file__
).
abspath
().
parent
.
parent
.
parent
REPO_ROOT
=
repo_root
()
# Reports Directory
REPORT_DIR
=
REPO_ROOT
/
'
reports
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment