Editor's note: Gloria Borger is a senior political analyst for CNN, appearing regularly on CNN's "The Situation Room," "AC360°" and "State of the Union," as well as participating in special event coverage.
Washington (CNN) -- Aside from his extraordinarily bad judgment, Gen. Stanley McChrystal also had something else working against him: bad timing. Really bad timing.
President Obama, you may recall, has lately had some troubles with public perception of the way he has been handling the oil spill in the Gulf of Mexico. His leadership has been questioned. In fact, Americans have downgraded his ability to handle a crisis by 11 points in the past year, according to CNN polls. They don't think he's a very tough guy.
That is, unless they caught his announcement of General Stanley McChrystal's "resignation." It wasn't a towel-snapping I've-had-enough-of-this-kind -of-insubordination statement. Rather, it was a reasoned, calculated explanation of why the commander-in-chief could not countenance McChrystal and his cronies bad-mouthing the president and his entire national security team.
The president was forceful, and clear: It "erodes the civilian control of the military," he said. It files in the face of the "strict code of conduct" for the military," he told us. And, by the way, debate is fine, but this president "won't tolerate division."
Or immaturity. Or anything that is not worthy of the risks the troops take each day.
And that last note about his intolerance for petty division wasn't just about McChrystal and Company's disgraceful behavior. It was a not-so-veiled warning to the rest of the national security team: figure out a way to stop griping at each other, support the counterinsurgency policy in Afghanistan, or leave. In other words, get on board or get out.
And just to make sure that the public understands that McChrystal's firing is not a policy shift, Obama decided to appoint General David Petraeus as his successor. On all levels, a very wise move: Not only was Petraeus there at the inception of the Afghan policy, he applauded it. He's also got the support of Republicans, having been the man leading the Iraq surge for President George W. Bush.
The new job, I should point out, is actually not a promotion for the man who is now the Centcom chief, overseeing Iraq, the Iran problem and issues with Pakistan. But his new role underscores his devotion to the idea of success in Afghanistan -- not to mention the fact that he also has serious relationships with and understands the players in Pakistan, which could be important in his new job.
And there is another way in which this is smart: Petraeus has been at the top of every Republican list as a presidential contender. He has, of course, said he's not interested. But this new job will keep him otherwise occupied in case some Republicans still hold out hope. Not going to happen.
There is a problem for President Obama in all of this, and that is that Afghanistan is front and center again. The counter-insurgency strategy is having more than its share of problems, including the campaign to re-take Marja and a delay in the planned push into Kandahar this summer.
So the Petraeus confirmations hearings will be less about him than about the policy itself --- and whether the president's planned drawdown of troops in July, 2011, should proceed as planned. There's supposed to be a policy review of Afghanistan in December. Instead, it's going to come next week.
General Petraeus has some wiggle room to discuss "conditions on the ground" as they affect U.S. policy. One prediction: he'll be respectfully in sync with his commander-in-chief.
The opinions expressed in this commentary are solely those of Gloria Borger.