2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 00:35:33 +00:00

python: Fix several pep8 whitespace errors.

Fix the following pep8 errors:

  E201 whitespace after '('
  E203 whitespace before ','
  E222 multiple spaces after operator
  E225 missing whitespace around operator
  E226 missing whitespace around arithmetic operator
  E231 missing whitespace after ':'
  E241 multiple spaces after ':'
  E251 unexpected spaces around keyword / parameter equals
  E261 at least two spaces before inline comment
  E262 inline comment should start with '# '
  E265 block comment should start with '# '
  E271 multiple spaces after keyword

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Russell Bryant
2016-01-05 18:16:20 -05:00
parent 3c057118d1
commit a0631d92d9
14 changed files with 51 additions and 45 deletions

View File

@@ -60,7 +60,7 @@ class UdpSender(DatagramProtocol):
def startProtocol(self):
self.looper = LoopingCall(self.sendData)
period = self.duration / float(self.count)
self.looper.start(period , now = False)
self.looper.start(period, now=False)
def stopProtocol(self):
if (self.looper is not None):

View File

@@ -43,7 +43,7 @@ def get_interface_mtu(iface):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
indata = iface + ('\0' * (32 - len(iface)))
try:
outdata = fcntl.ioctl(s.fileno(), 0x8921, indata) # socket.SIOCGIFMTU
outdata = fcntl.ioctl(s.fileno(), 0x8921, indata) # socket.SIOCGIFMTU
mtu = struct.unpack("16si12x", outdata)[1]
except:
return 0
@@ -60,7 +60,7 @@ def get_interface(address):
names = array.array('B', '\0' * bytes)
outbytes = struct.unpack('iL', fcntl.ioctl(
s.fileno(),
0x8912, # SIOCGIFCONF
0x8912, # SIOCGIFCONF
struct.pack('iL', bytes, names.buffer_info()[0])
))[0]
namestr = names.tostring()
@@ -80,9 +80,9 @@ def uname():
def start_process(args):
try:
p = subprocess.Popen(args,
stdin = subprocess.PIPE,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
return (p.returncode, out, err)
except exceptions.OSError:
@@ -186,7 +186,7 @@ def start_local_server(port):
p = subprocess.Popen(["ovs-test", "-s", str(port)],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
preexec_fn=sigint_intercept)
fcntl.fcntl( p.stdout.fileno(),fcntl.F_SETFL,
fcntl.fcntl(p.stdout.fileno(), fcntl.F_SETFL,
fcntl.fcntl(p.stdout.fileno(), fcntl.F_GETFL) | os.O_NONBLOCK)
while p.poll() is None: