IoTReady / aws_iot_demo

Consider using f-strings PYL-C0209
Performance
Minor
a year agoa year old
Formatting a regular string which could be a f-string
10def get_aws_iot_certs(device_id):
11    certs_dir = os.getenv('CERTS_DIR')
12    root_ca_cert = os.path.join(certs_dir, "AmazonRootCA1.pem") # Adjust per your Root CA settings
13    device_cert = os.path.join(certs_dir, "{}-certificate.pem.crt".format(device_id))14    device_private_key = os.path.join(certs_dir, "{}-private.pem.key".format(device_id))
15    assert os.path.exists(root_ca_cert), "Root CA Certificate not found"
16    assert os.path.exists(device_cert), "Device Certificate not found"
Formatting a regular string which could be a f-string
11    certs_dir = os.getenv('CERTS_DIR')
12    root_ca_cert = os.path.join(certs_dir, "AmazonRootCA1.pem") # Adjust per your Root CA settings
13    device_cert = os.path.join(certs_dir, "{}-certificate.pem.crt".format(device_id))
14    device_private_key = os.path.join(certs_dir, "{}-private.pem.key".format(device_id))15    assert os.path.exists(root_ca_cert), "Root CA Certificate not found"
16    assert os.path.exists(device_cert), "Device Certificate not found"
17    assert os.path.exists(device_private_key), "Device Private Key not found"