'Perform post-recording cleanup on the YAML file that can\'t be accomplished with the
VCR recording hooks.'

def _post_recording_scrub(self):

    src_path = self.cassette_path
    rg_name = getattr(self, 'resource_group', None)
    rg_original = getattr(self, 'resource_group_original', None)
    t = tempfile.NamedTemporaryFile('r+')
    with open(src_path, 'r') as f:
        for line in f:
            if (rg_original and (rg_name != rg_original)):
                line = line.replace(rg_name, rg_original)
            if ('authorization:' not in line.lower()):
                t.write(line)
    t.seek(0)
    with open(src_path, 'w') as f:
        for line in t:
            f.write(line)
    t.close()
