to manage to gain an advantage from sth that you have to do and cannot avoid
MAKE A VIRTUE OF NECESSITY
Meaning of MAKE A VIRTUE OF NECESSITY in English
Oxford Advanced Learner's English Dictionary. Оксфордский английский словарь для изучающик язык на продвинутом уровне. 2005