File: dry_run.py

package info (click to toggle)
ddupdate 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 420 kB
  • sloc: python: 1,899; sh: 38; makefile: 35
file content (27 lines) | stat: -rw-r--r-- 697 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
ddupdate dummy plugin making absolutely no update.

See: ddupdate(8)
"""

from ddupdate.ddplugin import ServicePlugin


class DryRunPlugin(ServicePlugin):
    """
    Prints the ip address obtained and configured hostname to update.

    Does not invoke any action. Primarely a debug tool.

    Options used: none
    """

    _name = 'dry-run'
    _oneliner = 'Debug dummy update plugin'
    _ip_cache_ttl = 1    # we do not cache these runs, right?

    def register(self, log, hostname, ip, options):
        """Run the actual module work."""
        print("dry-run: Using")
        print("    v4 address: %s\n    v6 address: %s\n    hostname: %s"
              % (ip.v4, ip.v6, hostname))