code: def device_gen(chain, urls):
      
      itr = iter(urls)
      last = next(itr)
      for url in itr:
          yield Device(chain, make_hop_info_from_url(last), driver_name='jumphost', is_target=False)
          last = url
      yield Device(chain, make_hop_info_from_url(last), driver_name='generic', is_target=True)
docs: Device object generator.