From d2c462100876a53560ca3010987ee0a87e463952 Mon Sep 17 00:00:00 2001 From: Artem Loginov Date: Thu, 18 Nov 2021 16:39:34 +0000 Subject: [PATCH 1/2] Fix GCP Snapshot module when using own Encryption key --- plugins/modules/gcp_compute_snapshot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/modules/gcp_compute_snapshot.py b/plugins/modules/gcp_compute_snapshot.py index 7f2a61695..67a1ab9f8 100644 --- a/plugins/modules/gcp_compute_snapshot.py +++ b/plugins/modules/gcp_compute_snapshot.py @@ -456,6 +456,8 @@ def resource_to_request(module): u'name': module.params.get('name'), u'description': module.params.get('description'), u'storageLocations': module.params.get('storage_locations'), + u'sourceDiskEncryptionKey': SnapshotSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}),module).to_request(), + u'snapshotEncryptionKey': SnapshotSnapshotencryptionkey(module.params.get('snapshot_encryption_key', {}),module).to_request(), u'labels': module.params.get('labels'), } return_vals = {} @@ -534,6 +536,10 @@ def response_to_hash(module, response): u'description': module.params.get('description'), u'storageBytes': response.get(u'storageBytes'), u'storageLocations': response.get(u'storageLocations'), + u'sourceDiskEncryptionKey': SnapshotSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}), + module).from_response(), + u'snapshotEncryptionKey': SnapshotSnapshotencryptionkey(module.params.get('snapshot_encryption_key', {}), + module).from_response(), u'licenses': response.get(u'licenses'), u'labels': response.get(u'labels'), u'labelFingerprint': response.get(u'labelFingerprint'), From 613d68e41f29b024369ceef2c9805c787318143a Mon Sep 17 00:00:00 2001 From: Artem Loginov Date: Thu, 18 Nov 2021 16:43:44 +0000 Subject: [PATCH 2/2] Fix GCP Snapshot module when using own Encryption key --- plugins/modules/gcp_compute_snapshot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/modules/gcp_compute_snapshot.py b/plugins/modules/gcp_compute_snapshot.py index 67a1ab9f8..8398e000d 100644 --- a/plugins/modules/gcp_compute_snapshot.py +++ b/plugins/modules/gcp_compute_snapshot.py @@ -456,8 +456,10 @@ def resource_to_request(module): u'name': module.params.get('name'), u'description': module.params.get('description'), u'storageLocations': module.params.get('storage_locations'), - u'sourceDiskEncryptionKey': SnapshotSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}),module).to_request(), - u'snapshotEncryptionKey': SnapshotSnapshotencryptionkey(module.params.get('snapshot_encryption_key', {}),module).to_request(), + u'sourceDiskEncryptionKey': SnapshotSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}), + module).to_request(), + u'snapshotEncryptionKey': SnapshotSnapshotencryptionkey(module.params.get('snapshot_encryption_key', {}), + module).to_request(), u'labels': module.params.get('labels'), } return_vals = {}