From 23537d652f60615dd38bba0c2479f9330e519de5 Mon Sep 17 00:00:00 2001 From: Arash Ghoreyshi Date: Fri, 9 Aug 2013 14:40:15 -0500 Subject: [PATCH] Make payload_content_type in keep default to 'text/plain' for secrets and 'application/octet-stream' for orders, and stop constraining the content options. Stop displaying payload_content_type when displaying secrets. --- barbicanclient/keep.py | 8 ++++---- barbicanclient/secrets.py | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/barbicanclient/keep.py b/barbicanclient/keep.py index 56b191c8..5c9b7693 100644 --- a/barbicanclient/keep.py +++ b/barbicanclient/keep.py @@ -64,13 +64,13 @@ class Keep: 'e a payload_content_type (only used for se' 'crets)') create_parser.add_argument('--payload_content_type', '-t', - choices=["text/plain", - "text/plain; charset=utf-8", - "application/octet-stream"], + default='text/plain', help='the type/format of the provided ' 'secret data; "text/plain" is assumed to be' ' UTF-8; required when --payload is su' - 'pplied (only used for secrets)') + 'pplied (only used for secrets; orders are ' + 'assumed to be "application/octet-stream") ' + '(default: %(default)s)') create_parser.add_argument('--payload_content_encoding', '-d', choices=["base64"], help='required if --payload_content_type is' diff --git a/barbicanclient/secrets.py b/barbicanclient/secrets.py index 95443bbe..652376c4 100644 --- a/barbicanclient/secrets.py +++ b/barbicanclient/secrets.py @@ -47,13 +47,12 @@ class Secret(object): " reference: {1}\n" " name: {2}\n" " created: {3}\n" - " payload content type: {4}\n" - " status: {5}\n" - " bit length: {6}\n" - " algorithm: {7}\n" - " cypher type: {8}\n" - " expiration: {9}\n" + " status: {4}\n" + " bit length: {5}\n" + " algorithm: {6}\n" + " cypher type: {7}\n" + " expiration: {8}\n" .format(self.id, self.secret_ref, self.name, self.created, - self.payload_content_type, self.status, self.bit_length, - self.algorithm, self.cypher_type, self.expiration) + self.status, self.bit_length, self.algorithm, + self.cypher_type, self.expiration) )