From 89c2cbe1ace8ebbc32ee36c30ab83ba6c5b6409e Mon Sep 17 00:00:00 2001 From: Eric Torres <erictorres4@protonmail.com> Date: Wed, 10 Apr 2019 18:42:00 -0700 Subject: [PATCH] Update exception message --- rbackup/struct/repository.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rbackup/struct/repository.py b/rbackup/struct/repository.py index 1a67f1b..2e73196 100644 --- a/rbackup/struct/repository.py +++ b/rbackup/struct/repository.py @@ -102,7 +102,7 @@ class Repository(Hierarchy): raise NotImplementedError def __iter__(self): - return self + return iter(self._snapshots) def __contains__(self, name): """Check whether a Snapshot is in this Repository by name. @@ -114,7 +114,7 @@ class Repository(Hierarchy): def __next__(self): """Return the next Snapshot in this Repository.""" - return next(self._snapshots) + return next(iter(self._snapshots)) @staticmethod def is_valid_snapshot_name(name): @@ -186,7 +186,7 @@ class Repository(Hierarchy): ) if not self.is_valid_snapshot_name(snapshot_name): - raise ValueError(f"{name} is an invalid name") + raise ValueError(f"'{name}' is an invalid name") elif snapshot_name in self: syslog.warning("Snapshot already exists, data will be overwritten.") else: