Skip to content

Commit a485e5f

Browse files
committed
fix bug #50; implement RFE #49
1 parent 8e39523 commit a485e5f

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

rhsda.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ def mget_cves(self, cves, numThreads=0, onlyCount=False, outFormat='plaintext',
651651
cves = extract_cves_from_input(cves)
652652
elif not isinstance(cves, list):
653653
raise ValueError("Invalid 'cves=' argument input; must be list, string, or file obj")
654+
if not len(cves):
655+
return []
654656
# Configure threads
655657
if not numThreads:
656658
numThreads = numThreadsDefault

rhsecapi.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,31 @@
2222
import sys
2323
import logging
2424
import rhsda
25+
from os import path
2526

26-
# Optional module
27-
try:
28-
import argcomplete
29-
haveArgcomplete = True
30-
except:
31-
print("Missing optional python module: argcomplete\n"
32-
"Install it to enable bash auto-magic tab-completion:\n"
33-
" yum/dnf install python-pip; pip install argcomplete\n"
34-
" activate-global-python-argcomplete; (Then restart shell)\n", file=sys.stderr)
35-
haveArgcomplete = False
27+
# Optional argcomplete module
28+
haveArgcomplete = False
29+
if not (path.isfile(path.expanduser('~/.rhsecapi-no-argcomplete')) or path.isfile('/etc/rhsecapi-no-argcomplete')):
30+
try:
31+
import argcomplete
32+
haveArgcomplete = True
33+
except:
34+
print("Missing optional python module: argcomplete\n\n"
35+
" To enable bash auto-magic tab-completion, install it:\n"
36+
" yum/dnf install python-pip\n"
37+
" pip install argcomplete\n"
38+
" activate-global-python-argcomplete\n"
39+
" (Open new shell)\n\n"
40+
" To skip using argcomplete AND disable future printing of this message:\n"
41+
" touch ~/.rhsecapi-no-argcomplete\n"
42+
" OR\n"
43+
" touch /etc/rhsecapi-no-argcomplete\n", file=sys.stderr)
3644

3745
# Globals
3846
prog = 'rhsecapi'
3947
vers = {}
40-
vers['version'] = '1.0.0_rc5'
41-
vers['date'] = '2016/11/22'
48+
vers['version'] = '1.0.0_rc6'
49+
vers['date'] = '2016/11/24'
4250

4351

4452
# Logging

0 commit comments

Comments
 (0)