Skip to content
Permalink
Browse files

Add api version

* must be increased while addin handlers, or changing handler prototypes
* api version change must involve a 'npm version major' in cluster manager
  • Loading branch information...
arnaudveron committed Jul 29, 2019
1 parent 33ea9c2 commit 9c558931141f9ea0bc6fbbb9bc7cbb6efdd87cee
Showing with 6 additions and 2 deletions.
  1. +2 −2 lib/osvcd.py
  2. +1 −0 lib/osvcd_mon.py
  3. +3 −0 lib/osvcd_shared.py
@@ -191,8 +191,8 @@ def write_pid(self):

def init(self):
shared.NODE = node_mod.Node()
self.log.info("daemon started, version %s, crypto mod %s",
shared.NODE.agent_version, CRYPTO_MODULE)
self.log.info("daemon started, version %s, crypto mod %s, api version %s",
shared.NODE.agent_version, CRYPTO_MODULE, shared.API_VERSION)

def loop_forever(self):
"""
@@ -101,6 +101,7 @@ def init(self):
with shared.CLUSTER_DATA_LOCK:
shared.CLUSTER_DATA[rcEnv.nodename] = {
"compat": shared.COMPAT_VERSION,
"api": shared.API_VERSION,
"agent": shared.NODE.agent_version,
"monitor": dict(shared.NMON_DATA),
"labels": shared.NODE.labels,
@@ -37,6 +37,9 @@
# ours
COMPAT_VERSION = 10

# expose api handlers version
API_VERSION = 1

# node and cluster conf lock to block reading changes during a multi-write
# transaction (ex daemon join)
CONFIG_LOCK = threading.RLock()

0 comments on commit 9c55893

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