Before he was sentenced, Lord Carlile, defending, read a letter to the court from Devenney which said:
"I have brought great shame to my family, loved ones and the submarine service.
"I accept the consequences of my actions and I'm truly sorry.
"Mostly I would like to apologise for the shame I brought on the Royal Navy."
Lord Carlile said when the Royal Navy and Ministry of Defence reflected on what Devenney was going through: "They might think twice about leaving a person in post until the issues have been resolved."
Lord Carlile said Devenney had been "something of a blue-eyed boy" until things began to go awry.
A submariner has been jailed for eight years for trying to disclose the secret movements of British nuclear submarines to "Russian spies".
Submariner Edward Devenney has admitted collecting top secret naval codes before meeting two men he believed were Russian spies