Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
c0f81cc8
Commit
c0f81cc8
authored
Jul 11, 2017
by
Jeremy Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PLAT-1629 Retry abspath() failures
parent
165c0aae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletions
+29
-1
pavelib/utils/envs.py
+29
-1
No files found.
pavelib/utils/envs.py
View file @
c0f81cc8
...
...
@@ -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'
...
...
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