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

Fixed parsing CDROM apt sources #62475

Merged
merged 4 commits into from
Oct 7, 2022

Conversation

s0undt3ch
Copy link
Collaborator

@s0undt3ch s0undt3ch commented Aug 16, 2022

What does this PR do?

See title

What issues does this PR fix or reference?

Fixes #62474
Fixes #62485

@s0undt3ch s0undt3ch requested a review from a team as a code owner August 16, 2022 20:37
@s0undt3ch s0undt3ch requested review from ScriptAutomate and removed request for a team August 16, 2022 20:37
@s0undt3ch
Copy link
Collaborator Author

There are some valid test failures. Looking into them.

@ScriptAutomate ScriptAutomate requested review from a team and garethgreenaway and removed request for ScriptAutomate and a team August 17, 2022 22:30
@s0undt3ch s0undt3ch force-pushed the hotfix/apt-cdrom-source branch from a8b3f07 to 257eda4 Compare August 18, 2022 09:14
@s0undt3ch s0undt3ch force-pushed the hotfix/apt-cdrom-source branch 2 times, most recently from 673a8c6 to 615ab51 Compare August 18, 2022 12:58
@s0undt3ch s0undt3ch force-pushed the hotfix/apt-cdrom-source branch from 615ab51 to 2575172 Compare August 18, 2022 16:02
salt/states/pkgrepo.py Show resolved Hide resolved
@@ -3006,7 +3014,7 @@ def file_dict(*packages, **kwargs):
return __salt__["lowpkg.file_dict"](*packages)


def expand_repo_def(**kwargs):
def _expand_repo_def(os_name, lsb_distrib_codename=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

We are changing behavior to this function by now requiring os_name and lsb_distrib_codename. If someone were calling expand_repo_def previously then they would have to update their kwargs/args without warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function is now private.
I can keep the old one, which has the deprecation, with the precious signature, since it has access to dunders....

Copy link
Contributor

Choose a reason for hiding this comment

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

that works

Copy link
Contributor

Choose a reason for hiding this comment

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

In the function that is getting deprecated can we set os_name and lsb_distrib_codename from __grains__ if its not in kwargs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@garethgreenaway garethgreenaway requested a review from Ch3LL October 5, 2022 16:46
Need to import os
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

Hi! I'm your friendly PR bot!

You might be wondering what I'm doing commenting here on your PR.

Yes, as a matter of fact, I am...

I'm just here to help us improve the documentation. I can't respond to
questions or anything, but what I can do, I do well!

Okay... so what do you do?

I detect modules that are missing docstrings or "CLI Example" on existing docstrings!
When I was created we had a lot of these. The documentation for these
modules need some love and attention to make Salt better for our users.

So what does that have to do with my PR?

I noticed that in this PR there are some files changed that have some of these
issues. So I'm leaving this comment to let you know your options.

Okay, what are they?

Well, my favorite, is that since you were making changes here I'm hoping that
you would be the most familiar with this module and be able to add some other
examples or fix any of the reported issues.

If I can, then what?

Well, you can either add them to this PR or add them to another PR. Either way is fine!

Well... what if I can't, or don't want to?

That's also fine! We appreciate all contributions to the Salt Project. If you
can't add those other examples, either because you're too busy, or unfamiliar,
or you just aren't interested, we still appreciate the contributions that
you've made already.

Whatever approach you decide to take, just drop a comment here letting us know!

Detected Issues (click me)
Check Known Missing Docstrings...........................................Failed
- hook id: invoke
- exit code: 1

/home/runner/.cache/pre-commit/repo6w35axel/py_env-python3/lib/python3.9/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
The function 'expand_repo_def' on 'salt/modules/aptpkg.py' does not have a 'CLI Example:' in its docstring
Found 1 errors


Thanks again!

1 similar comment
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

Hi! I'm your friendly PR bot!

You might be wondering what I'm doing commenting here on your PR.

Yes, as a matter of fact, I am...

I'm just here to help us improve the documentation. I can't respond to
questions or anything, but what I can do, I do well!

Okay... so what do you do?

I detect modules that are missing docstrings or "CLI Example" on existing docstrings!
When I was created we had a lot of these. The documentation for these
modules need some love and attention to make Salt better for our users.

So what does that have to do with my PR?

I noticed that in this PR there are some files changed that have some of these
issues. So I'm leaving this comment to let you know your options.

Okay, what are they?

Well, my favorite, is that since you were making changes here I'm hoping that
you would be the most familiar with this module and be able to add some other
examples or fix any of the reported issues.

If I can, then what?

Well, you can either add them to this PR or add them to another PR. Either way is fine!

Well... what if I can't, or don't want to?

That's also fine! We appreciate all contributions to the Salt Project. If you
can't add those other examples, either because you're too busy, or unfamiliar,
or you just aren't interested, we still appreciate the contributions that
you've made already.

Whatever approach you decide to take, just drop a comment here letting us know!

Detected Issues (click me)
Check Known Missing Docstrings...........................................Failed
- hook id: invoke
- exit code: 1

/home/runner/.cache/pre-commit/repo6w35axel/py_env-python3/lib/python3.9/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
The function 'expand_repo_def' on 'salt/modules/aptpkg.py' does not have a 'CLI Example:' in its docstring
Found 1 errors


Thanks again!

@garethgreenaway garethgreenaway merged commit d1d8e42 into saltstack:master Oct 7, 2022
s0undt3ch added a commit to s0undt3ch/salt that referenced this pull request Oct 7, 2022
Ch3LL pushed a commit that referenced this pull request Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict PR has a merge conflict
Projects
None yet
3 participants