def install_os(path=None, **kwargs):
    '''
    Installs the given image on the device. After the installation is complete the device is rebooted,
    if reboot=True is given as a keyworded argument.

    Usage:

    .. code-block:: bash

        salt 'device_name' junos.install_os '/home/user/junos_image.tgz' reboot=True


    Options
      * path: Path where the image file is present.
      * kwargs: keyworded arguments to be given such as timeout, reboot etc

    '''
    conn = __proxy__['junos.conn']()
    ret = dict()
    ret['out'] = True

    if 'timeout' in kwargs:
        conn.timeout = kwargs['timeout']

    try:
        install = conn.sw.install(path, progress=True)
        ret['message'] = 'Installed the os.'
    except Exception as exception:
        ret['message'] = 'Installation failed due to : "{0}"'.format(exception)
        ret['out'] = False

    if 'reboot' in kwargs and kwargs['reboot'] is True:
        rbt = conn.sw.reboot()
        ret['message'] = 'Successfully installed and rebooted!'

    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/junos.py/install_os/original