Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #107 from cr/issue106_hotfix
Browse files Browse the repository at this point in the history
Pinning OneCRL-Tools to a known-working commit
  • Loading branch information
cr authored Jul 13, 2017
2 parents 3577959 + 3798ad1 commit 1e072dd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup, find_packages

PACKAGE_NAME = 'tlscanary'
PACKAGE_VERSION = '3.1.0'
PACKAGE_VERSION = '3.1.1'

INSTALL_REQUIRES = [
'coloredlogs',
Expand Down
6 changes: 5 additions & 1 deletion tlscanary/modes/basemode.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def setup_args(cls, parser):
choices=["production", "stage", "custom"],
action="store",
default="production")
group.add_argument("--onecrlpin",
help="OneCRL-Tools git commit to use (default: 244e704)",
action="store",
default="244e704")
group.add_argument("-p", "--prefs",
help="Prefs to apply to all builds",
type=str,
Expand Down Expand Up @@ -228,7 +232,7 @@ def make_profile(self, profile_name, one_crl_env='production'):
logger.info("Updating OneCRL revocation data")
if one_crl_env == "production" or one_crl_env == "stage":
# overwrite revocations file in test profile with live OneCRL entries from requested environment
revocations_file = one_crl.get_list(one_crl_env, self.args.workdir)
revocations_file = one_crl.get_list(one_crl_env, self.args.workdir, self.args.onecrlpin)
profile_file = os.path.join(new_profile_dir, "revocations.txt")
logger.debug("Writing OneCRL revocations data to `%s`" % profile_file)
shutil.copyfile(revocations_file, profile_file)
Expand Down
1 change: 0 additions & 1 deletion tlscanary/modes/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from regression import RegressionMode
import tlscanary.runlog as rl
import tlscanary.report as report


logger = logging.getLogger(__name__)
Expand Down
18 changes: 16 additions & 2 deletions tlscanary/one_crl_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger = logging.getLogger(__name__)


def get_list(onecrl_env, workdir, use_cache=True, cache_timeout=60*60):
def get_list(onecrl_env, workdir, commit, use_cache=True, cache_timeout=60*60):
global logger

dc = cache.DiskCache(os.path.join(workdir, "cache"), cache_timeout, purge=True)
Expand All @@ -41,10 +41,24 @@ def get_list(onecrl_env, workdir, use_cache=True, cache_timeout=60*60):

# Install / update oneCRL2RevocationsTxt package
package = "github.com/mozmark/OneCRL-Tools/oneCRL2RevocationsTxt"
repo_dir = os.path.join(go_path, "src", "github.com", "mozmark", "OneCRL-Tools")
# If the packaga has already been downloaded, checkout master, else `go get` will fail
if os.path.isdir(os.path.join(repo_dir, ".git")):
logger.debug("Checking out commit `master` in `%s` for update" % repo_dir)
if subprocess.call(["git", "checkout", "-q", "master"], cwd=repo_dir) != 0:
logger.critical("Cannot checkout OneCRL-Tools git commit `master`")
sys.exit(5)
# `go get` internally uses `git pull`. `-d` prevents installation
logger.debug("Installing / updating Go package `%s`" % package)
if subprocess.call([go_bin, "get", "-u", package], env=go_env) != 0:
if subprocess.call([go_bin, "get", "-u", "-d", package], env=go_env) != 0:
logger.critical("Cannot get Go package `%s`" % package)
sys.exit(5)
# Checkout a known-working commit before installation
logger.debug("Checking out commit `%s` in `%s`" % (commit, repo_dir))
if subprocess.call(["git", "checkout", "-q", commit], cwd=repo_dir) != 0:
logger.critical("Cannot checkout OneCRL-Tools git commit `%s`" % commit)
sys.exit(5)
# Install package
if subprocess.call([go_bin, "install", package], env=go_env) != 0:
logger.critical("Cannot install Go package `%s`" % package)
sys.exit(5)
Expand Down

0 comments on commit 1e072dd

Please sign in to comment.