refactored how services are loaded to be more dynamic
This commit is contained in:
parent
35c48e67a3
commit
850cc599c8
4 changed files with 53 additions and 68 deletions
|
@ -4,17 +4,20 @@ Services
|
|||
Services available to nodes can be put in this directory. Everything listed in
|
||||
__all__ is automatically loaded by the main core module.
|
||||
"""
|
||||
import os
|
||||
|
||||
__all__ = [
|
||||
"quagga",
|
||||
"nrl",
|
||||
"xorp",
|
||||
"bird",
|
||||
"utility",
|
||||
"security",
|
||||
"ucarp",
|
||||
"dockersvc",
|
||||
"OvsService",
|
||||
"RyuService",
|
||||
"startup"
|
||||
]
|
||||
from core.misc import log
|
||||
from core.service import ServiceManager
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
|
||||
_PATH = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
|
||||
def load():
|
||||
"""
|
||||
Loads all services from the modules that reside under core.services.
|
||||
|
||||
:return: nothing
|
||||
"""
|
||||
ServiceManager.add_services(_PATH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue