Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
0e3b4bad
Commit
0e3b4bad
authored
6 years ago
by
Michael Youngstrom
Browse files
Options
Downloads
Patches
Plain Diff
Use s3 db cache on devstack
parent
5b1a2625
Branches
Branches containing commit
Tags
release-2020-07-02-00.53
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pavelib/utils/db_utils.py
+9
-3
9 additions, 3 deletions
pavelib/utils/db_utils.py
pavelib/utils/test/suites/bokchoy_suite.py
+2
-7
2 additions, 7 deletions
pavelib/utils/test/suites/bokchoy_suite.py
with
11 additions
and
10 deletions
pavelib/utils/db_utils.py
+
9
−
3
View file @
0e3b4bad
...
...
@@ -125,11 +125,17 @@ def does_fingerprint_on_disk_match(fingerprint):
def
is_fingerprint_in_bucket
(
fingerprint
,
bucket_name
):
"""
Test if a zip file matching the given fingerprint is present within an s3 bucket
Test if a zip file matching the given fingerprint is present within an s3 bucket.
If there is any issue reaching the bucket, show the exception but continue by
returning False
"""
zipfile_name
=
'
{}.tar.gz
'
.
format
(
fingerprint
)
conn
=
boto
.
connect_s3
(
anon
=
True
)
bucket
=
conn
.
get_bucket
(
bucket_name
)
try
:
conn
=
boto
.
connect_s3
(
anon
=
True
)
bucket
=
conn
.
get_bucket
(
bucket_name
)
except
Exception
as
e
:
# pylint: disable=broad-except
print
(
"
Exception caught trying to reach S3 bucket {}: {}
"
.
format
(
bucket_name
,
e
))
return
False
key
=
boto
.
s3
.
key
.
Key
(
bucket
=
bucket
,
name
=
zipfile_name
)
return
key
.
exists
()
...
...
This diff is collapsed.
Click to expand it.
pavelib/utils/test/suites/bokchoy_suite.py
+
2
−
7
View file @
0e3b4bad
...
...
@@ -136,14 +136,9 @@ def reset_test_database():
"""
Reset the database used by the bokchoy tests.
If the tests are being run on Jenkins, use the database cache automation
defined in pavelib/database.py
If not, reset the test database and apply migrations
Use the database cache automation defined in pavelib/database.py
"""
if
os
.
environ
.
get
(
'
USER
'
,
None
)
==
'
jenkins
'
:
update_local_bokchoy_db_from_s3
()
# pylint: disable=no-value-for-parameter
else
:
sh
(
"
{}/scripts/reset-test-db.sh --migrations
"
.
format
(
Env
.
REPO_ROOT
))
update_local_bokchoy_db_from_s3
()
# pylint: disable=no-value-for-parameter
@task
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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