diff options
| author | Jon Bernard <jbernard@tuxion.com> | 2014-06-13 14:32:35 -0400 |
|---|---|---|
| committer | Jon Bernard <jbernard@tuxion.com> | 2014-06-13 14:32:35 -0400 |
| commit | 31504153c442567bd2c861e986f6417b0b798cd1 (patch) | |
| tree | 318bbf165170058b98fa87464141ce6dd0b1d6a2 | |
| parent | d8f7745bd96dd6b23e77d531e68242344fb43bfb (diff) | |
| download | porterbox-31504153c442567bd2c861e986f6417b0b798cd1.zip | |
Print the tally of machines found at the end
| -rwxr-xr-x | porterbox | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -4,6 +4,7 @@ import bs4 import requests +machine_count = 0 machines_url = 'https://db.debian.org/machines.cgi' response = requests.get(machines_url) @@ -24,8 +25,11 @@ for machine_entry in machine_entries: architecture = machine_data[1].text.strip() if access == "": access = "[unknown]" + machine_count += 1 print('%-18s %-24s %s' % (architecture, hostname, access)) except IndexError: # malformed entry, skip it pass + +print("\nFound %d machines" % (machine_count)) |