Skip to content

Commit 6554120

Browse files
author
Matthew Fisher
committed
ref(client): change --subject-alt-names syntax
This option flag now only has to be specified once with a comma-separated list of SANs: ``` $ deis certs:add ~/.openssl/star.fishworks.io.cert ~/.openssl/private.key.nopass --subject-alt-names foo.fishworks.io,bar.fishworks.io ```
1 parent d50dd5b commit 6554120

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

client/deis.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ def certs_add(self, args):
10431043
"""
10441044
Binds a certificate/key pair to an application.
10451045
1046-
Usage: deis certs:add <cert> <key> [--subject-alt-name=<san>...] [options]
1046+
Usage: deis certs:add <cert> <key> [options]
10471047
10481048
Arguments:
10491049
<cert>
@@ -1055,15 +1055,16 @@ def certs_add(self, args):
10551055
--common-name=<cname>
10561056
The common name of the certificate. If none is provided, the controller will
10571057
interpret the common name from the certificate.
1058-
--subject-alt-name=<san>...
1059-
The subject alternate names (SAN) of the certificate. This will create multiple
1060-
Certificate objects in the controller, one for each SAN.
1058+
--subject-alt-names=<sans>
1059+
The subject alternate names (SAN) of the certificate, separated by commas. This will
1060+
create multiple Certificate objects in the controller, one for each SAN.
10611061
"""
10621062
cert = args.get('<cert>')
10631063
key = args.get('<key>')
10641064
self._certs_add(cert, key, args.get('--common-name'))
1065-
for san in args.get('--subject-alt-name'):
1066-
self._certs_add(cert, key, san)
1065+
sans = args.get('--subject-alt-names')
1066+
if sans:
1067+
[self._certs_add(cert, key, san) for san in sans.split(',')]
10671068

10681069
def _certs_add(self, cert, key, common_name=None):
10691070
body = {'certificate': file(cert).read().strip(), 'key': file(key).read().strip()}

0 commit comments

Comments
 (0)