Thomas Rousseau pleaded guilty to shouting and swearing, repeatedly punching internal walls and threatening police officers with violence at the Orchard Park property.
The court heard that officers were sent to the house after receiving a report about a dispute between neighbours at 11.30am on May 1.
Rousseau was said to be “animated and agitated” when they arrived, and he warned them he would not allow himself to be arrested and that he was a boxer and was going to fight them.
Before being arrested, he told the police that they would need to get “the whole cavalry” to subdue him.
Sheriff Adrian Cottam told Rousseau, now living in Danderhall in Midlothian, it had been a “wholly inappropriate reaction to the police officers who were just doing their job”.
He backdated his prison sentence to May 3, that being when he was first remanded in custody in connection with the matter, meaning that he is eligible for immediate release.