Add a fun method to the saltkey api

This commit is contained in:
Thomas S Hatch 2012-10-26 12:41:09 -06:00
parent db0696fb5e
commit d3fb9aca7f

View File

@ -148,6 +148,43 @@ class KeyCLI(object):
'key',
self.opts)
def run(self):
'''
Run the logic for saltkey
'''
if self.opts['gen_keys']:
salt.crypt.gen_keys(
self.opts['gen_keys_dir'],
self.opts['gen_keys'],
self.opts['keysize'])
return
if self.opts['list']:
self.list_status(self.opts['list'])
elif self.opts['list_all']:
self.list_all()
elif self.opts['print']:
self.print_key(self.opts['print'])
elif self.opts['print_all']:
self.print_all()
elif self.opts['accept']:
self.accept(self.opts['accept'])
elif self.opts['accept_all']:
self.accept_all()
elif self.opts['reject']:
self.reject(self.opts['reject'])
elif self.opts['reject_all']:
self.reject_all()
elif self.opts['delete']:
self.delete_key(self.opts['delete'])
elif self.opts['delete_all']:
self.delete_all()
elif self.opts['finger']:
self.finger()
elif self.opts['finger_all']:
self.finger_all()
else:
self.list_all()
class Key(object):
'''