The president, whose war with Iran has spiked fuel prices, said that the attacks are causing a shortage.