Comment 6 for bug 1677730

Revision history for this message
Darin Sorrentino (dsorrent) wrote :

I ran into the same issue. The problem appears to be in:

keystone/cmd/cli.py

This block of code:

        rules = MappingEngineTester.read_rules(CONF.command.rules)
        rules = MappingEngineTester.normalize_rules(rules)
        mapping_engine.validate_mapping_structure(rules)

        assertion = MappingEngineTester.read_file(CONF.command.input)
        assertion = MappingEngineTester.normalize_assertion(assertion)
        rp = mapping_engine.RuleProcessor(rules['rules'])
        print(jsonutils.dumps(rp.process(assertion), indent=2))

I was able to get it working with this change to the 2nd to last line:

        rules = MappingEngineTester.read_rules(CONF.command.rules)
        rules = MappingEngineTester.normalize_rules(rules)
        mapping_engine.validate_mapping_structure(rules)

        assertion = MappingEngineTester.read_file(CONF.command.input)
        assertion = MappingEngineTester.normalize_assertion(assertion)
        rp = mapping_engine.RuleProcessor(assertion, rules['rules']) # Passing the assertion too
        print(jsonutils.dumps(rp.process(assertion), indent=2))

I don't know if this is the 'correct' fix, but this is what got it working for me.