Browse Source

implement describe_request

master
Edoardo Putti 8 years ago
parent
commit
91d192c5d3
1 changed files with 26 additions and 0 deletions
  1. +26
    -0
      ca_shell.py

+ 26
- 0
ca_shell.py View File

@ -35,6 +35,32 @@ class CAManagerShell(cmd.Cmd, object):
'Show certification authority information: DESCRIBE_CAS' 'Show certification authority information: DESCRIBE_CAS'
raise NotImplementedError raise NotImplementedError
def do_describe_request(self, l):
'Show sign request information: DESCRIBE_REQUEST'
request_id = l.split()[0]
request = self.ca_manager.request[request_id]
if request:
request_description = """
Request %s
--------------------------------------------------
Request type: %s
%s
Key %s
"""
request_info = (
request_id,
request.__class__.__name__,
request.fields,
request.key_data,
)
print(request_description % request_info)
else:
print("No request found for id: '%s'" % request_id)
def do_drop_request(self, l): def do_drop_request(self, l):
'Delete a sign request: DROP_REQUEST' 'Delete a sign request: DROP_REQUEST'
request_id = l.split()[0] request_id = l.split()[0]


Loading…
Cancel
Save