Allow post_puppetdb to fail to post facts

This prevents failure of the module when puppetdb has a belly ache.

Change-Id: Ief2dbb740ed358d977c3656feda1f3932d5d5e08
This commit is contained in:
Spencer Krum 2016-02-23 13:22:56 -08:00
parent 0909fa99f7
commit 1f32232b7f
1 changed files with 0 additions and 5 deletions

View File

@ -113,11 +113,6 @@ def main():
with open(payload_dump, 'w') as f:
f.write(json.dumps(payload))
r = requests.post(endpoint, json=payload, **requests_kwargs)
if r.status_code != 200:
module.fail_json(
rc=r.status_code,
msg="Failed to post facts to {puppetdb}".format(
puppetdb=p['puppetdb']))
log_data = json.load(open(p['logfile'], 'r'))
r = requests.post(endpoint, json=log_data, **requests_kwargs)