From b8f27b75934c15f616d1580613218aad0cac04b2 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 26 Aug 2019 17:35:18 +0200 Subject: [PATCH] [enh] add --force to 'dyndns update' --- data/actionsmap/yunohost.yml | 4 ++++ src/yunohost/dyndns.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 2b87b6daa..454ccc76e 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -1533,6 +1533,10 @@ dyndns: -i: full: --ipv4 help: IP address to send + -f: + full: --force + help: Force the update (for debugging only) + action: store_true -6: full: --ipv6 help: IPv6 address to send diff --git a/src/yunohost/dyndns.py b/src/yunohost/dyndns.py index c4558d79c..0a5b8c180 100644 --- a/src/yunohost/dyndns.py +++ b/src/yunohost/dyndns.py @@ -176,7 +176,7 @@ def dyndns_subscribe(operation_logger, subscribe_host="dyndns.yunohost.org", dom @is_unit_operation() def dyndns_update(operation_logger, dyn_host="dyndns.yunohost.org", domain=None, key=None, - ipv4=None, ipv6=None): + ipv4=None, ipv6=None, force=False): """ Update IP on DynDNS platform @@ -249,7 +249,7 @@ def dyndns_update(operation_logger, dyn_host="dyndns.yunohost.org", domain=None, logger.debug("Requested IPv4/v6 are (%s, %s)" % (ipv4, ipv6)) # no need to update - if old_ipv4 == ipv4 and old_ipv6 == ipv6: + if not force and (old_ipv4 == ipv4 and old_ipv6 == ipv6): logger.info("No updated needed.") return else: