From bf2adbd49e593f713957201ba6d8db2b51e04a19 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 20 Feb 2019 02:29:49 -0800 Subject: [PATCH] Update docstring and fix ValueError on incorrect condition --- packaging_scripts/repos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging_scripts/repos.py b/packaging_scripts/repos.py index bc509b2..4f9ac9d 100644 --- a/packaging_scripts/repos.py +++ b/packaging_scripts/repos.py @@ -39,7 +39,7 @@ def gen_cmdline(operation, db, opts, *pkgs): :rtype: list :raises: ValueError if operation was invalid """ - if not operation == 'add' or operation == 'remove': + if not operation == 'add' or not operation == 'remove': raise ValueError('Invalid operation was requested') cmd = [f"/usr/bin/repo-{operation}"] @@ -74,6 +74,7 @@ def repo_add(operation, db, *pkgs, opts=None): then pkgs is the name of the packages to remove from the database. :type pkgs: any iterable :raises: RepoAddError if repo-add failed + :raises: ValueError if an invalid operation was requested """ if operation == 'add': syslog.info('Adding packages to database')