diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2015-10-12 07:15:54 +0100 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-10-21 14:02:11 +0000 |
commit | c2971871dd1380b88d58f29211a3e8478aca477a (patch) | |
tree | 043893808caaa962f77757b4d495a7b4ec9b9b3b /src | |
parent | 3572d56f5733592db30f0df2273fe93e731cba2d (diff) |
Add Pylint to VSPERF commit gate
Initial pylint config file has been created to follow current
code structure and design. A few issues have been fixed, so currently
56 of 67 files have rating 10/10. There are still issues to be fixed,
mainly TODOs/FIXMEs and missing impelentation of abstract class members.
Change-Id: Icf5b12c2150258f8ac657f8d50b47a697d1660a0
JIRA: VSPERF-91
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Reviewed-by: Gene Snider <eugene.snider@huawei.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Tv Rao <tv.rao@freescale.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/dpdk/dpdk.py | 5 | ||||
-rw-r--r-- | src/ovs/daemon.py | 16 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/dpdk/dpdk.py b/src/dpdk/dpdk.py index 0a63c161..e1a8e657 100644 --- a/src/dpdk/dpdk.py +++ b/src/dpdk/dpdk.py @@ -318,9 +318,8 @@ def _unbind_nics(): except subprocess.CalledProcessError: _LOGGER.error('Unable to unbind NICs %s', str(settings.getValue('WHITELIST_NICS'))) - '''Rebind NICs to their original drivers - using the Intel DPDK ``dpdk_nic_bind.py`` tool. - ''' + # Rebind NICs to their original drivers + # using the Intel DPDK ``dpdk_nic_bind.py`` tool. for i, nic in enumerate(settings.getValue('WHITELIST_NICS')): try: if nic_drivers[i] != '': diff --git a/src/ovs/daemon.py b/src/ovs/daemon.py index db096353..0d518ea9 100644 --- a/src/ovs/daemon.py +++ b/src/ovs/daemon.py @@ -44,9 +44,7 @@ class VSwitchd(tasks.Process): """ _ovsdb_pid = None _logfile = _LOG_FILE_VSWITCHD - _ovsdb_pidfile_path = os.path.join(settings.getValue('LOG_DIR'), - "ovsdb_pidfile.pid") - + _ovsdb_pidfile_path = os.path.join(settings.getValue('LOG_DIR'), "ovsdb_pidfile.pid") _proc_name = 'ovs-vswitchd' def __init__(self, timeout=30, vswitchd_args=None, expected_cmd=None): @@ -60,7 +58,7 @@ class VSwitchd(tasks.Process): """ self._logger = logging.getLogger(__name__) self._timeout = timeout - self._expect = expected_cmd; + self._expect = expected_cmd vswitchd_args = vswitchd_args or [] self._cmd = ['sudo', '-E', _OVS_VSWITCHD_BIN] + vswitchd_args @@ -84,7 +82,7 @@ class VSwitchd(tasks.Process): self._kill_ovsdb() raise exc - def kill(self): + def kill(self, signal='-15', sleep=2): """Kill ``ovs-vswitchd`` instance if it is alive. :returns: None @@ -93,7 +91,7 @@ class VSwitchd(tasks.Process): self._kill_ovsdb() - super(VSwitchd, self).kill() + super(VSwitchd, self).kill(signal, sleep) # helper functions @@ -131,7 +129,7 @@ class VSwitchd(tasks.Process): ['sudo', _OVSDB_SERVER_BIN, '--remote=punix:%s' % os.path.join(_OVS_VAR_DIR, 'db.sock'), '--remote=db:Open_vSwitch,Open_vSwitch,manager_options', - '--pidfile=' + self._ovsdb_pidfile_path , '--overwrite-pidfile'], + '--pidfile=' + self._ovsdb_pidfile_path, '--overwrite-pidfile'], self._logger, 'Starting ovsdb-server...') @@ -140,7 +138,7 @@ class VSwitchd(tasks.Process): :returns: None """ - with open (self._ovsdb_pidfile_path, "r") as pidfile: + with open(self._ovsdb_pidfile_path, "r") as pidfile: ovsdb_pid = pidfile.read().strip() self._logger.info("Killing ovsdb with pid: " + ovsdb_pid) @@ -150,7 +148,7 @@ class VSwitchd(tasks.Process): self._logger, 'Killing ovsdb-server...') @staticmethod - def getDbSockPath(): + def get_db_sock_path(): """Method returns location of db.sock file :returns: path to db.sock file. |