|
1 | 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2 | 2 | # SPDX-License-Identifier: Apache-2.0.
|
3 | 3 |
|
4 |
| -import time |
5 |
| -import json |
| 4 | +import time, json |
6 | 5 | from awscrt import io, http
|
7 | 6 | from awscrt.mqtt import QoS
|
8 | 7 | from awsiot.greengrass_discovery import DiscoveryClient
|
9 | 8 | from awsiot import mqtt_connection_builder
|
10 | 9 |
|
11 |
| -# from utils.command_line_utils import CommandLineUtils |
12 |
| - |
13 | 10 | allowed_actions = ['both', 'publish', 'subscribe']
|
14 | 11 |
|
15 |
| -# cmdData is the arguments/input from the command line placed into a single struct for |
16 |
| -# use in this sample. This handles all of the command line parsing, validating, etc. |
17 |
| -# See the Utils/CommandLineUtils for more information. |
18 |
| -# cmdData = CommandLineUtils.parse_sample_input_basic_discovery() |
19 |
| - |
20 | 12 | # --------------------------------- ARGUMENT PARSING -----------------------------------------
|
21 | 13 | import argparse, uuid
|
22 | 14 |
|
23 | 15 | def parse_sample_input():
|
24 | 16 | parser = argparse.ArgumentParser(
|
25 |
| - description="MQTT5 pub/sub sample (mTLS).", |
| 17 | + description="Greengrass basic discovery", |
26 | 18 | formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
27 | 19 | )
|
28 | 20 |
|
@@ -58,8 +50,6 @@ def parse_sample_input():
|
58 | 50 |
|
59 | 51 | # --------------------------------- ARGUMENT PARSING END -----------------------------------------
|
60 | 52 |
|
61 |
| -# [--mode <mode>] |
62 |
| - |
63 | 53 | tls_options = io.TlsContextOptions.create_client_with_mtls_from_path(args.input_cert, args.input_key)
|
64 | 54 | if (args.input_ca is not None):
|
65 | 55 | tls_options.override_default_trust_store_from_path(None, args.input_ca)
|
|
0 commit comments