Use an ohai object to retrieve chef version with Chef class.