handle null extra heartbeats
This commit is contained in:
parent
28cb3e2b28
commit
40c8a53019
5 changed files with 215 additions and 56 deletions
|
@ -96,5 +96,5 @@ except ImportError: # pragma: nocover
|
|||
|
||||
try:
|
||||
from .packages import simplejson as json
|
||||
except (ImportError, SyntaxError):
|
||||
except (ImportError, SyntaxError): # pragma: nocover
|
||||
import json
|
||||
|
|
|
@ -21,7 +21,7 @@ from .constants import CONFIG_FILE_PARSE_ERROR
|
|||
|
||||
try:
|
||||
import configparser
|
||||
except ImportError:
|
||||
except ImportError: # pragma: nocover
|
||||
from .packages import configparser
|
||||
|
||||
|
||||
|
|
|
@ -41,6 +41,10 @@ class Heartbeat(object):
|
|||
user_agent = None
|
||||
|
||||
def __init__(self, data, args, configs, _clone=None):
|
||||
if not data:
|
||||
self.skip = u('Skipping because heartbeat data is missing.')
|
||||
return
|
||||
|
||||
self.args = args
|
||||
self.configs = configs
|
||||
|
||||
|
@ -91,7 +95,6 @@ class Heartbeat(object):
|
|||
data = self.dict()
|
||||
data.update(attrs)
|
||||
heartbeat = Heartbeat(data, self.args, self.configs, _clone=True)
|
||||
heartbeat.skip = self.skip
|
||||
return heartbeat
|
||||
|
||||
def sanitize(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue