Fix H233 Python 3.x incompatible use of print operator

Change-Id: I85efe06a1d815a016ab7735df1778c6f984d9cca
This commit is contained in:
Angus Salkeld 2014-05-28 13:10:45 +10:00
parent 024ad6e071
commit 85b78b4a67
3 changed files with 12 additions and 12 deletions

View File

@ -53,22 +53,22 @@ def find_task(execution_id):
execution = find_execution()
if not execution:
print "Unable to find running executions."
print("Unable to find running executions.")
sys.exit(0)
print "Updating execution: %s" % execution
print("Updating execution: %s" % execution)
task = find_task(execution.id)
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)
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")
print "Updated task: %s" % task
print("Updated task: %s" % task)
execution = client.executions.get(WB_NAME, task.execution_id)
print "Updated execution: %s" % execution
print("Updated execution: %s" % execution)

View File

@ -40,24 +40,24 @@ if not wb:
description="My test workbook",
tags=["test"])
print "Created workbook: %s" % wb
print("Created workbook: %s" % wb)
with open("scripts/test.yaml") as definition_file:
definition = definition_file.read()
client.workbooks.upload_definition(WB_NAME, definition)
print "\nUploaded workbook:\n\"\n%s\"\n" %\
client.workbooks.get_definition(WB_NAME)
print("\nUploaded workbook:\n\"\n%s\"\n" %
client.workbooks.get_definition(WB_NAME))
execution = client.executions.create(WB_NAME, TASK)
print "execution: %s" % execution
print("execution: %s" % execution)
# wait until task is complete
for i in range(0, 20):
execution = client.executions.get(WB_NAME, execution.id)
print "execution: %s" % execution
print("execution: %s" % execution)
if execution.state == 'SUCCESS':
break
time.sleep(1)

View File

@ -38,6 +38,6 @@ commands = bash tools/lintstack.sh
[flake8]
show-source = true
ignore = H101,H233,H302,H306,H404,H803
ignore = H101,H302,H306,H404,H803
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools