Revert "Check if response is not empty"
This reverts commit 512baf458b06f9fe56472ce0a93b4130dd138e78.
diff --git a/_modules/gerrit.py b/_modules/gerrit.py
index 6f20230..1c3acf5 100644
--- a/_modules/gerrit.py
+++ b/_modules/gerrit.py
@@ -85,7 +85,7 @@
try:
value = gerrit.get(path)
except Exception as e:
- if e.response and e.response.status_code == 404:
+ if e.response.status_code == 404:
logging.debug("Ignoring exception %s", e)
logging.debug("Got %s", e.response.__dict__)
value = None
@@ -240,7 +240,7 @@
gerrit.delete(membership_path)
changed = True
except Exception as e:
- if e.response and e.response.status_code == 404:
+ if e.response.status_code == 404:
# This is a kludge, it'd be better to work out in advance
# which groups the user is a member of only via membership
# in a different. That's not trivial though with the
@@ -320,7 +320,7 @@
try:
account_info = gerrit.get('/accounts/%s' % _quote(username))
except Exception as e:
- if e.response and e.response.status_code == 404:
+ if e.response.status_code == 404:
logging.info("Account %s not found, creating it.", username)
account_info = _create_account(gerrit, username)
change = True
@@ -388,7 +388,7 @@
try:
group_info = gerrit.get('/groups/%s' % _quote(name))
except Exception as e:
- if e.response and e.response.status_code == 404:
+ if e.response.status_code == 404:
logging.info("Group %s not found, creating it.", name)
group_info = _create_group(gerrit, name)
change = True