mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 14:18:34 +00:00
validate:launcher: Give information to users when cloning asset failed
It might not be obvious from the stacktrace so it is better to clearly explain what the failure was when we know it
This commit is contained in:
parent
6beb346aa3
commit
89aa70545a
1 changed files with 46 additions and 10 deletions
|
@ -24,6 +24,7 @@ import loggable
|
||||||
import argparse
|
import argparse
|
||||||
import textwrap
|
import textwrap
|
||||||
import reporters
|
import reporters
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
from httpserver import HTTPServer
|
from httpserver import HTTPServer
|
||||||
|
@ -132,6 +133,44 @@ QA_ASSETS = "gst-qa-assets"
|
||||||
MEDIAS_FOLDER = "medias"
|
MEDIAS_FOLDER = "medias"
|
||||||
DEFAULT_GST_QA_ASSETS_REPO = "git://people.freedesktop.org/~tsaunier/gst-qa-assets/"
|
DEFAULT_GST_QA_ASSETS_REPO = "git://people.freedesktop.org/~tsaunier/gst-qa-assets/"
|
||||||
|
|
||||||
|
def update_assets(options):
|
||||||
|
try:
|
||||||
|
launch_command("cd %s && %s" % (options.clone_dir,
|
||||||
|
options.update_assets_command),
|
||||||
|
fails=True)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
if "annex" in options.update_assets_command:
|
||||||
|
m = "\n\nMAKE SURE YOU HAVE git-annex INSTALLED!"
|
||||||
|
else:
|
||||||
|
m = ""
|
||||||
|
|
||||||
|
printc("Could not update assets repository\n\nError: %s%s" %(e, m),
|
||||||
|
Colors.FAIL, True)
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def download_assets(options):
|
||||||
|
try:
|
||||||
|
launch_command("%s %s %s" % (options.get_assets_command,
|
||||||
|
options.remote_assets_url,
|
||||||
|
options.clone_dir),
|
||||||
|
fails=True)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
if "git" in options.get_assets_command:
|
||||||
|
m = "\n\nMAKE SURE YOU HAVE git INSTALLED!"
|
||||||
|
else:
|
||||||
|
m = ""
|
||||||
|
|
||||||
|
printc("Could not download assets\n\nError: %s%s" %(e, m),
|
||||||
|
Colors.FAIL, True)
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
class PrintUsage(argparse.Action):
|
class PrintUsage(argparse.Action):
|
||||||
def __init__(self, option_strings, dest=argparse.SUPPRESS, default=argparse.SUPPRESS, help=None):
|
def __init__(self, option_strings, dest=argparse.SUPPRESS, default=argparse.SUPPRESS, help=None):
|
||||||
super(PrintUsage, self).__init__(option_strings=option_strings, dest=dest,
|
super(PrintUsage, self).__init__(option_strings=option_strings, dest=dest,
|
||||||
|
@ -304,17 +343,14 @@ user argument, you can thus overrides command line options using that.
|
||||||
|
|
||||||
if options.remote_assets_url and options.sync:
|
if options.remote_assets_url and options.sync:
|
||||||
if os.path.exists(options.clone_dir):
|
if os.path.exists(options.clone_dir):
|
||||||
launch_command("cd %s && %s" % (options.clone_dir,
|
if not update_assets(options):
|
||||||
options.update_assets_command),
|
exit(1)
|
||||||
fails=True)
|
|
||||||
else:
|
else:
|
||||||
launch_command("%s %s %s" % (options.get_assets_command,
|
if not download_assets(options):
|
||||||
options.remote_assets_url,
|
exit(1)
|
||||||
options.clone_dir),
|
|
||||||
fails=True)
|
if not update_assets(options):
|
||||||
launch_command("cd %s && %s" % (options.clone_dir,
|
exit(1)
|
||||||
options.update_assets_command),
|
|
||||||
fails=True)
|
|
||||||
|
|
||||||
# Ensure that the scenario manager singleton is ready to be used
|
# Ensure that the scenario manager singleton is ready to be used
|
||||||
ScenarioManager().config = options
|
ScenarioManager().config = options
|
||||||
|
|
Loading…
Reference in a new issue