toaster: support custom Layer Index URL and fixture override
Submitted by Reyna, David on Aug. 21, 2017, 3:54 a.m.
|
Patch ID: 143083
Details
Commit Message
@@ -75,7 +75,10 @@ class Command(BaseCommand):
call_command("loaddata", "settings")
template_conf = os.environ.get("TEMPLATECONF", "")
- if "poky" in template_conf:
+ if ToasterSetting.objects.filter(name='CUSTOM_XML_ONLY').count() > 0:
+ # only use the custom settings
+ pass
+ elif "poky" in template_conf:
print("Loading poky configuration")
call_command("loaddata", "poky")
else:
@@ -81,6 +81,8 @@ class Command(BaseCommand):
os.system('setterm -cursor off')
self.apiurl = DEFAULT_LAYERINDEX_SERVER
+ if ToasterSetting.objects.filter(name='CUSTOM_LAYERINDEX_SERVER').count() == 1:
+ self.apiurl = ToasterSetting.objects.get(name = 'CUSTOM_LAYERINDEX_SERVER').value
assert self.apiurl is not None
try:
@@ -92,7 +94,9 @@ class Command(BaseCommand):
proxy_settings = os.environ.get("http_proxy", None)
- def _get_json_response(apiurl=DEFAULT_LAYERINDEX_SERVER):
+ def _get_json_response(apiurl=None):
+ if None == apiurl:
+ apiurl=self.apiurl
http_progress = Spinner()
http_progress.start()