Update docstring and fix ValueError on incorrect condition

This commit is contained in:
Eric Torres 2019-02-20 02:29:49 -08:00
parent d96ed7cfde
commit bf2adbd49e

View File

@ -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')