Police officers investigating a possible house burglary discovered 60 cannabis plants being grown in the cellar and bedroom of a Brighouse property.
Prosecutor Duncan Ritchie told Bradford Crown Court that the plants could have produced two kilos of skunk cannabis with an estimated street value of about £20,000.
Following the discovery at the house in Brooke Street in November 2011, officers recovered fingerprints from items at the property.
Two Huddersfield men were given conditional discharges for two years each after they admitted being concerned in the production of cannabis.
Jamal Simpson, 26, of Woodville Place, Bradley, and Nathan Johnson, 27, of Somerset Place, Almondbury, both pleaded guilty to the charge of a very limited basis after their fingerprints were found on items such as light bulbs and a fan.
Mr Ritchie said the house had been rented by a woman about three months before the police search and it was the prosecution case that she had been used as a front by those who set up the cannabis growing operation.
Judge David Hatton QC noted that the offence dated back 15 months and he said he had read positive features about both men in their pre-sentence reports.
“It seems to me this is an exceptional case and one which falls outside the guidelines,” he added.
“It’s clear from your basis of plea that your roles in this were very limited indeed.”