Bug 1415868 - fix test-action-callback after rev e2931d904975, r?dustin
MozReview-Commit-ID: LlUQHanvVng
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -260,19 +260,16 @@ class MachCommands(MachCommandBase):
help='parameters file (.yml or .json; see '
'`taskcluster/docs/parameters.rst`)`')
@CommandArgument('--task-id', default=None,
help='TaskId to which the action applies')
@CommandArgument('--task-group-id', default=None,
help='TaskGroupId to which the action applies')
@CommandArgument('--input', default=None,
help='Action input (.yml or .json)')
- @CommandArgument('--task', default=None,
- help='Task definition (.yml or .json; if omitted, the task will be'
- 'fetched from the queue)')
@CommandArgument('callback', default=None,
help='Action callback name (Python function name)')
def test_action_callback(self, **options):
import taskgraph.parameters
from taskgraph.util.taskcluster import get_task_definition
import taskgraph.actions
import yaml
@@ -283,37 +280,30 @@ class MachCommands(MachCommandBase):
elif filename.endswith('.json'):
return json.load(f)
else:
raise Exception("unknown filename {}".format(filename))
try:
self.setup_logging()
task_id = options['task_id']
- if options['task']:
- task = load_data(options['task'])
- elif task_id:
- task = get_task_definition(task_id)
- else:
- task = None
if options['input']:
input = load_data(options['input'])
else:
input = None
parameters = taskgraph.parameters.load_parameters_file(options['parameters'])
parameters.check()
root = options['root']
return taskgraph.actions.trigger_action_callback(
task_group_id=options['task_group_id'],
task_id=task_id,
- task=task,
input=input,
callback=options['callback'],
parameters=parameters,
root=root,
test=True)
except Exception:
traceback.print_exc()
sys.exit(1)