Merge pull request #44 from ComputerScienceHouse/owner-comment

Add "Owned by <user>" as starrs comment
This commit is contained in:
Max Meinhold 2020-10-16 15:29:17 -04:00 committed by GitHub
commit 61836279d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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