This commit is contained in:
Antonio J. Delgado 2023-10-06 18:09:02 +03:00
parent 0e0450549e
commit 4b023a01a3
3 changed files with 13 additions and 8 deletions

View file

@ -68,7 +68,7 @@ the hostname: {data}"""
'fieldType': "A",
'subDomain': self.config['hostname'],
'target': ipv4,
'ttl': 3600
'ttl': self.config['ttl']
}
if record_exists:
if record_exists['target'] != ipv4:
@ -88,8 +88,8 @@ hostname, updating it."""
)
sys.exit(1)
else:
result = f"""A record exists {record_exists} with the same
target, doing nothing."""
result = f"A record exists {record_exists} with the same\
target, doing nothing."
else:
self._log.debug(
"No A record exists for this hostname, creating it."
@ -113,14 +113,14 @@ target, doing nothing."""
if data['subDomain'] == self.config['hostname']:
record_exists = data
self._log.debug(
f"""Found a record that match the 'subDomain' with
the hostname: {data}"""
f"Found a record that match the 'subDomain' with\
the hostname: {data}"
)
params = {
'fieldType': "AAAA",
'subDomain': self.config['hostname'],
'target': ipv6,
'ttl': 3600
'ttl': self.config['ttl']
}
if record_exists:
if record_exists['target'] != ipv6:
@ -311,6 +311,11 @@ then you have to enter the IP value with this option.'''
help='''If the selected method is value,
then you can optionally to enter the IPv6 value with this option.'''
)
@click.option(
'--ttl', '-t',
default=3600,
help='Time-To-Live for the record.'
)
@click_config_file.configuration_option()
def __main__(**kwargs):
return odi6(**kwargs)

View file

@ -7,7 +7,7 @@ Homepage = "https://susurrando.com"
[project]
name = "odi6"
version = "0.0.5"
version = "0.0.6"
description = "Update Dynamic Host IPv6 in OVH"
readme = "README.md"
authors = [{ name = "Antonio J. Delgado", email = "antonio@susurrando.com" }]

View file

@ -1,6 +1,6 @@
[metadata]
name = odi6
version = 0.0.5
version = 0.0.6
[options]
packages = odi6