mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
Adjust import fallbacks when APIException was not importable
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
This commit is contained in:
parent
ae398448aa
commit
3be3e46d08
19 changed files with 25 additions and 18 deletions
|
|
@ -134,7 +134,7 @@ try:
|
|||
from hcloud.certificates.domain import Server
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudCertificate(Hcloud):
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudCertificateInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudDatacenterInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudFloatingIPInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudImageInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ try:
|
|||
from hcloud.load_balancers.domain import LoadBalancer
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancer(Hcloud):
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ try:
|
|||
LoadBalancerServiceHealthCheck, LoadBalancerServiceHealthCheckHttp
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancerService(Hcloud):
|
||||
|
|
|
|||
|
|
@ -147,6 +147,9 @@ try:
|
|||
from hcloud.load_balancers.domain import LoadBalancerTarget, LoadBalancerTargetLabelSelector, LoadBalancerTargetIP
|
||||
except ImportError:
|
||||
APIException = None
|
||||
LoadBalancerTarget = None
|
||||
LoadBalancerTargetLabelSelector = None
|
||||
LoadBalancerTargetIP = None
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancerTarget(Hcloud):
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudLocationInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudNetworkInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ try:
|
|||
from hcloud.networks.domain import NetworkRoute
|
||||
except ImportError:
|
||||
APIException = None
|
||||
NetworkSubnet = None
|
||||
NetworkRoute = None
|
||||
|
||||
|
||||
class AnsibleHcloudRoute(Hcloud):
|
||||
|
|
|
|||
|
|
@ -257,7 +257,10 @@ try:
|
|||
from hcloud.servers.domain import Server
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
Volume = None
|
||||
SSHKey = None
|
||||
Server = None
|
||||
|
||||
|
||||
class AnsibleHcloudServer(Hcloud):
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudServerInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ try:
|
|||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
NetworkSubnet = None
|
||||
|
||||
|
||||
class AnsibleHcloudServerNetwork(Hcloud):
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudServerTypeInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ try:
|
|||
from hcloud.ssh_keys.domain import Server
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudSSHKey(Hcloud):
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudSSHKeyInfo(Hcloud):
|
||||
|
|
|
|||
|
|
@ -169,7 +169,9 @@ try:
|
|||
from hcloud.servers.domain import Server
|
||||
import hcloud
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
Volume = None
|
||||
Server = None
|
||||
|
||||
|
||||
class AnsibleHcloudVolume(Hcloud):
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hclou
|
|||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudVolumeInfo(Hcloud):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue