Fix log formatting and lint compliance

This commit is contained in:
Ross McFarland
2017-10-18 10:38:09 -07:00
parent d11156f683
commit f39e1d28c8
2 changed files with 7 additions and 4 deletions
+2 -1
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
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):