fix: raise SitNotSpecifiedError via get_site
This commit is contained in:
parent
079da0b645
commit
2149283fd1
2 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue