import hashlib


def create_key(notification):
    """Create the key for status_keys from notification
    in: notification
    return: the key
    """
    
    key = notification.host 
    key += '/'
    key += notification.plugin
    if notification.plugin_instance:
        key += '-'
        key += notification.plugin_instance
    
    key += notification.type 
    if notification.type_instance:
        key += '-'
        key += notification.type_instance

    sha = hashlib.sha1()
    sha.update(key)
    return sha.hexdigest()