Skip to content

Commit

Permalink
fix bug #50; implement RFE #49
Browse files Browse the repository at this point in the history
  • Loading branch information
ryran committed Nov 24, 2016
1 parent 8e39523 commit a485e5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 2 additions & 0 deletions rhsda.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ def mget_cves(self, cves, numThreads=0, onlyCount=False, outFormat='plaintext',
cves = extract_cves_from_input(cves)
elif not isinstance(cves, list):
raise ValueError("Invalid 'cves=' argument input; must be list, string, or file obj")
if not len(cves):
return []
# Configure threads
if not numThreads:
numThreads = numThreadsDefault
Expand Down
32 changes: 20 additions & 12 deletions rhsecapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,31 @@
import sys
import logging
import rhsda
from os import path

# Optional module
try:
import argcomplete
haveArgcomplete = True
except:
print("Missing optional python module: argcomplete\n"
"Install it to enable bash auto-magic tab-completion:\n"
" yum/dnf install python-pip; pip install argcomplete\n"
" activate-global-python-argcomplete; (Then restart shell)\n", file=sys.stderr)
haveArgcomplete = False
# Optional argcomplete module
haveArgcomplete = False
if not (path.isfile(path.expanduser('~/.rhsecapi-no-argcomplete')) or path.isfile('/etc/rhsecapi-no-argcomplete')):
try:
import argcomplete
haveArgcomplete = True
except:
print("Missing optional python module: argcomplete\n\n"
" To enable bash auto-magic tab-completion, install it:\n"
" yum/dnf install python-pip\n"
" pip install argcomplete\n"
" activate-global-python-argcomplete\n"
" (Open new shell)\n\n"
" To skip using argcomplete AND disable future printing of this message:\n"
" touch ~/.rhsecapi-no-argcomplete\n"
" OR\n"
" touch /etc/rhsecapi-no-argcomplete\n", file=sys.stderr)

# Globals
prog = 'rhsecapi'
vers = {}
vers['version'] = '1.0.0_rc5'
vers['date'] = '2016/11/22'
vers['version'] = '1.0.0_rc6'
vers['date'] = '2016/11/24'


# Logging
Expand Down

0 comments on commit a485e5f

Please sign in to comment.