From 00ee2bc0a4706dfe7bd235cf07e29629d0d60b20 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 30 Mar 2021 22:21:50 +0500 Subject: [PATCH] bug fix clustermanager --- WebTerminal/CPWebSocket.py | 2 +- plogical/ClusterManager.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WebTerminal/CPWebSocket.py b/WebTerminal/CPWebSocket.py index 1b2ee7ee1..f7496c359 100644 --- a/WebTerminal/CPWebSocket.py +++ b/WebTerminal/CPWebSocket.py @@ -25,7 +25,7 @@ class SSHServer(multi.Thread): def findSSHPort(): try: - sshData = ProcessUtilities.outputExecutioner('cat /etc/ssh/sshd_config').readlines() + sshData = ProcessUtilities.outputExecutioner('cat /etc/ssh/sshd_config').split('\n') for items in sshData: if items.find('Port') > -1: diff --git a/plogical/ClusterManager.py b/plogical/ClusterManager.py index d2aecfd74..f8b8e6288 100644 --- a/plogical/ClusterManager.py +++ b/plogical/ClusterManager.py @@ -74,17 +74,21 @@ class ClusterManager: ProcessUtilities.executioner(command) if type == 'Child': + writeToFile = open(ClusterPath, 'w') writeToFile.write(config['ClusterConfigFailover']) + writeToFile.close() command = 'systemctl start mysql' ProcessUtilities.normalExecutioner(command) self.config['failoverServerMessage'] = 'Successfully attached to cluster. [200]' self.PostStatus() + else: writeToFile = open(ClusterPath, 'w') writeToFile.write(config['ClusterConfigMaster']) + writeToFile.close() command = 'galera_new_cluster' ProcessUtilities.normalExecutioner(command)