'Calculate the difference between given 2 phases.
Args:
phase1, phase2: The names of phase to compare.
Returns:
diff: The difference of value between phase1 and phase2.
This is in the format which can be used with the
`--diff` option of ansible-playbook.'

def diff(self, phase1='before', phase2='after'):

    diff = {phase1: {}, phase2: {}}
    for (key, value) in iteritems(self.value):
        diff[phase1][key] = value[phase1]
        diff[phase2][key] = value[phase2]
    return diff
