add update_v0.3.2.py

This commit is contained in:
zhuyj17 2017-11-26 14:53:17 +08:00
parent 0fca69aec6
commit e1d141bc20
1 changed files with 21 additions and 0 deletions

21
tools/update_v0.3.2.py Normal file
View File

@ -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()