Skip to content

Commit

Permalink
Remove added_advisories for updated_advisories
Browse files Browse the repository at this point in the history
Internally, the difference between both has faded and updated_advisories
is preferred.

Signed-off-by: Hritik Vijay <[email protected]>
  • Loading branch information
Hritik14 committed Jun 25, 2021
1 parent 366d3a1 commit a530627
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 34 deletions.
11 changes: 1 addition & 10 deletions vulnerabilities/importers/elixir_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,7 @@ def set_api(self, packages):
asyncio.run(self.pkg_manager_api.load_api(packages))

def updated_advisories(self) -> Set[Advisory]:
files = self._updated_files
advisories = []
for f in files:
processed_data = self.process_file(f)
if processed_data:
advisories.append(processed_data)
return self.batch_advisories(advisories)

def added_advisories(self) -> Set[Advisory]:
files = self._added_files
files = self._updated_files.union(self._added_files)
advisories = []
for f in files:
processed_data = self.process_file(f)
Expand Down
11 changes: 1 addition & 10 deletions vulnerabilities/importers/retiredotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,7 @@ def __enter__(self):
)

def updated_advisories(self) -> Set[Advisory]:
files = self._updated_files
advisories = []
for f in files:
processed_data = self.process_file(f)
if processed_data:
advisories.append(processed_data)
return self.batch_advisories(advisories)

def added_advisories(self) -> Set[Advisory]:
files = self._added_files
files = self._updated_files.union(self._added_files)
advisories = []
for f in files:
processed_data = self.process_file(f)
Expand Down
11 changes: 1 addition & 10 deletions vulnerabilities/importers/ruby.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,7 @@ def set_api(self, packages):
asyncio.run(self.pkg_manager_api.load_api(packages))

def updated_advisories(self) -> Set[Advisory]:
files = self._updated_files
advisories = []
for f in files:
processed_data = self.process_file(f)
if processed_data:
advisories.append(processed_data)
return self.batch_advisories(advisories)

def added_advisories(self) -> Set[Advisory]:
files = self._added_files
files = self._updated_files.union(self._added_files)
advisories = []
for f in files:
processed_data = self.process_file(f)
Expand Down
5 changes: 1 addition & 4 deletions vulnerabilities/importers/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ def crates_api(self):
def set_api(self, packages):
asyncio.run(self.crates_api.load_api(packages))

def added_advisories(self) -> Set[Advisory]:
return self._load_advisories(self._added_files)

def updated_advisories(self) -> Set[Advisory]:
return self._load_advisories(self._updated_files)
return self._load_advisories(self._updated_files.union(self._added_files))

def _load_advisories(self, files) -> Set[Advisory]:
# per @tarcieri It will always be named RUSTSEC-0000-0000.md
Expand Down

0 comments on commit a530627

Please sign in to comment.