Skip to content

Clone task fails due to not setting task id #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
russorat opened this issue Mar 23, 2021 · 0 comments · Fixed by #217
Closed

Clone task fails due to not setting task id #216

russorat opened this issue Mar 23, 2021 · 0 comments · Fixed by #217
Milestone

Comments

@russorat
Copy link
Contributor

Trying to call tasks_api.clone_task(my_task) fails because it tries to create a new task with an ID of None, which fails in the Task setter.

Traceback (most recent call last):
  File "/Users/rsavage/workspace/pm-team/tools-cluster/./generate-tasks.py", line 54, in <module>
    main(config, args.task_id, args.clones, args.inactive)
  File "/Users/rsavage/workspace/pm-team/tools-cluster/./generate-tasks.py", line 14, in main
    new_task = tasks_api.clone_task(task)
  File "/usr/local/lib/python3.9/site-packages/influxdb_client/client/tasks_api.py", line 101, in clone_task
    cloned = Task(name=task.name, org_id=task.org_id, org=task.org, flux=task.flux, status="active")
  File "/usr/local/lib/python3.9/site-packages/influxdb_client/domain/task.py", line 101, in __init__
    self.id = id
  File "/usr/local/lib/python3.9/site-packages/influxdb_client/domain/task.py", line 153, in id
    raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `id`, must not be `None`

https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/tasks_api.py#L101

@bednar bednar added this to the 1.16.0 milestone Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants