'Get the version of the kernel to be installed.
Returns:
The version string, as would be returned
by \'make kernelrelease\'.
Raises:
AutoservError: no package has yet been obtained. Call
RPMKernel.get() with a .rpm package.'

def get_version(self):

    if (self.source_material is None):
        raise error.AutoservError('A    kernel    must    first    be                                                    specified    via    get()')
    retval = utils.run(("rpm    -qpi    %s    |    grep    Version    |    awk    '{print($3);}'" % utils.sh_escape(self.source_material)))
    return retval.stdout.strip()
