From 705ec055040268f876d04fe5743a6ce4738d6e02 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 21 Jun 2017 12:56:14 +0530 Subject: geo-rep: Refactoring Config and Arguments parsing - Fixed Python pep8 issues - Removed dead code - Rewritten configuration management - Rewritten Arguments/subcommands handling - Added Args upgrade to accommodate all these changes without changing glusterd code - use of md5 removed, which was used to hash the brick path for workdir Both Master and Slave nodes will have subdir for session in the format "__ $GLUSTER_LOGDIR/geo-replication/__ $GLUSTER_LOGDIR/geo-replication-slaves/__ Log file paths renamed since session info is available with directory name itself. $LOG_DIR_MASTER/ - gsyncd.log - Gsyncd, Worker monitor logs - mnt-.log - Aux mount logs, mounted by each worker - changes-.log - Changelog related logs(One per brick) $LOG_DIR_SLAVE/ - gsyncd.log - Slave Gsyncd logs - mnt--.log - Aux mount logs, mounted for each connection from master-node:master-brick - mnt-mbr--.log - Same as above, but mountbroker setup Fixes: #73 Change-Id: I2ec2a21e4e2a92fd92899d026e8543725276f021 Signed-off-by: Aravinda VK --- geo-replication/syncdaemon/rconf.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 geo-replication/syncdaemon/rconf.py (limited to 'geo-replication/syncdaemon/rconf.py') diff --git a/geo-replication/syncdaemon/rconf.py b/geo-replication/syncdaemon/rconf.py new file mode 100644 index 00000000000..1b8f333c0c8 --- /dev/null +++ b/geo-replication/syncdaemon/rconf.py @@ -0,0 +1,34 @@ +# +# Copyright (c) 2011-2014 Red Hat, Inc. +# This file is part of GlusterFS. + +# This file is licensed to you under your choice of the GNU Lesser +# General Public License, version 3 or any later version (LGPLv3 or +# later), or the GNU General Public License, version 2 (GPLv2), in all +# cases as published by the Free Software Foundation. +# + + +class RConf(object): + + """singleton class to store runtime globals + shared between gsyncd modules""" + + ssh_ctl_dir = None + ssh_ctl_args = None + cpid = None + pid_file_owned = False + log_exit = False + permanent_handles = [] + log_metadata = {} + """One variable is sufficient to track the + switching of worker to ACTIVE. Two variables + are intentionally used to track worker going + to PASSIVE as well mainly for debugging""" + active_earlier = False + passive_earlier = False + mgmt_lock_fd = None + args = None + turns = 0 + +rconf = RConf() -- cgit