Commit 79b3b669 authored by Alan Taylor's avatar Alan Taylor

PEP8 tidy

parent 3848bbf4
......@@ -122,8 +122,9 @@ def collect_block_from_node(image_config, block_info):
remote_filename = block_info[0].username + '@' + block_info[0].ip_address + ':' + \
utils.block_render_filename(image_config, block_info[1])
with subprocess.Popen(['scp', '-q', remote_filename, '.'], \
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) as proc:
with subprocess.Popen(['scp', '-q', remote_filename, '.'],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL) as proc:
proc.wait()
return proc.returncode == 0
......@@ -187,10 +188,11 @@ def render_block(image_config, node, block):
on_this_node = node.username + '@' + node.ip_address
block_number_padded = str(block).zfill(image_config['padding'])
filename_render = utils.package_filename_for_cygwin(node.opsys, \
ds.FILENAME_FOR_RENDER)
filename_python = utils.package_filename_for_cygwin(node.opsys, \
ds.FILENAME_CONFIG_BLENDER + block_number_padded + '.py')
filename_render = \
utils.package_filename_for_cygwin(node.opsys, ds.FILENAME_FOR_RENDER)
filename_python = \
utils.package_filename_for_cygwin(node.opsys, ds.FILENAME_CONFIG_BLENDER
+ block_number_padded + '.py')
render_the_block = node.binloc + ' -b ' + filename_render + \
' --python ' + filename_python
......@@ -198,10 +200,12 @@ def render_block(image_config, node, block):
# force exit approximately 6 minutes after the network has gone down,
# this will NOT kill the Blender instance running on the remote node,
# even when the network outage ends
with subprocess.Popen(['ssh', \
'-o', 'ServerAliveInterval=360', '-o', 'ServerAliveCountMax=1', \
on_this_node, render_the_block], \
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) as proc:
with subprocess.Popen(['ssh',
'-o', 'ServerAliveInterval=360',
'-o', 'ServerAliveCountMax=1',
on_this_node, render_the_block],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL) as proc:
proc.wait()
return proc.returncode == 0
......@@ -327,8 +331,8 @@ def render(image_config, node, pipeline):
continue
else:
block_num_padded = str(block_num).rjust(image_config['padding'])
pipeline.inform.put('block ' + block_num_padded + \
' issued to node ' + node.ip_address)
pipeline.inform.put('block ' + block_num_padded
+ ' issued to node ' + node.ip_address)
fio.distribute_files_to_node(image_config, node, block_num)
t_start = time.time()
if render_block(image_config, node, block_num):
......@@ -337,10 +341,10 @@ def render(image_config, node, pipeline):
else:
# handle rare failure mode gracefully
replace_reorder(image_config, pipeline, block_num)
pipeline.inform.put( \
'problem completing render of block ' + str(block_num) + \
' on node ' + node.ip_address + \
' - it will be rendered again')
pipeline.inform.put('problem completing render of block '
+ str(block_num) + ' on node '
+ node.ip_address +
' - it will be rendered again')
else:
# the node was unresponsive last time it was checked,
# so wait a while before checking again
......@@ -382,9 +386,9 @@ def collect(image_config, pipeline):
else:
# handle rare failure mode gracefully
replace_reorder(image_config, pipeline, block_info[1])
pipeline.inform.put('block ' + block_num_padded + \
' could not be retrieved from ' + nodeip + \
' and will rendered again')
pipeline.inform.put('block ' + block_num_padded
+ ' could not be retrieved from ' + nodeip
+ ' and will rendered again')
def message(pipeline):
......@@ -510,8 +514,9 @@ def main():
continue
else:
checked.append(block_info)
fio.progress_write((available_render_nodes, checked, \
time_taken_by_previous_renders + time.time() - script_start))
fio.progress_write((available_render_nodes, checked,
time_taken_by_previous_renders
+ time.time() - script_start))
fio.backup_render(image_config)
# shut down processes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment