!11 添加openGauss restart命令

Merge pull request !11 from 刘珲/restart
This commit is contained in:
opengauss-bot 2020-12-31 08:04:33 +08:00 committed by Gitee
commit e991600e7b
2 changed files with 13 additions and 1 deletions

View File

@ -38,6 +38,7 @@ from gspylib.common.VersionInfo import VersionInfo
# action type
ACTION_START = "start"
ACTION_STOP = "stop"
ACTION_RESTART = "restart"
ACTION_STATUS = "status"
ACTION_REBUID = "generateconf"
ACTION_CERT = "cert"
@ -124,6 +125,8 @@ Usage:
[--security-mode=MODE] [-l LOGFILE]
gs_om -t stop [-h HOSTNAME] [-D dataDir] [--time-out=SECS] [-m MODE]
[-l LOGFILE]
gs_om -t restart [-h HOSTNAME] [-D dataDir] [--time-out=SECS]
[--security-mode=MODE] [-l LOGFILE] [-m MODE]
gs_om -t status [-h HOSTNAME] [-o OUTPUT] [--detail] [--all] [-l LOGFILE]
gs_om -t generateconf -X XMLFILE [--distribute] [-l LOGFILE]
gs_om -t cert [--cert-file=CERTFILE | --rollback] [-L] [-l LOGFILE]
@ -478,6 +481,8 @@ Install options:
self.checkStartParameter()
elif (self.g_opts.action == ACTION_STOP):
self.checkStopParameter()
elif (self.g_opts.action == ACTION_RESTART):
pass
elif (self.g_opts.action == ACTION_STATUS):
self.checkOutFileParameter()
elif (self.g_opts.action == ACTION_REBUID):
@ -714,6 +719,7 @@ def main():
if (manager.g_opts.action not in [ACTION_START,
ACTION_STOP,
ACTION_RESTART,
ACTION_STATUS,
ACTION_REBUID,
ACTION_CERT,
@ -733,6 +739,8 @@ def main():
impl.doStart()
elif (manager.g_opts.action == ACTION_STOP):
impl.doStop()
elif (manager.g_opts.action == ACTION_RESTART):
impl.doStop(), impl.doStart()
elif (manager.g_opts.action == ACTION_STATUS):
impl.doStatus()
elif (manager.g_opts.action == ACTION_REBUID):

View File

@ -104,6 +104,9 @@ gs_om_start = ["-t:", "-?", "--help", "-V", "--version", "-h:", "-I:",
"--security-mode="]
gs_om_stop = ["-t:", "-?", "--help", "-V", "--version", "-h:", "-I:", "-m:",
"--az=", "-l:", "--mode=", "--nodeId=", "--time-out=", "-D:"]
gs_om_restart= ["-t:", "-?", "--help", "-V", "--version", "-h:", "-I:",
"--time-out=", "--az=", "-l:", "--nodeId=", "-D:",
"--security-mode="]
gs_om_view = ["-t:", "-?", "--help", "-V", "--version", "-o:", "-l:"]
gs_om_query = ["-t:", "-?", "--help", "-V", "--version", "-o:", "-l:"]
gs_om_status = ["-t:", "-?", "--help", "-V", "--version", "-h:", "-o:",
@ -146,6 +149,7 @@ ParameterDict = {"preinstall": gs_preinstall,
"auto_rollback": gs_upgradectl_auto_rollback,
"start": gs_om_start,
"stop": gs_om_stop,
"restart": gs_om_restart,
"status": gs_om_status,
"generateconf": gs_om_generateconf,
"cert": gs_om_cert,
@ -166,7 +170,7 @@ ParameterDict = {"preinstall": gs_preinstall,
special_list = ["gs_om", "backup", "upgradectl"]
# The -t parameter list
action_om = ["start", "stop", "status", "generateconf", "kerberos",
action_om = ["start", "stop", "status", "restart","generateconf", "kerberos",
"cert", "view", "query", "refreshconf"]
action_upgradectl = ["chose-strategy", "auto-upgrade", "auto-rollback",
"commit-upgrade"]