Skip to content
Permalink
Browse files

Don't run boot on object kinds other than svc and vol

No useful and avoids usr, cfg, sec object to report a call for
an unimplemented action.
  • Loading branch information...
cvaroqui committed Jul 29, 2019
1 parent 03eb23d commit c874693d56c2058dc27c195ebcde94bc0b596071
Showing with 13 additions and 4 deletions.
  1. +1 −1 lib/osvcd_mon.py
  2. +12 −3 lib/rcUtilities.py
@@ -706,7 +706,7 @@ def services_init_status(self):
)

def services_init_boot(self):
proc = self.service_command(",".join(list_services()), ["boot", "--parallel"])
proc = self.service_command(",".join(list_services(kinds=["vol", "svc"])), ["boot", "--parallel"])
self.push_proc(
proc=proc,
on_success="services_init_status_callback",
@@ -1153,7 +1153,7 @@ def daemon_test_lock():
#
#############################################################################

def is_service(f, namespace=None, data=None, local=False):
def is_service(f, namespace=None, data=None, local=False, kinds=None):
if f is None:
return
f = re.sub(".conf$", "", f)
@@ -1162,6 +1162,8 @@ def is_service(f, namespace=None, data=None, local=False):
name, namespace, kind = split_path(f)
except ValueError:
return
if kinds and kind not in kinds:
return
path = fmt_path(name, namespace, kind)
if not local:
try:
@@ -1175,14 +1177,14 @@ def is_service(f, namespace=None, data=None, local=False):
return
return path

def list_services(namespace=None):
def list_services(namespace=None, kinds=None):
l = []
if namespace in (None, "root"):
for name in glob_root_config():
s = name[:-5]
if len(s) == 0:
continue
path = is_service(name)
path = is_service(name, kinds=kinds)
if path is None:
continue
l.append(path)
@@ -1191,6 +1193,13 @@ def list_services(namespace=None):
path = path[n:-5]
if path[-1] == os.sep:
continue
if kinds:
try:
name, namespace, kind = split_path(path)
except ValueError:
continue
if kind not in kinds:
continue
l.append(path)
return l

0 comments on commit c874693

Please sign in to comment.
You can’t perform that action at this time.