aws-iot-greengrass-for-beginners/alert/main.py [25:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
root_ca_path = None
device_name = None
region = None
mqtt_connection = None

logger = logging.getLogger()
handler = logging.StreamHandler(sys.stdout)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
logging.basicConfig()


def find_cert_file(cert_prefix):
    """
    Find the certificates file from ./certs directory

    Parameters
    ----------
    cert_prefix: AmazonRootCA1.pem, cert.pem, private.key

    Returns
    ----------
    file_path: String

    """

    for _, _, names in os.walk(CERT_ROOT):
        for file in names:
            if cert_prefix in file:
                return CERT_ROOT + "/" + file

    raise Exception("%s not found." % cert_prefix)


def arg_check():
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-iot-greengrass-for-beginners/sensor/main.py [26:60]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
root_ca_path = None
device_name = None
region = None
mqtt_connection = None

logger = logging.getLogger()
handler = logging.StreamHandler(sys.stdout)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
logging.basicConfig()


def find_cert_file(cert_prefix):
    """
    Find the certificates file from ./certs directory

    Parameters
    ----------
    cert_prefix: AmazonRootCA1.pem, cert.pem, private.key

    Returns
    ----------
    file_path: String

    """

    for _, _, names in os.walk(CERT_ROOT):
        for file in names:
            if cert_prefix in file:
                return CERT_ROOT + "/" + file

    raise Exception("%s not found." % cert_prefix)


def arg_check():
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



