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 zerigo DNS #116

Merged
merged 3 commits into from Feb 7, 2012
Merged

Fix zerigo DNS #116

merged 3 commits into from Feb 7, 2012

Conversation

akremer
Copy link
Member

@akremer akremer commented Feb 6, 2012

Resolves a couple of issues:

In lib/rubber/dns/zerigo.rb:
*) Was missing an "end" for the module
*) Had a class/module conflict since it wasn't sure if it was inheriting from Rubber's fog class or the fog gem module
*) Using wrong variable for the zerigo email/key

In lib/rubber/dns/fog.rb:
*) zone.records.find would throw a Fog::DNS::Zerigo::NotFound exception if the fqdn wasn't found. Catching it into an empty array for now, although this should probably be better addressed in Fog somehow.
*) Was initializing an empty Fog::DNS client for classes that inherit this. Since the only DNS provider in Rubber currently using Fog is Zerigo, I've removed this for now. It basically meant one always would need to add a "credentials" section in rubber-dns.yml under every provider inheriting from Fog, even though each DNS provider in Fog has its own names for credentials.

Still need to update the comments in rubber-dns.yml to reflect this.

@nirvdrum
Copy link
Member

nirvdrum commented Feb 6, 2012

Thanks for these updates. FYI, Zerigo in 2.0.0.pre1 is broken for host updates until there's a new fog release. So, just be careful with that.

@akremer
Copy link
Member Author

akremer commented Feb 6, 2012

Ok, that wasn't clear by the way it was set up -- so to clarify, any DNS provider based on fog (eventually) shouldn't be a subclass and just defined via rubber-dns.yml?

This would require a pretty messy initializer in fog.rb though, since each DNS provider in fog takes different parameters for authentication. Also we'd need to differentiate between Fog and non-Fog providers in lib/rubber/dns.rb to ensure it loads the Fog class for some and not for others like Nettica. Seems a lot less elegant than the way it's currently set up unless I'm missing something obvious?

@nirvdrum
Copy link
Member

nirvdrum commented Feb 6, 2012

The idea is you'd just pass the params for the fog provider you're using. We wouldn't attempt to unify that. For existing providers that have been rebuilt atop fog, such as Zerigo, we're maintaining a configuration compatibility shim. All the Zerigo class does right now is coerce the old Zerigo config items into the args that fog needs.

Nettica is the one oddball here. Ideally, someone would add it as a provider to fog. It's actually not that hard to do, I just don't use Nettica and don't currently have the time to do it.

This does tie our hands a bit with completely new providers that aren't fog-backed, but we haven't added any of those in 2+ years. And by basing on fog, we get things like Route53 support essentially for free.

Hopefully that clarifies. If not, we should take it to the mailing list for further discussion.

@akremer
Copy link
Member Author

akremer commented Feb 6, 2012

Ok, I understand the intent now. Commit above makes Zerigo shim backwards compatible with the old config format and ensures client is only created within the Fog class. You can now use Zerigo either way and it works.

@wr0ngway
Copy link
Member

wr0ngway commented Feb 7, 2012

Looks good, thanks!

wr0ngway added a commit that referenced this pull request Feb 7, 2012
@wr0ngway wr0ngway merged commit 9fb5753 into rubber:master Feb 7, 2012
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.

None yet

3 participants