From 87907d4ce8e7a762f231bc54d3b849eb706efcd8 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 19 Jun 2019 10:45:14 -0400 Subject: [PATCH] Remove size field from volume objects This data is just in the stats anyways. --- node-daemon/pvcd/CephInstance.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/node-daemon/pvcd/CephInstance.py b/node-daemon/pvcd/CephInstance.py index e92b0c1e..19a0feba 100644 --- a/node-daemon/pvcd/CephInstance.py +++ b/node-daemon/pvcd/CephInstance.py @@ -457,24 +457,8 @@ class CephVolumeInstance(object): self.this_node = this_node self.pool = pool self.name = name - self.size = '' self.stats = dict() - @self.zk_conn.DataWatch('/ceph/volumes/{}/{}/size'.format(self.pool, self.name)) - def watch_volume_node(data, stat, event=''): - if event and event.type == 'DELETED': - # The key has been deleted after existing before; terminate this watcher - # because this class instance is about to be reaped in Daemon.py - return False - - try: - data = data.decode('ascii') - except AttributeError: - data = '' - - if data and data != self.size: - self.size = data - @self.zk_conn.DataWatch('/ceph/volumes/{}/{}/stats'.format(self.pool, self.name)) def watch_volume_stats(data, stat, event=''): if event and event.type == 'DELETED': @@ -511,7 +495,6 @@ def add_volume(zk_conn, logger, pool, name, size): # Add the new volume to ZK zkhandler.writedata(zk_conn, { '/ceph/volumes/{}/{}'.format(pool, name): '', - '/ceph/volumes/{}/{}/size'.format(pool, name): size, '/ceph/volumes/{}/{}/stats'.format(pool, name): volstats, '/ceph/snapshots/{}/{}'.format(pool, name): '', })