Skip to content

Commit e147e28

Browse files
author
Neil Williams
committed
Pep8 updates for E265
Change-Id: I0875ce5eef2652fab044b4e26d6aa4a28d2751d5
1 parent 9af656f commit e147e28

22 files changed

+134
-134
lines changed

lava/dispatcher/commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def run_legacy_job(job_data, oob_file, config, output_dir, validate):
5959
json_job_data = json.dumps(job_data)
6060
job = LavaTestJob(json_job_data, oob_file, config, output_dir)
6161

62-
#FIXME Return status
62+
# FIXME Return status
6363
if validate:
6464
try:
6565
validate_job_data(job.job_data)

lava/dispatcher/node.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ def request_wait_all(self, messageID, role=None):
370370
# of a broken test definition.
371371
if role:
372372
return self._send({"request": "lava_wait_all",
373-
"messageID": messageID,
374-
"waitrole": role})
373+
"messageID": messageID,
374+
"waitrole": role})
375375
else:
376376
return self._send({"request": "lava_wait_all",
377377
"messageID": messageID})

lava_dispatcher/actions/deploy.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ class cmd_deploy_linaro_image(BaseAction):
2727
# json_schema_validation that means it doesn't work (see
2828
# https://github.com/zyga/json-schema-validator/pull/6).
2929

30-
## parameters_schema = {
31-
## 'type': [
32-
## {
33-
## 'type': 'object',
34-
## 'properties': {
35-
## 'image': {'type': 'string'},
36-
## },
37-
## 'additionalProperties': False,
38-
## },
39-
## {
40-
## 'type': 'object',
41-
## 'properties': {
42-
## 'hwpack': {'type': 'string'},
43-
## 'rootfs': {'type': 'string'},
44-
## 'rootfstype': {'type': 'string', 'optional': True, 'default': 'ext3'},
45-
## },
46-
## 'additionalProperties': False,
47-
## },
48-
## ],
49-
## }
30+
# parameters_schema = {
31+
# 'type': [
32+
# {
33+
# 'type': 'object',
34+
# 'properties': {
35+
# 'image': {'type': 'string'},
36+
# },
37+
# 'additionalProperties': False,
38+
# },
39+
# {
40+
# 'type': 'object',
41+
# 'properties': {
42+
# 'hwpack': {'type': 'string'},
43+
# 'rootfs': {'type': 'string'},
44+
# 'rootfstype': {'type': 'string', 'optional': True, 'default': 'ext3'},
45+
# },
46+
# 'additionalProperties': False,
47+
# },
48+
# ],
49+
# }
5050

5151
parameters_schema = {
5252
'type': 'object',

lava_dispatcher/actions/launch_control.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def _get_dashboard(server, token):
4848
if not server.endswith("/"):
4949
server = ''.join([server, "/"])
5050

51-
#add backward compatible for 'dashboard/'-end URL
52-
#Fix it: it's going to be deleted after transition
51+
# add backward compatible for 'dashboard/'-end URL
52+
# Fix it: it's going to be deleted after transition
5353
if server.endswith("dashboard/"):
5454
server = ''.join([server, "xml-rpc/"])
5555
logging.warn("Please use whole endpoint URL not just end with 'dashboard/', "
@@ -80,7 +80,7 @@ def _get_dashboard(server, token):
8080
logging.error("Please use RPC2 endpoint instead, xml-rpc is no longer supported")
8181
raise OperationFailed("xml-rpc endpoint is not supported.")
8282
elif server.endswith("RPC2/"):
83-
#include lava-server/RPC2/
83+
# include lava-server/RPC2/
8484
dashboard = srv.dashboard
8585
else:
8686
logging.warn("The url seems not RPC2 or xml-rpc endpoints, please make sure it's a valid one!!!")

lava_dispatcher/actions/lava_android_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_name(self, test_name, option=None, timeout=-1):
5050
return super(cmd_lava_android_test_run, self).test_name() + ' (%s)' % test_name
5151

5252
def run(self, test_name, option=None, timeout=-1):
53-
#Make sure in test image now
53+
# Make sure in test image now
5454
self.check_lava_android_test_installed()
5555
with self.client.android_tester_session() as session:
5656
bundle_name = generate_bundle_file_name(test_name)
@@ -110,7 +110,7 @@ def run(self, commands=None, command_file=None, parser=None, timeout=-1):
110110
:param parser: The parser to use for the test
111111
:param timeout: The timeout to apply.
112112
"""
113-
#Make sure in test image now
113+
# Make sure in test image now
114114
self.check_lava_android_test_installed()
115115
if commands or command_file:
116116
with self.client.android_tester_session() as session:
@@ -168,7 +168,7 @@ def test_name(self, url=None, timeout=-1):
168168
return '%s (url=[%s])' % (super(cmd_lava_android_test_run_monkeyrunner, self).test_name(), url)
169169

170170
def run(self, url=None, timeout=-1):
171-
#Make sure in test image now
171+
# Make sure in test image now
172172
self.check_lava_android_test_installed()
173173
with self.client.android_tester_session() as session:
174174
bundle_name = generate_bundle_file_name('monkeyrunner')

lava_dispatcher/actions/lava_test.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929

3030
def _install_lava_test(client, session):
31-
#install bazaar in tester image
31+
# install bazaar in tester image
3232
session.run('%s update' % client.aptget_cmd)
33-
#Install necessary packages for build lava-test
33+
# Install necessary packages for build lava-test
3434
cmd = ('%s -y --force-yes install '
3535
'bzr usbutils python-apt python-setuptools '
3636
'python-simplejson lsb-release python-keyring '
@@ -49,7 +49,7 @@ def _install_lava_test(client, session):
4949
logging.debug("Installing %s with pip" % lava_test_url)
5050
session.run('pip install -e ' + lava_test_url)
5151

52-
#Test if lava-test installed
52+
# Test if lava-test installed
5353
session.run('which lava-test', timeout=60)
5454

5555
# cleanup the lava-test - old results, cached files...
@@ -205,11 +205,11 @@ class cmd_add_apt_repository(BaseAction):
205205
def run(self, arg):
206206
with self.client.reliable_session() as session:
207207

208-
#install add-apt-repository
208+
# install add-apt-repository
209209
session.run('%s -y install python-software-properties' %
210210
self.client.aptget_cmd)
211211

212-
#add ppa
212+
# add ppa
213213
for repository in arg:
214214
session.run('add-apt-repository %s < /dev/null' % repository)
215215
session.run('%s update' % self.client.aptget_cmd)

lava_dispatcher/actions/lava_test_shell.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def _get_testdef_url_repo(testdef_repo, context, tmpdir):
243243
if not os.path.isdir(urldir):
244244
logging.info("Creating directory to download the url file into.")
245245
os.makedirs(urldir)
246-
#we will not use 'testdef_file' here, we can get this info from URL
246+
# we will not use 'testdef_file' here, we can get this info from URL
247247
testdef_file = download_image(testdef_repo, context, urldir)
248248

249249
except Exception as e:
@@ -679,19 +679,19 @@ class cmd_lava_test_shell(BaseAction):
679679
'items': {'type': 'object',
680680
'properties':
681681
{'git-repo': {'type': 'string',
682-
'optional': True},
682+
'optional': True},
683683
'bzr-repo': {'type': 'string',
684-
'optional': True},
684+
'optional': True},
685685
'tar-repo': {'type': 'string',
686-
'optional': True},
686+
'optional': True},
687687
'url': {'type': 'string',
688-
'optional': True},
688+
'optional': True},
689689
'revision': {'type': 'string',
690-
'optional': True},
690+
'optional': True},
691691
'testdef': {'type': 'string',
692-
'optional': True},
692+
'optional': True},
693693
'parameters': {'type': 'object',
694-
'optional': True}
694+
'optional': True}
695695
},
696696
'additionalProperties': False},
697697
'optional': True

lava_dispatcher/actions/lmp/board.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def get_frame(self):
126126

127127
logging.debug("LMP: Got %s" % response)
128128

129-
#return a Python object
129+
# return a Python object
130130
return json.loads(response)
131131

132132
def get_response(self, schema):

lava_dispatcher/actions/lmp/init_boards.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _validate_lmp_module(lmp_module_data):
7575
Validator.validate(schema, lmp_module_data)
7676

7777

78-
#init LMP module
78+
# init LMP module
7979
def init(lmp_module_data, config):
8080
_validate_lmp_module(lmp_module_data)
8181
for lmp_module_element in lmp_module_data:

lava_dispatcher/actions/lmp/signals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from lava_dispatcher.actions.lmp.board import get_module_serial
2929

3030

31-
#for LMP signal process
31+
# for LMP signal process
3232
def lsgpio_signal(connection, config, command, module_name):
3333
message_str = ""
3434
gpio_value = ""
@@ -110,7 +110,7 @@ def hdmi_signal(connection, config, command, module_name, fakeedid=None):
110110
elif command == "disconnect":
111111
lmp_hdmi.disconnect(lmp_hdmi_id)
112112
elif command == "fakeedid":
113-
#FIXME: How to pass the fake edid to target board?
113+
# FIXME: How to pass the fake edid to target board?
114114
lmp_hdmi.fake(lmp_hdmi_id)
115115
elif command[:3] == "id_":
116116
lmp_hdmi.set_identify(lmp_hdmi_id, command[-3:])

lava_dispatcher/client/base.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ def _setup_adb_over_tcp(self):
229229
if self.dev_ip is None:
230230
raise OperationFailed("failed to get board ip address")
231231
try:
232-
## just disconnect the adb connection in case is remained
233-
## by last action or last job
234-
## that connection should be expired already
232+
# just disconnect the adb connection in case is remained
233+
# by last action or last job
234+
# that connection should be expired already
235235
self.android_adb_over_tcp_disconnect()
236236
except KeyboardInterrupt:
237237
raise KeyboardInterrupt
238238
except:
239-
## ignore all exception
240-
## this just in case of exception
239+
# ignore all exception
240+
# this just in case of exception
241241
pass
242242
self.android_adb_over_tcp_connect()
243243
self.wait_until_attached()
@@ -321,7 +321,7 @@ def wait_until_attached(self):
321321
def wait_home_screen(self):
322322
timeout = self._client.config.android_home_screen_timeout
323323
activity_pat = self._client.config.android_wait_for_home_screen_activity
324-
#waiting for the home screen displayed
324+
# waiting for the home screen displayed
325325
try:
326326
self.run('logcat -s ActivityManager:I',
327327
response=[activity_pat],
@@ -331,9 +331,9 @@ def wait_home_screen(self):
331331
logging.critical(msg)
332332
raise CriticalError(msg)
333333
finally:
334-
#send ctrl+c to exit the logcat command,
335-
#and make the latter command can be run on the normal
336-
#command line session, instead of the session of logcat command
334+
# send ctrl+c to exit the logcat command,
335+
# and make the latter command can be run on the normal
336+
# command line session, instead of the session of logcat command
337337
self._connection.sendcontrol("c")
338338
self.run('')
339339

@@ -625,7 +625,7 @@ def boot_linaro_android_image(self, adb_check=False):
625625
self.context.test_data.add_metadata(boottime_meta)
626626
logging.debug("Kernel boot time: %s seconds" % boottime)
627627

628-
#TODO: set up proxy
628+
# TODO: set up proxy
629629

630630
if not self.config.android_adb_over_usb:
631631
try:
@@ -671,8 +671,8 @@ def boot_linaro_android_image(self, adb_check=False):
671671
logging.critical(msg)
672672
raise CriticalError(msg)
673673

674-
#check if the adb connection can be created.
675-
#by adb connect dev_ip command
674+
# check if the adb connection can be created.
675+
# by adb connect dev_ip command
676676
if adb_check:
677677
try:
678678
session = AndroidTesterCommandRunner(self)

lava_dispatcher/device/dynamic_vm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self, context, config):
5151
super(DynamicVmTarget, self).__init__(context, config)
5252

5353
device_type = config.dynamic_vm_backend_device_type
54-
if not device_type in self.supported_backends.keys():
54+
if device_type not in self.supported_backends.keys():
5555
raise CriticalError("%s is not supported as a backend" %
5656
device_type)
5757

lava_dispatcher/device/fastmodel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _customize_android(self):
9797
with image_partition_mounted(self._sd_image, self.SYS_PARTITION) as d:
9898
with open('%s/etc/mkshrc' % d, 'a') as f:
9999
f.write('\n# LAVA CUSTOMIZATIONS\n')
100-
#make sure PS1 is what we expect it to be
100+
# make sure PS1 is what we expect it to be
101101
f.write('PS1="%s"\n' % self.tester_ps1)
102102
if not self.config.enable_network_after_boot_android:
103103
# fast model usermode networking does not support ping

lava_dispatcher/device/master.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def extract_tarball(self, tarball_url, partition, directory='/'):
350350
@contextlib.contextmanager
351351
def file_system(self, partition, directory):
352352
logging.info('attempting to access master filesystem %r:%s' %
353-
(partition, directory))
353+
(partition, directory))
354354

355355
assert directory != '/', "cannot mount entire partition"
356356

@@ -476,7 +476,7 @@ def _android_data_label(self, session):
476476
data_label = self.userdata_label
477477
data_path = self.userdata_path
478478
if not session.has_partition_with_label(data_label):
479-
#consider the compatiblity, here use the existed sdcard partition
479+
# consider the compatiblity, here use the existed sdcard partition
480480
data_label = self.sdcard_label
481481
data_path = self.sdcard_path
482482
return data_label, data_path
@@ -522,9 +522,9 @@ def _deploy_linaro_rootfs(self, session, rootfs):
522522
# another hour to err on the side of caution.
523523
session._client.target_extract(session, rootfs, '/mnt/root', timeout=18000)
524524

525-
#DO NOT REMOVE - diverting flash-kernel and linking it to /bin/true
526-
#prevents a serious problem where packages getting installed that
527-
#call flash-kernel can update the kernel on the master image
525+
# DO NOT REMOVE - diverting flash-kernel and linking it to /bin/true
526+
# prevents a serious problem where packages getting installed that
527+
# call flash-kernel can update the kernel on the master image
528528
if session.run('chroot /mnt/root which dpkg-divert', failok=True) == 0:
529529
session.run(
530530
'chroot /mnt/root dpkg-divert --local /usr/sbin/flash-kernel')

lava_dispatcher/device/target.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,13 @@ def _boot_cmds_preprocessing(self, boot_cmds):
433433
(1)Delete the redundant element "" at the end of boot_cmds
434434
(2)(we can add more actions for preprocessing here).
435435
"""
436-
#Delete the redundant element "" at the end of boot_cmds
436+
# Delete the redundant element "" at the end of boot_cmds
437437
while True:
438438
if boot_cmds[-1] == "":
439439
del boot_cmds[-1]
440440
else:
441441
break
442-
#we can add more actions here
442+
# we can add more actions here
443443
logging.debug('boot_cmds(after preprocessing): %s', boot_cmds)
444444
return boot_cmds
445445

@@ -713,8 +713,8 @@ def _get_from_config_or_deployment_data(self, key):
713713

714714
def _customize_linux(self):
715715
# XXX Re-examine what to do here in light of deployment_data import.
716-
#perhaps make self.deployment_data = deployment_data({overrides: dict})
717-
#and remove the write function completely?
716+
# perhaps make self.deployment_data = deployment_data({overrides: dict})
717+
# and remove the write function completely?
718718

719719
os_release_id = 'linux'
720720
mnt = self.mount_info['rootfs']
@@ -795,7 +795,7 @@ def _reorganize_customize_files(self):
795795
if des_tmp[:5] != "boot:" and des_tmp[:7] != "rootfs:" and des_tmp != "delete":
796796
logging.error('Customize function only support <boot, rootfs>:<path> as image path, for now!')
797797
raise CriticalError("Unrecognized image path %s, Please check your test definition!" % des_tmp)
798-
#temp_dic["des"].remove(des_tmp)
798+
# temp_dic["des"].remove(des_tmp)
799799
if src[:4] in image_part:
800800
if "delete" in temp_dic["des"]:
801801
customize_info["delete"].append(src)

0 commit comments

Comments
 (0)