Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions towerlib/entities/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
import logging

from towerlib.towerlibexceptions import InvalidGroup, InvalidValue
from .core import Entity, EntityManager, validate_max_length, validate_json

from .core import Entity, EntityManager, validate_json, validate_max_length

__author__ = '''Costas Tyfoxylos <ctyfoxylos@schubergphilis.com>'''
__docformat__ = '''google'''
Expand Down Expand Up @@ -310,7 +311,7 @@ def ansible_facts(self):
response = self._tower.session.get(url)
if not response.ok:
self._logger.error('Error finding ansible facts for %s.', self._data.get('name'))
return response.json() if response.ok else '{}'
return response.json() if response.ok else {}

def associate_with_groups(self, groups):
"""Associate the host with the provided groups.
Expand Down
Loading