From e1d141bc20e314e5e47fd3c14edcb233486cf52e Mon Sep 17 00:00:00 2001 From: zhuyj17 Date: Sun, 26 Nov 2017 14:53:17 +0800 Subject: [PATCH] add update_v0.3.2.py --- tools/update_v0.3.2.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tools/update_v0.3.2.py diff --git a/tools/update_v0.3.2.py b/tools/update_v0.3.2.py new file mode 100644 index 0000000..40e3db4 --- /dev/null +++ b/tools/update_v0.3.2.py @@ -0,0 +1,21 @@ +import json + +fspath = '/opt/docklet' +groupfile = open(fspath+"/global/sys/quota",'r') +groups = json.loads(groupfile.read()) +groupfile.close() +for group in groups: + group['quotas']['input_rate_limit'] = 10000 + group['quotas']['output_rate_limit'] = 10000 +groupfile = open(fspath+"/global/sys/quota",'w') +groupfile.write(json.dumps(groups)) +groupfile.close() + +quotafile = open(fspath+"/global/sys/quotainfo",'r') +quotas = json.loads(quotafile.read()) +quotafile.close() +quotas['quotainfo'].append({'name':'input_rate_limit', 'hint':'the ingress speed of the network, number of kbps'}) +quotas['quotainfo'].append({'name':'output_rate_limit', 'hint':'the egress speed of the network, number of kbps'}) +quotafile = open(fspath+"/global/sys/quotainfo",'w') +quotafile.write(json.dumps(quotas)) +quotafile.close()