From 0ef22c24c00b821784535ab77dee5e7e8c6bc7b8 Mon Sep 17 00:00:00 2001 From: "jansson@webrtc.org" Date: Mon, 11 Mar 2013 14:52:56 +0000 Subject: [PATCH] Fixed style according to reviewer and a refactoring error I had to create this CL due to comitting before the final comments in the last CL http://review.webrtc.org/1157005/ in revision: https://code.google.com/p/webrtc/source/detail?r=3642 Changed e.msg to e.fail_msg in logging.error in emulate.py Added space to error message for windows in check_permissions() in network_emulator BUG=none TEST=Windows and linux Review URL: https://webrtc-codereview.appspot.com/1167006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3646 4adac7df-926f-26a2-2b94-8c16560cd09d --- tools/network_emulator/emulate.py | 4 ++-- tools/network_emulator/network_emulator.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/network_emulator/emulate.py b/tools/network_emulator/emulate.py index beaaf60069..1c2cf3aaad 100755 --- a/tools/network_emulator/emulate.py +++ b/tools/network_emulator/emulate.py @@ -154,7 +154,7 @@ def _main(): try: emulator.check_permissions() except network_emulator.NetworkEmulatorError as e: - logging.error('Error: %s\n\nCause: %s', e.msg, e.error) + logging.error('Error: %s\n\nCause: %s', e.fail_msg, e.error) return -1 if not options.target_ip: @@ -186,7 +186,7 @@ def _main(): logging.info('Completed Network Emulation.') return 0 except network_emulator.NetworkEmulatorError as e: - logging.error('Error: %s\n\nCause: %s', e.msg, e.error) + logging.error('Error: %s\n\nCause: %s', e.fail_msg, e.error) return -2 if __name__ == '__main__': diff --git a/tools/network_emulator/network_emulator.py b/tools/network_emulator/network_emulator.py index 08d8255929..2531f1ed8c 100644 --- a/tools/network_emulator/network_emulator.py +++ b/tools/network_emulator/network_emulator.py @@ -97,7 +97,7 @@ class NetworkEmulator(object): # AttributeError will be raised on Windows. if ctypes.windll.shell32.IsUserAnAdmin() == 0: raise NetworkEmulatorError('You must run this script with administrator' - 'privileges.') + ' privileges.') def _create_dummynet_rule(self, pipe_id, from_address, to_address, port_range): @@ -169,7 +169,7 @@ def _run_ipfw_command(command, fail_msg=None): fail_msg: Message describing the error in case the command fails. Raises: - NetworkEmulatorError: If command fails. Message is set by the fail_msg + NetworkEmulatorError: If command fails a message is set by the fail_msg parameter. """ if sys.platform == 'win32':