'Detaches the image file from the loopback device.'

def _detach_img_loop(self):

    logging.debug('Detaching    image    %s    from    loop    device    %s', self.img, self.loop)
    try:
        cmd = ('losetup    -d    %s' % self.loop)
        utils.run(cmd)
    except error.CmdError as e:
        e_msg = ('Error    detaching    image    %s    from    loop    device    %s:    %s' % (self.img, self.loop, e))
        raise error.AutotestError(e_msg)
