Skip to content

Commit

Permalink
Pep8 corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
algorys committed Jul 16, 2016
1 parent b0782fb commit fad11a8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions alignak_app/alignak_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ def log_to_backend(self, config):
try:
self.backend.login(username, password)
except BackendException as e:
sys.exit('--> ERROR: Can\'t connect to Backend.\n' +
str(e) +
'\n - Please check backend state, url or your credentials.')
sys.exit('--> ERROR: Can\'t connect to Backend.\n' + str(e) +
'\n - Please check backend state, url or your credentials.')

def get_host_state(self):
# Request
Expand All @@ -59,9 +58,9 @@ def get_host_state(self):
self.backend.url_endpoint_root +
'/livestate?where={"type":"host"}')
except requests.exceptions.ConnectionError as e:
print('--> ERROR: Can\'t get hosts state \n' +
str(e) +
'\n - Please check backend state, url or your credentials.')
print('--> ERROR: Can\'t get hosts state \n' + str(e) +
'\n - Please check backend state, url or your credentials.')

# Store Data
for host in all_host['_items']:
self.current_hosts[host['name']] = host['state']
Expand All @@ -70,12 +69,12 @@ def get_host_state(self):
def get_service_state(self):
# Request
try:
all_services = self.backend.get_all(self.backend.url_endpoint_root +
all_services = self.backend.get_all(
self.backend.url_endpoint_root +
'/livestate?where={"type":"service"}')
except requests.exceptions.ConnectionError as e:
print('--> ERROR: Can\'t get services state \n' +
str(e) +
'\n - Please check backend state, url or your credentials.')
print('--> ERROR: Can\'t get services state \n' + str(e) +
'\n - Please check backend state, url or your credentials.')

# Store Data
for service in all_services['_items']:
Expand Down

0 comments on commit fad11a8

Please sign in to comment.