pylint: Fixing pylint errors and warnings
[vswitchperf.git] / src / ovs / dpctl.py
index 8ecac6d..015fb38 100644 (file)
@@ -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.
 """Wrapper for an OVS dpctl (``ovs-dpctl``) for managing datapaths.
 
 """
-
-import os
 import logging
-import string
 
 from tools import tasks
 from conf import settings
 
-_OVS_DPCTL_BIN = os.path.join(settings.getValue('OVS_DIR'), 'utilities',
-                              'ovs-dpctl')
-
 _OVS_LOCAL_DATAPATH = 'ovs-system'
 
 class DPCtl(object):
@@ -51,7 +45,7 @@ class DPCtl(object):
 
         :return: None
         """
-        cmd = ['sudo', _OVS_DPCTL_BIN,
+        cmd = ['sudo', settings.getValue('TOOLS')['ovs-dpctl'],
                '--timeout',
                str(self.timeout)] + args
         return tasks.run_task(
@@ -68,4 +62,3 @@ class DPCtl(object):
         """
         self.logger.debug('delete datapath ' + dp_name)
         self.run_dpctl(['del-dp', dp_name])
-