Justin Riley
f05db7d322
tests: add fixtures from opennebula test instance
2016-10-07 15:30:32 -04:00
Justin Riley
f9554f7f79
resolver: remove unused future print import
2016-10-06 00:29:49 -04:00
Justin Riley
9ca71db458
server: sanitize VM names in _get_vm_dns_entries
...
...using the same method as 15-hostname in OpenNebula/addon-context-linux
2016-10-06 00:23:40 -04:00
Justin Riley
abd1744553
utils: add tests for get_fqdn
2016-10-05 23:36:07 -04:00
Justin Riley
5475be37f2
add tests for onedns.server (now at 100% coverage)
2016-09-28 11:35:07 -04:00
Justin Riley
4c245819ce
server: implement tiebreaker for VMs with same name/IP
...
The tiebreaker is first-come first serve - ie whichever VM had the name
or IP first wins (based on VM id). The sync() method now sorts the VM
list by id in order to evaluate the tiebreaker correctly (VM list comes
that way from ONED but just in case...).
2016-09-28 11:18:14 -04:00
Justin Riley
a7051e0689
server: build new zone and replace live copy in sync
...
Instead of clearing the live zone and iterating through and adding
records from OpenNebula we build an entirely new zone, sync it with
OpenNebula, and instantaneously swap it with the currently live zone.
This minimizes the amount of time that the DNS server is missing entries
while its syncing with OpenNebula.
2016-09-28 11:16:31 -04:00
Justin Riley
3a07adba10
resolver: add zone kwarg to {add,remove}_host methods
2016-09-28 11:07:12 -04:00
Justin Riley
bc88849e31
add utils for verifying presence/absence in DNS
2016-09-28 10:48:26 -04:00
Justin Riley
8bad8b47d4
add tests for onedns base exception
2016-08-19 12:28:10 -04:00
Justin Riley
a97e9f687c
add tests for cli
2016-08-19 09:19:50 -04:00
Justin Riley
b735c84a04
resolver: add thread mutex and use new zone module
2016-08-17 16:21:05 -04:00
Justin Riley
2c0283fdb7
add zone module with in-memory zone implementation
2016-08-17 10:13:43 -04:00
Justin Riley
56f6998753
add vms fixture that gets recorded using vcrpy
...
Should help prevent creating duplicate vcrpy yaml's in
onedns/tests/fixtures for the same 'get all vms' request in multiple
tests.
2016-08-12 11:24:52 -04:00
Justin Riley
6892508b9e
resolver: add zone kwarg to add_host
...
This will allow OneDNS.sync to build a new zone and instantly swap it
with the currently active zone to minimize downtime.
2016-08-12 11:13:50 -04:00
Justin Riley
ec8c1902ab
move get_fqdn to onedns.utils module
2016-08-12 11:12:11 -04:00
Justin Riley
7f2a3ca8a8
add kwargs for server, port, and tcp to dnsquery
2016-08-12 11:03:55 -04:00
Justin Riley
6fecaed95a
add optional vms kwarg to sync for testing
2016-08-12 10:44:09 -04:00
Justin Riley
9ba49ee677
tests: move dns query code to onedns.tests.utils
2016-08-03 12:01:41 -04:00
Justin Riley
e6a1724251
fix flake8 failures
2016-08-03 11:45:57 -04:00
Justin Riley
2c32c03ab4
vcr: scrub ONE xmlrpc auth from recordings
2016-08-03 11:38:10 -04:00
Justin Riley
17acd42c7d
vcr: decompress response bodies before recording
2016-08-03 11:33:36 -04:00
Justin Riley
8d00264eb7
vcr: save fixtures with .yaml extension
2016-08-03 11:33:17 -04:00
Justin Riley
a0cadb7258
logger: remove unused os import
2016-08-03 00:38:56 -04:00
Justin Riley
679f3a0369
use vcrpy for oneclient tests
...
Will commit cassettes later once the tests have been executed on a test
VM and the test authorization token has been stripped.
2016-08-03 00:36:18 -04:00
Justin Riley
eff941dbf8
utils: add get_kwargs_from_env function
2016-08-03 00:13:16 -04:00
Justin Riley
923c8305ae
add tests for utils module
2016-08-02 23:19:04 -04:00
Justin Riley
649fb7d6a6
add tests for onedns.logger module
2016-08-02 18:35:17 -04:00
Justin Riley
8b02727e35
remove unused onedns.monitor module
2016-08-02 18:08:50 -04:00
Justin Riley
c4941aaf44
add tests for one.OneClient
2016-08-02 18:06:51 -04:00
Justin Riley
ea68558d63
logger: remove syslog handlers for now
2016-08-02 17:28:44 -04:00
Justin Riley
68b64b58ee
logger: leave default log completely unconfigured
...
...dont add NullHandler
2016-08-02 17:25:38 -04:00
Justin Riley
989e194c1a
cli: remove all commands except daemon and shell
...
...for now
2016-08-02 13:32:12 -04:00
Justin Riley
fb1608ce56
move api.py module to server.py
2016-08-02 13:31:55 -04:00
Justin Riley
c1a6d81157
add daemon method to DynamicResolver
...
Keeps main process up indefinitely as long as DynamicResolver UDP
socketserver is up
2016-08-02 13:29:30 -04:00
Justin Riley
12a2a46f14
move server.py -> resolver.py
2016-08-02 12:39:02 -04:00
Justin Riley
8dfa63da5d
remove all traces of skydns and etcd from code
2016-08-02 11:54:29 -04:00
Justin Riley
a80a85191c
add DynamicResolver class with 100% test coverage
2016-08-02 11:29:16 -04:00
Justin Riley
ee1e22708d
cli: add args=None kwarg to main()
2016-07-21 15:21:47 -04:00
Justin Riley
0063ecc526
move get_kwargs to utils as get_kwargs_from_dict
2016-07-21 15:15:51 -04:00
Justin Riley
f8126ea533
improve implementation of show_tb kwarg
...
...shows traceback while still showing ERROR or WARN
2016-07-21 13:39:59 -04:00
Justin Riley
93db7bcd17
add log instance to IPython shell environment
2016-07-21 13:37:03 -04:00
Justin Riley
2878ede2d6
raise exception if vm doesnt have any networks
2016-07-21 13:36:30 -04:00
Justin Riley
d73dc5f692
add vm/host subcommands to add/remove subcommands
...
$ onedns add vm 3
$ onedns add host myhost 192.168.99.110
$ onedns remove vm 3
$ onedns remove host myhost 192.168.99.110
2016-07-21 09:52:27 -04:00
Justin Riley
9bcddf29ad
refactor code to use new OneDNS api class
...
- OneDNS class provides VM -> DNS interface
- Updated OneMonitor to subclass OneDNS
- Moved 'register' method from skydns client to OneDNS as add_vm
- Moved 'update' method from OneMonitor to OneDNS as sync
- Added methods to OneDNS to add/remove VMs by id
2016-07-21 09:52:00 -04:00
Justin Riley
388739a2e0
add shell subcommand for IPython development
2016-07-20 10:03:37 -04:00
Justin Riley
b8b9dab77c
oneclient: add get_vm_by_id function
2016-07-19 14:05:28 -04:00
Justin Riley
38d9e539fb
add new 'add' and 'remove' subcommands
...
Allows manually adding and removing hosts from DNS. These will be
utilized by ONE hook scripts.
2016-07-19 09:15:34 -04:00
Justin Riley
8114dbed88
add daemon subcommand and add --interval option
2016-07-19 09:14:34 -04:00
Justin Riley
54537b53dd
convert domain arg to option (default: one.local)
2016-07-19 09:12:27 -04:00