Some cleanup and style fixes for fixlimits

This commit is contained in:
Brian O'Connor
2013-08-14 17:29:23 -07:00
parent 867a6d6731
commit b635fd9edd
2 changed files with 4 additions and 14 deletions
+4 -4
View File
@@ -359,17 +359,17 @@ def sysctlTestAndSet( name, limit ):
"Helper function to set sysctl limits"
#convert non-directory names into directory names
if '/' not in name:
name = '/proc/sys/' + name.replace('.','/')
name = '/proc/sys/' + name.replace( '.', '/' )
#read limit
f = open(name, 'r+')
f = open( name, 'r+' )
oldLimit = f.readline()
if type( limit ) is int:
#compare integer limits before overriding
if int( oldLimit ) < limit:
f.write("%d" % limit)
f.write( "%d" % limit )
else:
#overwrite non-integer limits
f.write(limit)
f.write( limit )
f.close()
def rlimitTestAndSet( name, limit ):
-10
View File
@@ -144,16 +144,6 @@ function mn_deps {
python-setuptools cgroup-bin ethtool help2man \
pyflakes pylint pep8
# TODO: remove this; it's no longer necessary as these are check when mn starts
## Add sysctl parameters as noted in the INSTALL file to increase kernel
## limits to support larger setups:
#if ! grep Mininet /etc/sysctl.conf; then
# echo "Adding Mininet sysctl settings"
# sudo su -c "cat $MININET_DIR/mininet/util/sysctl_addon >> /etc/sysctl.conf"
#fi
## Load new sysctl settings:
#sudo sysctl -p
echo "Installing Mininet core"
pushd $MININET_DIR/mininet
sudo make install