The outcome of the last two and a half weeks of talks in Vienna between Iran and the P5+1 group of world powers would normally have been greeted by a stern tongue-lashing by Prime Minister Benjamin Netanyahu. He would have gathered the local and international media to say that extending the interim agreement reached last November in Geneva by another four months was a prize to Iran’s intransigence. He would have said that allowing Tehran access to $2.8 billion of frozen cash in return for some limits on uranium enrichment meant that the Iranians could continue nuclear-military research unimpeded, while relinquishing the leverage the west had through sanctions. He would accuse the world leaders of allowing the Iranians to pull the wool over their eyes. He can’t really do any of that right now.

With a major proportion of the Israel Defense Forces’ regular units fighting in and around the Gaza Strip, some 70,000 reservists being called up, the Palestinian death toll already over 300 and five dead Israelis so far, the one thing Netanyahu wants to keep is the support of those very leaders backing the Vienna talks. In recent months, Israeli officials warned that the worst outcome would be “turning this weak interim agreement into a permanent situation. That is exactly what Iran wants to weaken the sanctions regime, without giving anything of substance in return.” But whatever Netanyahu really thinks of the agreement to extend the deadline to November, the criticism will almost certainly be relatively muted. He’s stuck in Gaza.

It wasn’t supposed to be like this.

On the list of threats facing Israel, from the Netanyahu perspective Hamas in Gaza was at most a distant fourth after Iran, Hezbollah and the rising tide of Jihadism throughout the region. Even the prime minister’s inner circle assessed the prospect of “delegitimization” – the Palestinian Authority taking Israel to the International Criminal Court and mobilizing global opinion and diplomatic pressure – as a greater threat than anything Hamas, shut away in Gaza, could possibly muster.

It didn’t work out that way.

The full extent of the power struggle within the Israeli defense establishment to block Netanyahu and his then Defense Minister Ehud Barak’s plans to unilaterally strike Iran’s nuclear installations has yet to emerge. But led by the triumvirate of the three previous service heads – IDF Chief of Staff Gabi Ashkenazi, Mossad head Meir Dagan and Shin Bet chief Yuval Diskin – and silently backed up by President Shimon Peres, it did not come to pass. The Obama administration, along with other western governments, also paid a part in pressuring Netanyahu, against both his judgment and his instincts to give up the military option in favor of a combined approach of sanctions and diplomacy.

Netanyahu wasn’t bluffing three years ago – he was prepared to go ahead with a strike on Iran. He saw it as his historic duty. And his threats certainly played a part in motivating the Americans and Europeans to launch significant sanctions. But there was a limit to the opposition he could overcome. Now Iran’s nuclear program is the subject of a long and protracted diplomatic process, with its end out of sight. And like his disgraced predecessor, Ehud Olmert, Netanyahu is also stuck with a ground offensive in Gaza.

Hamas hasn’t metamorphosed into an existential threat to Israel – we have seen in recent days how its efforts to cause maximum harm to Israel have come to relatively little. But there was no way to ignore it either.

The inescapable question is, did Netanyahu and his security advisers take their eyes off the ball? To what extent did the relentless focus on Iran prevent Israel from warding off this current conflict?

On Friday, Netanyahu spoke with Barack Obama and thanked him for the U.S.’ financial support in building new Iron Dome batteries; one assumes he’s said some kind words as well to his environmental protection minister, Amir Peretz, who, as defense minister and Labor leader eight years ago, insisted on developing the missile defense system – against the professional position of nearly all the defense chiefs.

But while Iron Dome – which prevented multiple casualties and supplied Netanyahu with crucial breathing space before making the fateful decision on launching the ground operation – was being developed, other systems – especially an underground warning network against tunnels – languished. And now it’s the Hamas tunnels that have forced the IDF into Gaza.

Military readiness is only part of the equation. Hamas in recent years has been increasingly weakened, failing to deliver many of the most basic services to the 1.7 million people of Gaza. There have been initiatives during this period in Israel’s National Security, and other official forums, to create a new reality in and around Gaza, that would alleviate the local suffering, reduce the desperation there and perhaps also the motivation to continue launching rockets against Israel.

Officials who tried to push these ideas up to the decision makers realized that it just wasn’t on the national agenda. Iran and other matters took up all the attention in the periods between the brief flare-ups. Gaza has no votes and little media attention when the rockets and air strikes are just a steady drip of tit-for-tat. And while the diplomatic process with the Palestinian Authority, when it actually exists, is focused on issues such as the West Bank borders and Jerusalem, Gaza under Hamas remains little more than an afterthought. This is not just Netanyahu’s failure. It is also a result of Egypt’s hostility toward the Palestinians and, under President Abdel-Fattah al-Sissi, a hatred of Hamas, and of international indifference.

But, overall, it’s the lack of initiative by Netanyahu for five years to address Gaza as a major issue that has made this his war.