Commit 7af363f6 authored by Jameson Rollins's avatar Jameson Rollins

Fix bug in worker manager OK check for Node objects

Was assuming that all managers are NodeManager.  But the system allows
specifying Node objects as well, so we need to support that here
(or disallow).
parent 87693f0c
......@@ -22,6 +22,7 @@ from .db import WORKER_STATUS
from .log import StateLogger
from .shmem import SharedMemEnum, SharedMemString
from .const import USERMSG_STRING_LENGTH, USERMSG_COUNT, STATE_NAME_LENGTH, SPM_DIFF_COUNT
from .manager import Node, NodeManager
############################################################
......@@ -454,8 +455,14 @@ class Worker(multiprocessing.Process):
# make sure all nodes are initialized (node.init() is idempotent)
mngr.init()
# count subordinates nodes
subnodes_total |= set(mngr.nodes.keys())
subnodes_not_ok |= mngr.not_ok()
# FIXME: clean up the interfaces to make this simpler
if isinstance(mngr, Node):
subnodes_total.add(mngr.name)
if not mngr.OK:
subnodes_not_ok.add(mngr.name)
elif isinstance(mngr, NodeManager):
subnodes_total |= set(mngr.nodes.keys())
subnodes_not_ok |= mngr.not_ok()
# FIXME: should we be running check_fault() here?
self['SUBNODES_TOTAL'] = len(subnodes_total)
self['SUBNODES_NOT_OK'] = len(subnodes_not_ok)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment