changes to fix flake8 issues

This commit is contained in:
bharnden 2019-09-10 21:01:51 -07:00
parent 1fc8d647c3
commit dee91e97bf
23 changed files with 51 additions and 1005 deletions

View file

@ -488,7 +488,7 @@ class CoreServices(object):
for service in boot_path:
try:
self.boot_service(node, service)
except:
except Exception:
logging.exception("exception booting service: %s", service.name)
raise

View file

@ -179,9 +179,8 @@ bootdaemon()
flags="$flags -6"
fi
#force FRR to use CORE generated conf file
flags="$flags -d -f $FRR_CONF"
flags="$flags -d -f $FRR_CONF"
$FRR_SBIN_DIR/$1 $flags
if [ "$?" != "0" ]; then
@ -207,7 +206,7 @@ bootfrr()
bootdaemon "zebra"
for r in rip ripng ospf6 ospf bgp babel; do
if grep -q "^router \<${r}\>" $FRR_CONF; then
if grep -q "^router \\<${r}\\>" $FRR_CONF; then
bootdaemon "${r}d"
fi
done

View file

@ -180,7 +180,7 @@ class NrlOlsr(NrlService):
cmd += " -rpipe %s_olsr" % node.name
servicenames = map(lambda x: x.name, node.services)
if "SMF" in servicenames and not "NHDP" in servicenames:
if "SMF" in servicenames and "NHDP" not in servicenames:
cmd += " -flooding s-mpr"
cmd += " -smfClient %s_smf" % node.name
if "zebra" in servicenames:

View file

@ -199,7 +199,7 @@ bootquagga()
bootdaemon "zebra"
for r in rip ripng ospf6 ospf bgp babel; do
if grep -q "^router \<${r}\>" $QUAGGA_CONF; then
if grep -q "^router \\<${r}\\>" $QUAGGA_CONF; then
bootdaemon "${r}d"
fi
done

View file

@ -156,7 +156,7 @@ class Nat(CoreService):
cfg += "# NAT out the first interface by default\n"
have_nat = False
for ifc in node.netifs():
if hasattr(ifc, "control") and ifc.control == True:
if hasattr(ifc, "control") and ifc.control is True:
continue
if have_nat:
cfg += cls.generateifcnatrule(ifc, line_prefix="#")

View file

@ -143,7 +143,7 @@ exec 2> /dev/null
IP="${2}"
NET="${3}"
if [ -z "$NET" ]; then
NET="24"
NET="24"
fi
/sbin/ip addr add ${IP}/${NET} dev "$1"
@ -165,7 +165,7 @@ exec 2> /dev/null
IP="${2}"
NET="${3}"
if [ -z "$NET" ]; then
NET="24"
NET="24"
fi
/sbin/ip addr del ${IP}/${NET} dev "$1"

View file

@ -495,7 +495,7 @@ Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
<Files ~ "^\\.ht">
"""
cfg += permstr[version]
cfg += """\
@ -542,22 +542,22 @@ ServerSignature On
TraceEnable Off
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
"""
cfg += permstr2[version]
cfg += """\
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
"""