summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dpdk/__init__.py3
-rw-r--r--src/dpdk/dpdk.py3
-rw-r--r--src/ovs/dpctl.py6
-rw-r--r--src/ovs/ofctl.py10
4 files changed, 8 insertions, 14 deletions
diff --git a/src/dpdk/__init__.py b/src/dpdk/__init__.py
index fdbc5414..7b721be0 100644
--- a/src/dpdk/__init__.py
+++ b/src/dpdk/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,4 +20,3 @@ and removing drivers and binding/unbinding NICs.
from src.dpdk.dpdk import *
from src.dpdk.testpmd_proc import TestPMDProcess
-
diff --git a/src/dpdk/dpdk.py b/src/dpdk/dpdk.py
index 0c5ed9f4..438fe40b 100644
--- a/src/dpdk/dpdk.py
+++ b/src/dpdk/dpdk.py
@@ -1,4 +1,4 @@
-# Copyright 2015-2016 Intel Corporation.
+# Copyright 2015-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ _NICS_PCI = []
def init():
"""Setup system for DPDK.
"""
+ # pylint: disable=global-statement
global _NICS
global _NICS_PCI
_NICS = S.getValue('NICS')
diff --git a/src/ovs/dpctl.py b/src/ovs/dpctl.py
index 44a4ec9b..015fb38c 100644
--- a/src/ovs/dpctl.py
+++ b/src/ovs/dpctl.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Intel Corporation.
+# Copyright 2016-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,10 +15,7 @@
"""Wrapper for an OVS dpctl (``ovs-dpctl``) for managing datapaths.
"""
-
-import os
import logging
-import string
from tools import tasks
from conf import settings
@@ -65,4 +62,3 @@ class DPCtl(object):
"""
self.logger.debug('delete datapath ' + dp_name)
self.run_dpctl(['del-dp', dp_name])
-
diff --git a/src/ovs/ofctl.py b/src/ovs/ofctl.py
index e9b86127..f0d116da 100644
--- a/src/ovs/ofctl.py
+++ b/src/ovs/ofctl.py
@@ -1,4 +1,4 @@
-# Copyright 2015-2016 Intel Corporation.
+# Copyright 2015-2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,6 @@ Much of this code is based on ``ovs-lib.py`` from Open Stack:
https://github.com/openstack/neutron/blob/6eac1dc99124ca024d6a69b3abfa3bc69c735667/neutron/agent/linux/ovs_lib.py
"""
-
-import os
import logging
import string
import re
@@ -177,7 +175,7 @@ class OFBridge(OFBase):
:return: None
"""
- tmp_timeout = self.timeout if timeout == None else timeout
+ tmp_timeout = self.timeout if timeout is None else timeout
cmd = ['sudo', settings.getValue('TOOLS')['ovs-ofctl'], '-O',
'OpenFlow13', '--timeout', str(tmp_timeout)] + args
return tasks.run_task(
@@ -292,7 +290,7 @@ class OFBridge(OFBase):
"""
# insert flows from cache into OVS if needed
if cache == 'flush':
- if self._cache_file == None:
+ if self._cache_file is None:
self.logger.error('flow cache flush called, but nothing is cached')
return
self.logger.debug('flows cached in %s will be added to the bridge', _CACHE_FILE_NAME)
@@ -311,7 +309,7 @@ class OFBridge(OFBase):
# insert flow to the cache or OVS
if cache == 'on':
# create and open cache file if needed
- if self._cache_file == None:
+ if self._cache_file is None:
self._cache_file = open(_CACHE_FILE_NAME, 'w')
self._cache_file.write(_flow_key + '\n')
else: