in rpi-image-builder/aws-iot-fleet-provisioning/main.py [0:0]
def run_provisioning(device_serial, isRotation):
provisioner = ProvisioningHandler(CONFIG_PATH, device_serial)
if isRotation:
provisioner.get_official_certs(callback, isRotation=True)
else:
#Check for availability of bootstrap cert
try:
with open("{}/{}".format(secure_cert_path, bootstrap_cert)) as f:
# Call super-method to perform aquisition/activation
# of certs, creation of thing, etc. Returns general
# purpose callback at this point.
# Instantiate provisioning handler, pass in path to config
provisioner.get_official_certs(callback)
except IOError:
print("### Bootstrap cert non-existent. Official cert may already be in place.")