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

Use str() method instead of repo_line for SourceEntry #62555

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

Ch3LL
Copy link
Contributor

@Ch3LL Ch3LL commented Aug 29, 2022

What does this PR do?

Call str() for both situations when python3-apt is installed and when it is not, if the uri is different.

What issues does this PR fix or reference?

Fixes: #62546

Previous Behavior

When python3-apt is installed:

local:
----------
          ID: linode-longview-repo
    Function: pkgrepo.managed
        Name: deb https://apt-longview.linode.com/ bullseye main
      Result: False
     Comment: Failed to configure repo 'deb https://apt-longview.linode.com/ bullseye main': 'SourceEntry' object has no attribute 'repo_line'
     Started: 15:45:37.512521
    Duration: 845.507 ms
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time: 845.507 ms

New Behavior

local:
----------
          ID: linode-longview-repo
    Function: pkgrepo.managed
        Name: deb https://apt-longview.linode.com/ bullseye main
      Result: True
     Comment: Configured package repo 'deb https://apt-longview.linode.com/ bullseye main'
     Started: 15:46:02.685605
    Duration: 1843.596 ms
     Changes:   
              ----------
              repo:
                  deb https://apt-longview.linode.com/ bullseye main

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:   1.844 s

@Ch3LL Ch3LL requested a review from a team as a code owner August 29, 2022 15:49
@Ch3LL Ch3LL requested review from MKLeb and garethgreenaway and removed request for a team August 29, 2022 15:49
@github-actions
Copy link

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/repo14jjgph9/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

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/repo14jjgph9/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!

@smitelli
Copy link

@Ch3LL Hi, I came here from #62546 (comment). I checked this out locally using the same configuration from my original bug report and everything works as expected:

  • Creates the repo if not present
  • Manages the repo correctly if its URL ends in /
  • Also manages the repo correctly if the URL does not end in /

Thanks!

@Ch3LL
Copy link
Contributor Author

Ch3LL commented Aug 30, 2022

thanks for confirming :)

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.

[BUG] pkgrepo.managed fails with "'SourceEntry' object has no attribute 'repo_line'"
3 participants