Skip to content

Commit 3cec49e

Browse files
committed
Minor 1.5.7
Added references option to the documents call.
1 parent 79f2ccc commit 3cec49e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vulners/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = "1.5.6"
3+
__version__ = "1.5.7"
44

55
from vulners.api import Vulners

vulners/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,15 @@ def cpeVulnerabilities(self, cpeString, maxVulnerabilities = 50):
519519
dataDocs[elementData.get('bulletinFamily')] = dataDocs.get(elementData.get('bulletinFamily'), []) + [elementData]
520520
return dataDocs
521521

522-
def document(self, identificator, fields = None):
522+
def document(self, identificator, fields = None, references = False):
523523
"""
524524
Fetch information about bulletin by identificator
525525
526526
:param identificator: Bulletin ID. As example - CVE-2017-14174
527527
:param references: Search for the references in all collections
528528
:return: bulletin data dict
529529
"""
530-
results = self.__id(identificator, references=False, fields = fields or self.default_fields)
530+
results = self.__id(identificator, references=references, fields = fields or self.default_fields)
531531
return results.get('documents', {}).get(identificator, {})
532532

533533
def audit(self, os, os_version, package):
@@ -597,7 +597,7 @@ def kbUpdates(self, kb_identificator, fields = None):
597597
dataDocs.append(element.get('_source'))
598598
return AttributeList(dataDocs, total=total)
599599

600-
def documentList(self, identificatorList, fields = None):
600+
def documentList(self, identificatorList, fields = None, references = False):
601601
"""
602602
Fetch information about multiple bulletin identificators
603603
@@ -607,7 +607,7 @@ def documentList(self, identificatorList, fields = None):
607607

608608
if not isinstance(identificatorList, (list,set)) or not all(isinstance(item, string_types) for item in identificatorList):
609609
raise TypeError('Identificator list is expected to be a list of strings')
610-
return self.__id(identificatorList, references=False, fields=fields or self.default_fields).get('documents')
610+
return self.__id(identificatorList, references=references, fields=fields or self.default_fields).get('documents')
611611

612612
def references(self, identificator, fields = None):
613613
"""

0 commit comments

Comments
 (0)