1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
Amirhossein Shaerpour 2025-04-02 17:39:55 +00:00 committed by shaerpour
parent 9bcc8a0d9f
commit f69f9a86cd
No known key found for this signature in database
GPG key ID: D89285D72B39ED8F

View file

@ -99,8 +99,8 @@ from ansible.module_utils.basic import AnsibleModule
from ..module_utils.hcloud import AnsibleHCloud
from ..module_utils.vendor.hcloud import HCloudException
from ..module_utils.vendor.hcloud.volumes import BoundVolume
from ..module_utils.vendor.hcloud.servers import BoundServer
from ..module_utils.vendor.hcloud.volumes import BoundVolume
class AnsibleHCloudServerVolume(AnsibleHCloud):
@ -119,15 +119,9 @@ class AnsibleHCloudServerVolume(AnsibleHCloud):
def _get_server_and_volume(self):
try:
if self.module.params.get("id") is not None:
self.hcloud_server_volume = self._client_get_by_name_or_id(
"volumes",
self.module.params.get("id")
)
self.hcloud_server_volume = self._client_get_by_name_or_id("volumes", self.module.params.get("id"))
else:
self.hcloud_server_volume = self._client_get_by_name_or_id(
"volumes",
self.module.params.get("volume")
)
self.hcloud_server_volume = self._client_get_by_name_or_id("volumes", self.module.params.get("volume"))
self.hcloud_server = self._client_get_by_name_or_id(
"servers",