Fix H233 Python 3.x incompatible use of print operator
Change-Id: I85efe06a1d815a016ab7735df1778c6f984d9cca
This commit is contained in:
parent
024ad6e071
commit
85b78b4a67
@ -53,22 +53,22 @@ def find_task(execution_id):
|
|||||||
execution = find_execution()
|
execution = find_execution()
|
||||||
|
|
||||||
if not execution:
|
if not execution:
|
||||||
print "Unable to find running executions."
|
print("Unable to find running executions.")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
print "Updating execution: %s" % execution
|
print("Updating execution: %s" % execution)
|
||||||
|
|
||||||
task = find_task(execution.id)
|
task = find_task(execution.id)
|
||||||
if not task:
|
if not task:
|
||||||
print "Unable to find running tasks for execution: %s" % execution
|
print("Unable to find running tasks for execution: %s" % execution)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
print "Setting task to SUCCESS state: %s" % task
|
print("Setting task to SUCCESS state: %s" % task)
|
||||||
|
|
||||||
task = client.tasks.update(WB_NAME, execution.id, task.id, "SUCCESS")
|
task = client.tasks.update(WB_NAME, execution.id, task.id, "SUCCESS")
|
||||||
|
|
||||||
print "Updated task: %s" % task
|
print("Updated task: %s" % task)
|
||||||
|
|
||||||
execution = client.executions.get(WB_NAME, task.execution_id)
|
execution = client.executions.get(WB_NAME, task.execution_id)
|
||||||
|
|
||||||
print "Updated execution: %s" % execution
|
print("Updated execution: %s" % execution)
|
||||||
|
@ -40,24 +40,24 @@ if not wb:
|
|||||||
description="My test workbook",
|
description="My test workbook",
|
||||||
tags=["test"])
|
tags=["test"])
|
||||||
|
|
||||||
print "Created workbook: %s" % wb
|
print("Created workbook: %s" % wb)
|
||||||
|
|
||||||
with open("scripts/test.yaml") as definition_file:
|
with open("scripts/test.yaml") as definition_file:
|
||||||
definition = definition_file.read()
|
definition = definition_file.read()
|
||||||
|
|
||||||
client.workbooks.upload_definition(WB_NAME, definition)
|
client.workbooks.upload_definition(WB_NAME, definition)
|
||||||
|
|
||||||
print "\nUploaded workbook:\n\"\n%s\"\n" %\
|
print("\nUploaded workbook:\n\"\n%s\"\n" %
|
||||||
client.workbooks.get_definition(WB_NAME)
|
client.workbooks.get_definition(WB_NAME))
|
||||||
|
|
||||||
execution = client.executions.create(WB_NAME, TASK)
|
execution = client.executions.create(WB_NAME, TASK)
|
||||||
|
|
||||||
print "execution: %s" % execution
|
print("execution: %s" % execution)
|
||||||
|
|
||||||
# wait until task is complete
|
# wait until task is complete
|
||||||
for i in range(0, 20):
|
for i in range(0, 20):
|
||||||
execution = client.executions.get(WB_NAME, execution.id)
|
execution = client.executions.get(WB_NAME, execution.id)
|
||||||
print "execution: %s" % execution
|
print("execution: %s" % execution)
|
||||||
if execution.state == 'SUCCESS':
|
if execution.state == 'SUCCESS':
|
||||||
break
|
break
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
2
tox.ini
2
tox.ini
@ -38,6 +38,6 @@ commands = bash tools/lintstack.sh
|
|||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
show-source = true
|
show-source = true
|
||||||
ignore = H101,H233,H302,H306,H404,H803
|
ignore = H101,H302,H306,H404,H803
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
||||||
|
Loading…
Reference in New Issue
Block a user