Some cleanup and style fixes for fixlimits
This commit is contained in:
+4
-4
@@ -359,17 +359,17 @@ def sysctlTestAndSet( name, limit ):
|
|||||||
"Helper function to set sysctl limits"
|
"Helper function to set sysctl limits"
|
||||||
#convert non-directory names into directory names
|
#convert non-directory names into directory names
|
||||||
if '/' not in name:
|
if '/' not in name:
|
||||||
name = '/proc/sys/' + name.replace('.','/')
|
name = '/proc/sys/' + name.replace( '.', '/' )
|
||||||
#read limit
|
#read limit
|
||||||
f = open(name, 'r+')
|
f = open( name, 'r+' )
|
||||||
oldLimit = f.readline()
|
oldLimit = f.readline()
|
||||||
if type( limit ) is int:
|
if type( limit ) is int:
|
||||||
#compare integer limits before overriding
|
#compare integer limits before overriding
|
||||||
if int( oldLimit ) < limit:
|
if int( oldLimit ) < limit:
|
||||||
f.write("%d" % limit)
|
f.write( "%d" % limit )
|
||||||
else:
|
else:
|
||||||
#overwrite non-integer limits
|
#overwrite non-integer limits
|
||||||
f.write(limit)
|
f.write( limit )
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def rlimitTestAndSet( name, limit ):
|
def rlimitTestAndSet( name, limit ):
|
||||||
|
|||||||
@@ -144,16 +144,6 @@ function mn_deps {
|
|||||||
python-setuptools cgroup-bin ethtool help2man \
|
python-setuptools cgroup-bin ethtool help2man \
|
||||||
pyflakes pylint pep8
|
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"
|
echo "Installing Mininet core"
|
||||||
pushd $MININET_DIR/mininet
|
pushd $MININET_DIR/mininet
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|||||||
Reference in New Issue
Block a user