Merge pull request #9804 from aashishc1988/disable_update_cert

Provide an option to disable writing developer certificate
pull/9876/head
Martin Kojtal 2019-02-27 11:13:30 +01:00 committed by GitHub
commit c123b98b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -51,6 +51,13 @@ class MbedExtendedArgs(MainArgumentParser):
"Create or transform a manifest. "
"Use {} [command] -h for help on each command."
).format(self.parser.prog)
for initIndex in range(len(self.parser._subparsers._actions)):
try:
if 'init' in (self.parser._subparsers._actions[initIndex]).choices:
initParser = self.parser._subparsers._actions[initIndex].choices['init']
except TypeError:
pass
initParser.add_argument('--no-developer-cert', help='Do not download the developer certificate')
def _addCreateArgs(self, parser, exclusions=[]):
if 'payload' not in exclusions:
@ -131,6 +138,9 @@ def wrap_init(func):
"mbed-cli-auto {}".format(api_key.name),
description="cetificate auto-generated by Mbed CLI"
)
if getattr(options, 'no_developer_cert'):
LOG.info("Skipping download of developer certificate")
else:
LOG.info("Writing developer certificate %s into c file "
"mbed_cloud_dev_credentials.c", dev_cert_info.name)
with open("mbed_cloud_dev_credentials.c", "w") as fout: