Browse Source

Fix log formatting and lint compliance

pull/133/head
Ross McFarland 8 years ago
parent
commit
f39e1d28c8
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
2 changed files with 7 additions and 4 deletions
  1. +2
    -1
      octodns/provider/dyn.py
  2. +5
    -3
      tests/test_octodns_provider_dyn.py

+ 2
- 1
octodns/provider/dyn.py View File

@ -291,7 +291,8 @@ class DynProvider(BaseProvider):
try:
fqdn, _type = td.label.split(':', 1)
except ValueError as e:
self.log.warn("Failed to load TraficDirector '{}': {}".format(td.label, e))
self.log.warn("Failed to load TraficDirector '%s': %s",
td.label, e.message)
continue
tds[fqdn][_type] = td
self._traffic_directors = dict(tds)


+ 5
- 3
tests/test_octodns_provider_dyn.py View File

@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function, \
from dyn.tm.errors import DynectGetError
from dyn.tm.services.dsf import DSFResponsePool
from json import loads
from mock import MagicMock, call, patch, Mock
from mock import MagicMock, call, patch
from unittest import TestCase
from octodns.record import Create, Delete, Record, Update
@ -650,8 +650,10 @@ class TestDynProviderGeo(TestCase):
set(tds.keys()))
self.assertEquals(['A'], tds['unit.tests.'].keys())
self.assertEquals(['A'], tds['geo.unit.tests.'].keys())
provider.log.warn.assert_called_with("Failed to load TraficDirector 'something else': need more than 1 value to unpack")
provider.log.warn.assert_called_with("Failed to load TraficDirector "
"'%s': %s", 'something else',
'need more than 1 value to '
'unpack')
@patch('dyn.core.SessionEngine.execute')
def test_traffic_director_monitor(self, mock):


Loading…
Cancel
Save