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

Minimal template causing TypeError: __init__() got an unexpected keyword argument 'acct_key' #221

Open
Ne00n opened this issue Feb 10, 2021 · 6 comments

Comments

@Ne00n
Copy link

Ne00n commented Feb 10, 2021

Which version of python are you using?

Python 3.6.9

What operating system and version of operating system are you using?

Ubuntu 18.04

What version of sewer are you using?

0.8.4

What did you do? (be as detailed as you can)

Just trying to create a minimalistic dns provider without params

What did you expect to see/happen/not happen?

It detonated without style

What did you actually see/happen?

Working with style

So, you got a provider example here: https://github.com/komuw/sewer/blob/master/docs/dns-01.md
I tried to replicate that on a minimal basis without paramets and such, but it did explode.
Here is my current class: https://pastebin.com/b8YJGCxM

It seems to throw:
cert_key=AcmeKey.create("rsa2048")
TypeError: init() got an unexpected keyword argument 'acct_key'

At https://pastebin.com/a6Un2nsP
Any idea why?

@mmaney
Copy link
Collaborator

mmaney commented Feb 10, 2021

Thanks for asking! By the time of 0.8.4, the account key argument to Client() was changed to the AcmeAccount type, and the name was changed to account. I expect you found one or more bits of text that I missed updating. Sewer's been through a lot of changes in 2020, and when you run into something that doesn't match such as this, the first check should be to see if the code has moved along since the text you used was last updated.

If you can identify the example that steered you to use acct_key, I'll fix at least that out of date text. Likewise any others you come across, of course!

@Ne00n
Copy link
Author

Ne00n commented Feb 10, 2021

I end up with more errors, can you please update the documentation?
Its painful to get this stuff to work only for the basic functions.

@mmaney
Copy link
Collaborator

mmaney commented Feb 10, 2021

What texts are you finding that mislead you? That they are not all uniformly up to date is a known issue - too many were written while I was in the process of sorting out the substantial changes, and probably should just be deleted at this point. What did you change and what errors are you getting now? I can't read your mind.

I would also suggest pulling the current HEAD from the github repo, as there have been some fixes and cleanups since 0.8.4 was released. Also, and work I've done on the docs since 0.8.4 was released will be correct for those changes, maybe not for what's on 0.8.4. As will any future corrections or additions...

@Ne00n
Copy link
Author

Ne00n commented Feb 11, 2021

Your examples just don't work, hence I asked you to update them.
After fixing the acmeClient I ended up with:

Traceback (most recent call last):
File "cert.py", line 29, in
cert_key=AcmeKey.create("rsa2048")
TypeError: init() got an unexpected keyword argument 'domain_name'

According to the class, its a needed parameter.
The Simple thing I want is simple working example.

@Ne00n
Copy link
Author

Ne00n commented Feb 11, 2021

Even your example copy & pasted from https://github.com/komuw/sewer/blob/master/docs/sewer-as-a-library.md with Cloudflare throws me the same TypeError: init() got an unexpected keyword argument 'domain_name'

@mmaney
Copy link
Collaborator

mmaney commented Feb 12, 2021

I'm sorry, it's still difficult to get started writing a new Provider class. That was what finally pushed me to get involved with maintaining the code - that and the belated protocol change that was rolled out in lettsencrypt's staging testbed a bit more than a year ago. I have gotten rid of some semi-hidden hoops, but exercising a new driver is still not as simple as I'd wish it to be.

Unless you want to deal with all the internals, I would suggest that you consider adding a new case to the get_provider() monstrosity in cli.py, and adding a stanza in catalog.json. For both the existing pieces for cloudns will be the most simply adapted to get started, as that driver has no parameters that we have to deal with. (which is not a plus - it still takes some authorization credentials, but sucks them out of the environment in a lower-level library, so they aren't visible to sewer's CLI program.) Then you can use cli to handle all the interfaces to the Client class.

As the comment on get_provider() says, the goal was to eliminate all that boilerplate, but the bolierplate turns out to hide a number of odd special cases, and that conversion has yet to be completed. :-(

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

No branches or pull requests

2 participants