1
0
Fork 0
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:
Lukas Kämmerling 2020-11-06 11:10:19 +01:00
parent ae398448aa
commit 3be3e46d08
19 changed files with 25 additions and 18 deletions

View file

@ -134,7 +134,7 @@ try:
from hcloud.certificates.domain import Server
from hcloud import APIException
except ImportError:
pass
APIException = None
class AnsibleHcloudCertificate(Hcloud):

View file

@ -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):

View file

@ -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):

View file

@ -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):

View file

@ -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):

View file

@ -153,7 +153,7 @@ try:
from hcloud.load_balancers.domain import LoadBalancer
from hcloud import APIException
except ImportError:
pass
APIException = None
class AnsibleHcloudLoadBalancer(Hcloud):

View file

@ -288,7 +288,7 @@ try:
LoadBalancerServiceHealthCheck, LoadBalancerServiceHealthCheckHttp
from hcloud import APIException
except ImportError:
pass
APIException = None
class AnsibleHcloudLoadBalancerService(Hcloud):

View file

@ -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):

View file

@ -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):

View file

@ -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):

View file

@ -100,7 +100,7 @@ try:
from hcloud.networks.domain import NetworkRoute
except ImportError:
APIException = None
NetworkSubnet = None
NetworkRoute = None
class AnsibleHcloudRoute(Hcloud):

View file

@ -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):

View file

@ -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):

View file

@ -123,7 +123,6 @@ try:
from hcloud import APIException
except ImportError:
APIException = None
NetworkSubnet = None
class AnsibleHcloudServerNetwork(Hcloud):

View file

@ -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):

View file

@ -124,7 +124,7 @@ try:
from hcloud.ssh_keys.domain import Server
from hcloud import APIException
except ImportError:
pass
APIException = None
class AnsibleHcloudSSHKey(Hcloud):

View file

@ -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):

View file

@ -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):

View file

@ -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):