testing-mvp / services /service_by_name.py
Boris
services
1094f14
raw
history blame
1.25 kB
def get_service_by_name(service_name):
if service_name == "openvpn":
from services.openvpn.openvpn_service import OpenVPNService
return OpenVPNService()
if service_name == "corporate_email":
from services.corporate_email.corporate_email_service import CorporateEmailService
return CorporateEmailService()
if service_name == "internet_access":
from services.internet_access.internet_access_service import InternetAccessService
return InternetAccessService()
if service_name == "b2b":
from services.b2b.b2b_service import B2BService
return B2BService()
if service_name == "crm":
from services.crm.crm_service import CRMService
return CRMService()
if service_name == "one_c":
from services.one_c.one_c_service import OneCService
return OneCService()
if service_name == "borlas":
from services.borlas.borlas_service import BorlasService
return BorlasService()
if service_name == "print_and_scan":
from services.print_and_scan.print_and_scan_service import PrintAndScanService
return PrintAndScanService()
raise ValueError(f"Некорректное имя сервиса '{service_name}'")