mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-26 17:29:05 +01:00
bug fix clustermanager
This commit is contained in:
@@ -21,7 +21,6 @@ class ClusterManager:
|
||||
##
|
||||
self.config = json.loads(open(ClusterManager.ClusterFile, 'r').read())
|
||||
|
||||
|
||||
def PostStatus(self):
|
||||
finalData = json.dumps(self.config)
|
||||
resp = requests.post(ClusterManager.LogURL, data=finalData, verify=False)
|
||||
@@ -36,6 +35,7 @@ class ClusterManager:
|
||||
|
||||
def DetechFromCluster(self, type):
|
||||
try:
|
||||
|
||||
command = 'rm -rf %s' % (self.FetchMySQLConfigFile())
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
@@ -70,8 +70,10 @@ class ClusterManager:
|
||||
command = 'systemctl stop mysql'
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
if type == 'Child':
|
||||
command = 'rm -rf %s' % (ClusterConfigPath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if type == 'Child':
|
||||
writeToFile = open(ClusterPath, 'w')
|
||||
writeToFile.write(config['ClusterConfigFailover'])
|
||||
|
||||
@@ -81,7 +83,6 @@ class ClusterManager:
|
||||
self.config['failoverServerMessage'] = 'Successfully attached to cluster. [200]'
|
||||
self.PostStatus()
|
||||
else:
|
||||
|
||||
writeToFile = open(ClusterPath, 'w')
|
||||
writeToFile.write(config['ClusterConfigMaster'])
|
||||
|
||||
@@ -91,6 +92,11 @@ class ClusterManager:
|
||||
self.config['masterServerMessage'] = 'Successfully attached to cluster. [200]'
|
||||
self.PostStatus()
|
||||
|
||||
###
|
||||
|
||||
command = 'rm -rf %s' % (ClusterConfigPath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
except BaseException as msg:
|
||||
if type == 'Child':
|
||||
self.config['failoverServerMessage'] = 'Failed to attach, error %s [404].' % (str(msg))
|
||||
|
||||
Reference in New Issue
Block a user