Add TTL
This commit is contained in:
parent
0e0450549e
commit
4b023a01a3
3 changed files with 13 additions and 8 deletions
17
odi6/odi6.py
17
odi6/odi6.py
|
@ -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)
|
||||
|
|
|
@ -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" }]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[metadata]
|
||||
name = odi6
|
||||
version = 0.0.5
|
||||
version = 0.0.6
|
||||
|
||||
[options]
|
||||
packages = odi6
|
||||
|
|
Loading…
Reference in a new issue