Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor content fetching #237

Merged
merged 43 commits into from
Mar 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
52ac17b
Extract method __get_dest_file_name
jan-cerny Mar 2, 2023
200eab4
Stop splitting URI
jan-cerny Mar 2, 2023
c298359
Stop passing object property as a method argument
jan-cerny Mar 2, 2023
7b0ae59
Change __get_dest_file_name to a property
jan-cerny Mar 2, 2023
f13a3b4
Set destination file name when URI is set
jan-cerny Mar 2, 2023
3a0ef3c
Remove unused parameter
jan-cerny Mar 2, 2023
af9c56e
Split method into 2 methods
jan-cerny Mar 2, 2023
2a030c9
Move fingerprint verification out from content analysis
jan-cerny Mar 2, 2023
c6038d4
Verify fingerprint of the downloaded file
jan-cerny Mar 2, 2023
b49dfff
Remove unused class member
jan-cerny Mar 2, 2023
e30695b
Pass the target URL as a parameter to fetch_content
jan-cerny Mar 2, 2023
89457dd
Move method closer to the caller method
jan-cerny Mar 2, 2023
b55b617
Move clear_all to PolicyData
jan-cerny Mar 3, 2023
e92b724
Remove unused code
jan-cerny Mar 3, 2023
ab6be82
Move method use_system_content
jan-cerny Mar 3, 2023
7e78b23
Move variable access
jan-cerny Mar 3, 2023
5d043d1
Move get_preffered_tailoring to ObtainedContent
jan-cerny Mar 3, 2023
a22296b
Move variable access
jan-cerny Mar 3, 2023
0012b07
Move method get_preffered_content
jan-cerny Mar 3, 2023
a04f4e8
Move use_downloaded_content to the PolicyData class
jan-cerny Mar 3, 2023
01b0237
Move variable access
jan-cerny Mar 3, 2023
990fe9a
Rename variable
jan-cerny Mar 3, 2023
46d028f
Don't access self._addon_data
jan-cerny Mar 3, 2023
8dec02d
Stop accessing self._addon_data
jan-cerny Mar 3, 2023
3ac39f8
Stop accessing self._addon_data
jan-cerny Mar 3, 2023
9cd6cf5
Remove PolicyData from ContentBringer
jan-cerny Mar 3, 2023
762be9b
Change get_content_type to static private method
jan-cerny Mar 3, 2023
f73871e
Change reduce_files to static method
jan-cerny Mar 3, 2023
a77dbf2
Change method to static
jan-cerny Mar 3, 2023
0fdaa65
Change method to private static method
jan-cerny Mar 3, 2023
f66b65b
Change method to static private method
jan-cerny Mar 3, 2023
680bc0c
Change method to private static method
jan-cerny Mar 3, 2023
617f466
Create ContentAnalyzer
jan-cerny Mar 3, 2023
292ac14
Move content analysis out from finish_content_fetch
jan-cerny Mar 3, 2023
5073ae4
Remove unused parameters
jan-cerny Mar 3, 2023
554ae38
Finish content fetching only if started
jan-cerny Mar 3, 2023
c086edd
Remove unused code
jan-cerny Mar 6, 2023
eeda474
Move the decision of verifying fingerprint
jan-cerny Mar 6, 2023
212ed3a
Move the failure callback parameter
jan-cerny Mar 6, 2023
94c97b4
Add missing doctext
jan-cerny Mar 6, 2023
b6c317e
Fix code style
jan-cerny Mar 6, 2023
3ca3959
Move methods out of PolicyData class
jan-cerny Mar 10, 2023
df9fd5c
Rename _content_uri to _valid_content_uri
jan-cerny Mar 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change method to static
Change allow_one_expected_tailoring_or_no_tailoring method
to private static method because it doesn't access self and
it isn't used outside of this class.
  • Loading branch information
jan-cerny committed Mar 3, 2023
commit a77dbf267db2c0036cfbfbd06931a7aefff45680
5 changes: 3 additions & 2 deletions org_fedora_oscap/content_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def _verify_fingerprint(self, fingerprint=""):
raise content_handling.ContentCheckError(msg)
log.info(f"Integrity check passed using {hash_obj.name} hash")

def allow_one_expected_tailoring_or_no_tailoring(self, labelled_files, expected_tailoring):
@staticmethod
def __allow_one_expected_tailoring_or_no_tailoring(labelled_files, expected_tailoring):
tailoring_label = CONTENT_TYPES["TAILORING"]
if expected_tailoring:
labelled_files = ContentBringer.reduce_files(labelled_files, expected_tailoring, [tailoring_label])
Expand All @@ -214,7 +215,7 @@ def filter_discovered_content(self, labelled_files, expected_path, expected_tail
if expected_path:
labelled_files = ContentBringer.reduce_files(labelled_files, expected_path, categories)

labelled_files = self.allow_one_expected_tailoring_or_no_tailoring(labelled_files, expected_tailoring)
labelled_files = ContentBringer.__allow_one_expected_tailoring_or_no_tailoring(labelled_files, expected_tailoring)

categories = (CONTENT_TYPES["CPE_DICT"], )
if expected_cpe_path:
Expand Down