added service executable check, added error message to gui for service load errors

This commit is contained in:
Blake J. Harnden 2018-06-19 09:19:49 -07:00
parent e80736061f
commit bf47e5fc0d
10 changed files with 90 additions and 39 deletions

View file

@ -15,6 +15,7 @@ def load():
"""
Loads all services from the modules that reside under core.services.
:return: nothing
:return: list of services that failed to load
:rtype: list[str]
"""
ServiceManager.add_services(_PATH)
return ServiceManager.add_services(_PATH)

View file

@ -10,6 +10,7 @@ class Bird(CoreService):
Bird router support
"""
name = "bird"
executables = ("bird",)
group = "BIRD"
depends = ()
dirs = ("/etc/bird",)
@ -91,6 +92,7 @@ class BirdService(CoreService):
"""
name = None
executables = ("bird",)
group = "BIRD"
depends = ("bird",)
dirs = ()

View file

@ -113,6 +113,7 @@ class DockerService(CoreService):
node.
"""
name = "Docker"
executables = ("docker",)
group = "Docker"
depends = ()
dirs = ('/var/lib/docker/containers/', '/run/shm', '/run/resolvconf',)

View file

@ -11,14 +11,8 @@ class SdnService(CoreService):
"""
Parent class for SDN services.
"""
name = None
group = "SDN"
depends = ()
dirs = ()
configs = ()
startindex = 50
startup = ()
shutdown = ()
@classmethod
def generateconfig(cls, node, filename, services):
@ -27,6 +21,7 @@ class SdnService(CoreService):
class OvsService(SdnService):
name = "OvsService"
executables = ("ovs-ofctl", "ovs-vsctl")
group = "SDN"
depends = ()
dirs = ("/etc/openvswitch", "/var/run/openvswitch", "/var/log/openvswitch")
@ -101,6 +96,7 @@ class OvsService(SdnService):
class RyuService(SdnService):
name = "ryuService"
executables = ("ryu-manager",)
group = "SDN"
depends = ()
dirs = ()

View file

@ -12,6 +12,7 @@ class XorpRtrmgr(CoreService):
enabled XORP services, and launches necessary daemons upon startup.
"""
name = "xorp_rtrmgr"
executables = ("xorp_rtrmgr",)
group = "XORP"
depends = ()
dirs = ("/etc/xorp",)
@ -75,6 +76,7 @@ class XorpService(CoreService):
common to XORP's routing daemons.
"""
name = None
executables = ("xorp_rtrmgr",)
group = "XORP"
depends = ("xorp_rtrmgr",)
dirs = ()