fix: raise SitNotSpecifiedError via get_site

This commit is contained in:
Gavin D'souza 2020-06-01 12:43:41 +05:30
parent 079da0b645
commit 2149283fd1
2 changed files with 3 additions and 1 deletions

View file

@ -48,7 +48,7 @@ def get_site(context):
site = context.sites[0]
return site
except (IndexError, TypeError):
sys.exit(1)
raise frappe.SiteNotSpecifiedError
def popen(command, *args, **kwargs):
output = kwargs.get('output', True)

View file

@ -385,6 +385,8 @@ def mariadb(context):
import os
site = get_site(context)
if not site:
raise SiteNotSpecifiedError
frappe.init(site=site)
# This is assuming you're within the bench instance.