From fa88975a27fa330aede8d12a6c672a969c45545e Mon Sep 17 00:00:00 2001 From: Max Meinhold Date: Sun, 20 Sep 2020 14:18:40 -0400 Subject: [PATCH] Add "Owned by " as starrs comment It'd be nice to have more information about who's responsible for an address in starrs without having to switch to proxstar and look it up. This adds that in the "comment" column when creating a system, so that future systems will include this data. --- proxstar/starrs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proxstar/starrs.py b/proxstar/starrs.py index 74b8a75..a25fdde 100644 --- a/proxstar/starrs.py +++ b/proxstar/starrs.py @@ -90,6 +90,10 @@ def register_starrs(starrs, name, owner, mac, addr): (name, owner, 'members', mac, addr, 'csh.rit.edu', 'dhcp', True)) results = c.fetchall() c.execute('COMMIT') + c.execute('BEGIN') + c.callproc('api.initialize', ('root', )) + c.callproc('api.modify_system', (name, 'comment', f'Owned by {owner}')) + c.execute('COMMIT') finally: c.close() return results