#1471 list-hosts shouldn't error on empty list
Merged 4 years ago by mikem. Opened 4 years ago by tkopecek.
tkopecek/koji issue1470  into  master

file modified
+4 -1
@@ -2818,7 +2818,10 @@ 

          for host, [channels] in zip(hosts, session.multiCall()):

              host['channels'] = ','.join(sorted([c['name'] for c in channels]))

  

-     longest_host = max([len(h['name']) for h in hosts])

+     if hosts:

+         longest_host = max([len(h['name']) for h in hosts])

+     else:

+         longest_host = 8

      if not options.quiet:

          hdr = "{hostname:<{longest_host}} Enb Rdy Load/Cap  Arches           Last Update".format(longest_host=longest_host, hostname='Hostname')

          if options.show_channels:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

4 years ago

Commit 9905266 fixes this pull-request

Pull-Request has been merged by mikem

4 years ago