Add APPROVAL_RBT to docklet.conf and user can turn on or off the robot by the field.

This commit is contained in:
Firmlyzhu 2017-06-14 15:45:51 +08:00
parent d7123625c6
commit 09745ab8e1
4 changed files with 21 additions and 5 deletions

View File

@ -91,6 +91,11 @@ Pay attention to the following settings:
- USER_IP : the ip of user server. default : localhost
- MASTER_IPS : tell the web server the ips of all the cluster master.
- OPEN_REGISTRY : whether allow user to register a new account.
- AUTH_KEY: the key to request users server from master, or to request
master from users server. Please set the same value on each machine.
Please don't use the default value.
- APPROVAL_RBT: whether to start the approval robot that will approve
beans applications from users automatically.
## Start ##

View File

@ -171,8 +171,13 @@
# AUTH_KEY: the key to request users server from master,
# or to request master from users server. Please set the
# same value on each machine. Please don't use the default value.
# AUTH_KEY="docklet"
# AUTH_KEY=docklet
# OPEN_REGISTRY: whether allow user to register new account or not.
# default:False
# OPEN_REGISTRY:False
# OPEN_REGISTRY=False
# APPROVAL_RBT: whether to start the approval robot that will approve
# beans applications from users automatically.
# ON or OFF, default: ON.
# APPROVAL_RBT=ON

View File

@ -73,5 +73,7 @@ def getenv(key):
return os.environ.get("AUTH_KEY","docklet")
elif key =="OPEN_REGISTRY":
return os.environ.get("OPEN_REGISTRY","False")
elif key =="APPROVAL_RBT":
return os.environ.get("APPROVAL_RBT","ON")
else:
return os.environ.get(key,"")

View File

@ -591,7 +591,11 @@ if __name__ == '__main__':
G_applicationmgr = beansapplicationmgr.ApplicationMgr()
approvalrbt = beansapplicationmgr.ApprovalRobot()
if(env.getenv("APPROVAL_RBT") == "ON"):
approvalrbt .start()
logger.info("ApprovalRobot is started.")
else:
logger.info("ApprovalRobot is not started.")
# server = http.server.HTTPServer((masterip, masterport), DockletHttpHandler)
logger.info("starting user server")