Ahmadinejad was actually much more of a threat to the establishment than Rouhani, who was ultimately very conservative. Firebrand populists are a bigger problem than moderate clerics. He often contradicts state policy, like the fact he supports Ukraine and said "the [Ukrainian] resistance uncovered the Satanic plots of enemies of mankind."
What, I love Ahmadinejad now.
When I compared the current war with the Iran-Iraq war, I wasn’t kidding. Same dynamics, same rational responses anyone should have.