def check_rule_compression(self, rule):
    ' compression rule check '
    if ((not ('compression' in rule)) or ('fragmentation' in rule)):
        raise ValueError('{} Invalid rule'.format(self._nameRule(rule)))
    canon_rule_set = []
    for r in rule['compression']['rule_set']:
        canon_r = {}
        for (k, v) in r.items():
            if isinstance(v, str):
                canon_r[k.upper()] = v.upper()
            else:
                canon_r[k.upper()] = v
        canon_rule_set.append(canon_r)
    rule['compression']['rule_set'] = canon_rule_set
compression rule check
def check_rule_compression(self, rule):
    '  '
    if ((not ('compression' in rule)) or ('fragmentation' in rule)):
        raise ValueError('{} Invalid rule'.format(self._nameRule(rule)))
    canon_rule_set = []
    for r in rule['compression']['rule_set']:
        canon_r = {}
        for (k, v) in r.items():
            if isinstance(v, str):
                canon_r[k.upper()] = v.upper()
            else:
                canon_r[k.upper()] = v
        canon_rule_set.append(canon_r)
    rule['compression']['rule_set'] = canon_rule_set