Skip to content
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

add to ovirt snapshot download and upload disk #46696

Merged
merged 4 commits into from Dec 17, 2018

Conversation

mnecas
Copy link
Contributor

@mnecas mnecas commented Oct 9, 2018

SUMMARY

add upload and download to ovirt snapshot disk

Fixes #44268

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
ANSIBLE VERSION

ansible 2.6.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/mnecas/Desktop/Projects/Redhat/ansible/lib/ansible/modules/cloud/ovirt']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15 (default, Sep 21 2018, 23:26:48) [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)]

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Oct 9, 2018

@mnecas: thank you for submitting this pull-request!

cc @machacekondra @mwperina
click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. virt Virt community (incl. QEMU, KVM, libvirt, ovirt, RHV and Proxmox) support:community This issue/PR relates to code supported by the Ansible community. labels Oct 9, 2018
@webknjaz webknjaz removed the needs_triage Needs a first human triage before being processed. label Oct 9, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Oct 9, 2018
@ansibot
Copy link
Contributor

ansibot commented Oct 9, 2018

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py:405:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py:417:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py:0:0: E322 "disk_id" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py:0:0: E322 "disk_name" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py:0:0: E322 "image_path" is listed in the argument_spec, but not documented in the module

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Oct 9, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 10, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 25, 2018
@@ -48,6 +48,26 @@
description:
description:
- "Description of the snapshot."
disk_id:
description:
- "Disk id which you want to upload or download"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also write that either id or name is required in case of upload/download and add code that checks it was properly passed.

version_added: "2.8"
download_image_path:
description:
- "Path on a file system where disk should be downloaded."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/disk/snaphost

vm_name: myvm
upload_image_path: /path/to/mydisk.qcow2

# Download disk to local file system:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshot

@@ -136,6 +170,15 @@
except ImportError:
pass


import os
import traceback
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already imported on line 166

elif module.params.get('disk_name'):
disk_id = get_id_by_name(snapshot_disks_service, module.params.get('disk_name'))

return snapshot_disks_service.disk_service(disk_id).get().id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This id is same as disk_id so it doesn't make sense to do 'get'

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Dec 10, 2018
disk_id:
description:
- "Disk id which you want to upload or download"
- "To get disk, you need to define disk_id or disk_name"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either C(disk_id) or C(disk_name) is required when C(upload_image_path) or C(download_image_path) is specified.

version_added: "2.8"
disk_name:
description:
- "Disk name which you want to upload or download"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either C(disk_id) or C(disk_name) is required when C(upload_image_path) or C(download_image_path) is specified.

@machacekondra
Copy link
Contributor

shipit

@ansibot ansibot added automerge This PR was automatically merged by ansibot. shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Dec 17, 2018
@ansibot ansibot merged commit 651ea5d into ansible:devel Dec 17, 2018
kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
* add to ovirt snapshot download and upload disk

* ovirt snapshot update docs

* ovirt snapshot add version_added to docs

* update ovirt snapshot docs
@dagwieers dagwieers added ovirt oVirt and RHV community and removed virt Virt community (incl. QEMU, KVM, libvirt, ovirt, RHV and Proxmox) labels Feb 21, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 automerge This PR was automatically merged by ansibot. cloud feature This issue/PR relates to a feature request. module This issue/PR relates to a module. ovirt oVirt and RHV community shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add to the ansible module "ovirt_snapshots" support to download/upload of snapshots
5 participants