Hook the AuthManger#modify_user method into nova-manage commands.

This commit is contained in:
Todd Willey
2010-09-28 15:54:05 -04:00
parent 3c552cd6e8
commit 616b550ece

View File

@@ -228,6 +228,19 @@ class UserCommands(object):
for user in self.manager.get_users():
print user.name
def modify(self, name, access_key, secret_key, is_admin):
"""update a users keys & admin flag
arguments: accesskey secretkey admin
leave any field blank to ignore it, admin should be 'T', 'F', or blank
"""
if not is_admin:
is_admin = None
elif is_admin.upper()[0] == 'T':
is_admin = True
else:
is_admin = False
print "is_admin: %r" % is_admin
self.manager.modify_user(name, access_key, secret_key, is_admin)
class ProjectCommands(object):
"""Class for managing projects."""