mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
lint: fix unused-import errors (#195)
The linting rule `unused-import` was recently activated in ansible-test. This commit removes all unused imports to satify the linting rule.
This commit is contained in:
parent
e218306028
commit
43ae035040
27 changed files with 2 additions and 130 deletions
|
|
@ -12,7 +12,6 @@ from ansible.module_utils.basic import env_fallback, missing_required_lib
|
|||
|
||||
try:
|
||||
import hcloud
|
||||
from hcloud import APIException
|
||||
|
||||
HAS_HCLOUD = True
|
||||
except ImportError:
|
||||
|
|
|
|||
|
|
@ -142,13 +142,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud.certificates.domain import Certificate
|
||||
from hcloud.certificates.domain import Server
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudCertificate(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -90,11 +90,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudCertificateInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -85,11 +85,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudDatacenterInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -169,11 +169,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudFloatingIP(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -102,11 +102,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudFloatingIPInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -108,11 +108,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudImageInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -149,12 +149,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud.load_balancers.domain import LoadBalancer
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancer(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -264,11 +264,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancerInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -99,12 +99,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
NetworkSubnet = None
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancerNetwork(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ from ansible.module_utils._text import to_native
|
|||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud.load_balancers.domain import LoadBalancer, LoadBalancerService, LoadBalancerServiceHttp, \
|
||||
from hcloud.load_balancers.domain import LoadBalancerService, LoadBalancerServiceHttp, \
|
||||
LoadBalancerHealthCheck, LoadBalancerHealtCheckHttp
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
|
|
|
|||
|
|
@ -144,10 +144,8 @@ from ansible.module_utils._text import to_native
|
|||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
from hcloud.load_balancers.domain import LoadBalancerTarget, LoadBalancerTargetLabelSelector, LoadBalancerTargetIP
|
||||
except ImportError:
|
||||
APIException = None
|
||||
LoadBalancerTarget = None
|
||||
LoadBalancerTargetLabelSelector = None
|
||||
LoadBalancerTargetIP = None
|
||||
|
|
|
|||
|
|
@ -92,11 +92,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class AnsibleHcloudLoadBalancerTypeInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -84,11 +84,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudLocationInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -114,11 +114,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudNetwork(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -184,11 +184,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudNetworkInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -139,11 +139,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudPrimaryIP(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -143,11 +143,6 @@ from ansible.module_utils._text import to_native
|
|||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common import utils
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudReverseDNS(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -96,10 +96,8 @@ from ansible.module_utils._text import to_native
|
|||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
from hcloud.networks.domain import NetworkRoute
|
||||
except ImportError:
|
||||
APIException = None
|
||||
NetworkRoute = None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -342,18 +342,13 @@ try:
|
|||
from hcloud.volumes.domain import Volume
|
||||
from hcloud.ssh_keys.domain import SSHKey
|
||||
from hcloud.servers.domain import Server, ServerCreatePublicNetwork
|
||||
from hcloud.firewalls.domain import Firewall, FirewallResource
|
||||
from hcloud.primary_ips.domain import PrimaryIP
|
||||
from hcloud import APIException
|
||||
from hcloud.firewalls.domain import FirewallResource
|
||||
except ImportError:
|
||||
APIException = None
|
||||
Volume = None
|
||||
SSHKey = None
|
||||
Server = None
|
||||
ServerCreatePublicNetwork = None
|
||||
Firewall = None
|
||||
FirewallResource = None
|
||||
PrimaryIP = None
|
||||
|
||||
|
||||
class AnsibleHcloudServer(Hcloud):
|
||||
|
|
|
|||
|
|
@ -147,11 +147,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudServerInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -99,11 +99,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudServerTypeInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -118,14 +118,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud.volumes.domain import Volume
|
||||
from hcloud.ssh_keys.domain import SSHKey
|
||||
from hcloud.ssh_keys.domain import Server
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudSSHKey(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -84,11 +84,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudSSHKeyInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -133,10 +133,8 @@ from ansible.module_utils._text import to_native
|
|||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
from hcloud.networks.domain import NetworkSubnet
|
||||
except ImportError:
|
||||
APIException = None
|
||||
NetworkSubnet = None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -165,15 +165,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud.volumes.domain import Volume
|
||||
from hcloud.servers.domain import Server
|
||||
import hcloud
|
||||
except ImportError:
|
||||
APIException = None
|
||||
Volume = None
|
||||
Server = None
|
||||
|
||||
|
||||
class AnsibleHcloudVolume(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
|
|
@ -99,11 +99,6 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils._text import to_native
|
||||
from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud
|
||||
|
||||
try:
|
||||
from hcloud import APIException
|
||||
except ImportError:
|
||||
APIException = None
|
||||
|
||||
|
||||
class AnsibleHcloudVolumeInfo(Hcloud):
|
||||
def __init__(self, module):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue