def discover_configured_core(device_name, dip, config_file):
cfg = GroupConfigFile(config_file)
gg_core = None
# Discover Greengrass Core
discovered, discovery_info = ggc_discovery(
device_name, dip, retry_count=10
)
logging.info("[discover_cores] Device: {0} discovery success".format(
device_name)
)
# find the configured Group's core
for group in discovery_info.getAllGroups():
dump_core_info_list(group.coreConnectivityInfoList)
gg_core = group.getCoreConnectivityInfo(cfg['core']['thing_arn'])
if gg_core:
logging.info('Found the configured core and Group CA.')
break
return gg_core, discovery_info
评论列表
文章目录