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

fix: Update value format of CupsBrowsedConf #4230

Merged

Conversation

wushiqinlou
Copy link
Contributor

@wushiqinlou wushiqinlou commented Sep 28, 2024

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • No Sensitive Data in this change?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

Update the value format of this parser to adjust the Advisor rule.

  • Per the manual and tests of cups_browsed.conf,
    different directives will be handled differently. E.g,
    for BrowseAllow, all its configured values will be kept,
    but for BrowseRemoteProtocols, only its last one will work.

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.69%. Comparing base (19e6afa) to head (baf4549).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4230      +/-   ##
==========================================
- Coverage   76.70%   76.69%   -0.01%     
==========================================
  Files         759      759              
  Lines       41792    41788       -4     
  Branches     9604     9603       -1     
==========================================
- Hits        32055    32051       -4     
  Misses       8638     8638              
  Partials     1099     1099              
Flag Coverage Δ
unittests 76.67% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wushiqinlou wushiqinlou changed the title Enhance cups confs CupsBrowsedConf fix: Update value format of cups confs CupsBrowsedConf Sep 28, 2024
Signed-off-by: jiazhang <jiazhang@redhat.com>
@wushiqinlou wushiqinlou force-pushed the Enhance_cups_confs_CupsBrowsedConf branch from 7a71d94 to a699136 Compare September 28, 2024 11:07
assert result['BrowseRemoteProtocols'] == ['dnssd', 'cups']
assert sorted(result['BrowseAllow']) == sorted(['192.168.0.1', '192.168.0.255', 'cups.example.com'])
assert result['BrowseRemoteProtocols'] == ['dnssd cups', 'none']
assert result['BrowseAllow'] == ['192.168.0.1', '192.168.0.255', 'cups.example.com', '192.168.0.255']
Copy link
Contributor

@xiangce xiangce Sep 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add a special description (note) to the parser's doc, like:

.. note::

  Values of each directives will be store as a list with the original order, 
  and duplicated values will be kept without de-duplication.

Signed-off-by: jiazhang <jiazhang@redhat.com>
@wushiqinlou wushiqinlou force-pushed the Enhance_cups_confs_CupsBrowsedConf branch from 548b9a2 to 1419dbf Compare September 28, 2024 11:37
@xiangce xiangce changed the title fix: Update value format of cups confs CupsBrowsedConf fix: Update value format of CupsBrowsedConf Sep 28, 2024
Signed-off-by: jiazhang <jiazhang@redhat.com>
@xiangce xiangce merged commit 31bfcdb into RedHatInsights:master Sep 28, 2024
14 checks passed
xiangce pushed a commit that referenced this pull request Sep 28, 2024
- Per the manual and tests of cups_browsed.conf,
  different directives will be handled differently. E.g,
  for BrowseAllow, all its configured values will be kept,
  but for BrowseRemoteProtocols, only its last one will work.

Signed-off-by: jiazhang <jiazhang@redhat.com>
(cherry picked from commit 31bfcdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants