<commit_before>from ceph_medic import metadata


#
# Error checks
#

def check_osds_exist():
    code = 'ECLS1'
    msg = 'There are no OSDs available'
    osd_count = len(metadata['osds'].keys())
    if not osd_count:
        return code, msg<commit_msg>check: Addition of osd nearfull function<commit_after>from ceph_medic import metadata


#
# Error checks
#

def check_osds_exist():
    code = 'ECLS1'
    msg = 'There are no OSDs available'
    osd_count = len(metadata['osds'].keys())
    if not osd_count:
        return code, msg

def check_nearfull():
        """
        Checks if the osd capacity is at nearfull
        """
        code = 'ECLS2'
        msg = 'Cluster is nearfull'
        try:
                osd_map = metadata['cluster']['status']['osdmap']['osdmap']
        except KeyError:
                return
        if osd_map['nearfull']:
                return code, msg
{'fraction_non_alphanumeric': 0.10614525139664804, 'fraction_numerical': 0.0033519553072625698, 'mean_word_length': 2.3811320754716983, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1655854', 'n_tokens_mistral': 294, 'n_tokens_neox': 285, 'n_words': 79}