I am not able to find a way to dump the YAML to a variable in ruamel.yaml. With PyYAML, I could able to achieve the same like below:
with open('oldPipeline.yml','r') as f:
data = yaml.load(f, Loader=yaml.FullLoader)
a = yaml.dump(data)
But when I try the same with ruamel.yaml, it throws the exception TypeError: Need a stream argument when not dumping from context manager