summaryrefslogtreecommitdiff
path: root/lbup/targets.py
diff options
context:
space:
mode:
Diffstat (limited to 'lbup/targets.py')
-rw-r--r--lbup/targets.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lbup/targets.py b/lbup/targets.py
index 0d3ffe8..8f30ae5 100644
--- a/lbup/targets.py
+++ b/lbup/targets.py
@@ -52,6 +52,9 @@ class Target(ABC):
else:
self._logger = logger
+ def __str__(self):
+ return "Target{%s/%s}" % (self.dirs, self.excludes)
+
def _log_command(self, name, retcode, stdout, stderr):
self._logger.debug('%s finished with return code %d' % (name, retcode))
@@ -138,6 +141,9 @@ class TargetSSH(Target):
super().__init__(name, dirs, excludes, logger)
+ def __str__(self):
+ return "%s{SSH:%s}" % (super().__str__(), str(self._remote))
+
def _paramiko_exec_cmd(self, client, cmd):
self._logger.debug('Client %s: executing command: %s' % (client, cmd))
@@ -203,6 +209,10 @@ class TargetSSHLXCLVM(TargetSSH):
super().__init__(name, dirs, excludes, logger, target_remote, target_remote_bupdir)
+ def __str__(self):
+ return "%s{LXC:%s/%s@[%s]}{LVM:%s}" % (super().__str__(), self._lxc_containername,
+ self._lxc_username, str(self._parent_remote), self._snapshot_size)
+
def save(self, data_dir):
with contextlib.ExitStack() as stack:
parent = stack.enter_context(_ssh_client.SSHConnection(self._parent_remote))