def install_os(path=None, **kwargs):
 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

def install_os ( path = None , ** kwargs ) : 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
installs the given image on the device .