Skip to content

Commit

Permalink
Add ordered nodes and drpnodes properties to the Svc class
Browse files Browse the repository at this point in the history
Those will be used by osvcd to give priorities to services nodes.
  • Loading branch information
cvaroqui committed Jun 13, 2017
1 parent 222a011 commit d9cdd7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/svc.py
Expand Up @@ -370,7 +370,9 @@ def __init__(self, svcname=None):
self.show_disabled = False
self.svc_env = rcEnv.node_env
self.nodes = set([rcEnv.nodename])
self.ordered_nodes = [rcEnv.nodename]
self.drpnodes = set()
self.ordered_drpnodes = []
self.drpnode = ""
self.encapnodes = set()
self.flex_primary = ""
Expand Down
2 changes: 2 additions & 0 deletions lib/svcBuilder.py
Expand Up @@ -3078,6 +3078,7 @@ def build(name, minimal=False, svcconf=None):
nodes = [n.lower() for n in svc.conf_get_string_scope('DEFAULT', "nodes").split() if n != ""]
except ex.OptNotFound:
nodes = [rcEnv.nodename]
svc.ordered_nodes = nodes
svc.nodes = set(nodes)

try:
Expand All @@ -3091,6 +3092,7 @@ def build(name, minimal=False, svcconf=None):
drpnodes.append(drpnode)
except ex.OptNotFound:
drpnode = ''
svc.ordered_drpnodes = drpnodes
svc.drpnodes = set(drpnodes)

try:
Expand Down

0 comments on commit d9cdd7a

Please sign in to comment.