mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9804 from aashishc1988/disable_update_cert
Provide an option to disable writing developer certificatepull/9876/head
commit
c123b98b3c
|
|
@ -51,6 +51,13 @@ class MbedExtendedArgs(MainArgumentParser):
|
||||||
"Create or transform a manifest. "
|
"Create or transform a manifest. "
|
||||||
"Use {} [command] -h for help on each command."
|
"Use {} [command] -h for help on each command."
|
||||||
).format(self.parser.prog)
|
).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=[]):
|
def _addCreateArgs(self, parser, exclusions=[]):
|
||||||
if 'payload' not in exclusions:
|
if 'payload' not in exclusions:
|
||||||
|
|
@ -131,6 +138,9 @@ def wrap_init(func):
|
||||||
"mbed-cli-auto {}".format(api_key.name),
|
"mbed-cli-auto {}".format(api_key.name),
|
||||||
description="cetificate auto-generated by Mbed CLI"
|
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 "
|
LOG.info("Writing developer certificate %s into c file "
|
||||||
"mbed_cloud_dev_credentials.c", dev_cert_info.name)
|
"mbed_cloud_dev_credentials.c", dev_cert_info.name)
|
||||||
with open("mbed_cloud_dev_credentials.c", "w") as fout:
|
with open("mbed_cloud_dev_credentials.c", "w") as fout:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue