the pellegrini thing was all set up from the beginning mate, they havent sacked him whatsoever.
City wanted pep to take over, their entire background set up with him in mind but 3 years ago he took the easy job at bayern over them. So come the next oppertunity he has to move clubs they made sure they got their man. It just took 3 years longer than they wanted.
Meanwhile at city, pellegrinis contract was up anyway at the end of the season so, in an act of good will by the club they offered him an extension of the contract so when he leaves for pep, they give him a nice little pay off as a thank you for his service. City get their man they wanted all along, pellegrini leaves richer and thanked by the club and everyone is happy.
Granted he could announce he is coming here if that was the case but i'm sure he would wait til afterwards anyway so the club can do an official unvieling.