Skip to content

Commit 13724e8

Browse files
committed
further formatting
1 parent f75b65e commit 13724e8

9 files changed

+51
-64
lines changed

samples/basic_discovery.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
description="Greengrass Basic Discovery",
1717
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
1818
)
19-
2019
# Connection / TLS
2120
parser.add_argument("--cert", required=True, dest="input_cert",
2221
help="Path to the certificate file to use during mTLS connection establishment")
@@ -43,7 +42,6 @@
4342

4443
# args contains all the parsed commandline arguments used by the sample
4544
args = parser.parse_args()
46-
4745
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
4846

4947

samples/fleet_provisioning_basic.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
# --------------------------------- ARGUMENT PARSING -----------------------------------------
1010
import argparse
1111

12+
parser = argparse.ArgumentParser(
13+
description="AWS IoT Basic Fleet Provisioning sample application")
14+
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
15+
parser.add_argument('--cert', required=True,
16+
help="Path to the certificate file to use during mTLS connection establishment")
17+
parser.add_argument('--key', required=True,
18+
help="Path to the private key file to use during mTLS connection establishment")
19+
parser.add_argument('--template_name', required=True,
20+
help="Name of the provisioning template to use")
21+
parser.add_argument('--template_parameters', required=False,
22+
help="JSON map of substitution parameters for the provisioning template")
23+
24+
# args contains all the parsed commandline arguments used by the sample
25+
args = parser.parse_args()
1226
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
1327

1428

1529
if __name__ == '__main__':
16-
parser = argparse.ArgumentParser(
17-
description="AWS IoT Basic Fleet Provisioning sample application")
18-
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
19-
parser.add_argument('--cert', required=True,
20-
help="Path to the certificate file to use during mTLS connection establishment")
21-
parser.add_argument('--key', required=True,
22-
help="Path to the private key file to use during mTLS connection establishment")
23-
parser.add_argument('--template_name', required=True,
24-
help="Name of the provisioning template to use")
25-
parser.add_argument('--template_parameters', required=False,
26-
help="JSON map of substitution parameters for the provisioning template")
27-
28-
args = parser.parse_args()
29-
3030
initial_connection_success = Future()
3131
def on_lifecycle_connection_success(event: mqtt5.LifecycleConnectSuccessData):
3232
initial_connection_success.set_result(True)

samples/fleet_provisioning_csr.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,24 @@
99
# --------------------------------- ARGUMENT PARSING -----------------------------------------
1010
import argparse
1111

12+
parser = argparse.ArgumentParser(
13+
description="AWS IoT CSR Fleet Provisioning sample application")
14+
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
15+
parser.add_argument('--cert', required=True,
16+
help="Path to the certificate file to use during mTLS connection establishment")
17+
parser.add_argument('--key', required=True,
18+
help="Path to the private key file to use during mTLS connection establishment")
19+
parser.add_argument('--template_name', required=True,
20+
help="Name of the provisioning template to use")
21+
parser.add_argument('--csr_file', required=True,
22+
help="Path to a CSR file in PEM format")
23+
parser.add_argument('--template_parameters', required=False,
24+
help="JSON map of substitution parameters for the provisioning template")
25+
args = parser.parse_args()
1226
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
1327

1428

1529
if __name__ == '__main__':
16-
parser = argparse.ArgumentParser(
17-
description="AWS IoT CSR Fleet Provisioning sample application")
18-
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
19-
parser.add_argument('--cert', required=True,
20-
help="Path to the certificate file to use during mTLS connection establishment")
21-
parser.add_argument('--key', required=True,
22-
help="Path to the private key file to use during mTLS connection establishment")
23-
parser.add_argument('--template_name', required=True,
24-
help="Name of the provisioning template to use")
25-
parser.add_argument('--csr_file', required=True,
26-
help="Path to a CSR file in PEM format")
27-
parser.add_argument('--template_parameters', required=False,
28-
help="JSON map of substitution parameters for the provisioning template")
29-
30-
args = parser.parse_args()
31-
3230
with open(args.csr_file, "r") as csr_file:
3331
csr_data = csr_file.read()
3432

samples/jobs.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212
# --------------------------------- ARGUMENT PARSING -----------------------------------------
1313
import argparse
1414

15+
parser = argparse.ArgumentParser(
16+
description="AWS IoT Jobs sandbox application")
17+
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
18+
parser.add_argument('--cert', required=True,
19+
help="Path to the certificate file to use during mTLS connection establishment")
20+
parser.add_argument('--key', required=True,
21+
help="Path to the private key file to use during mTLS connection establishment")
22+
parser.add_argument('--thing', required=True,
23+
help="Name of the IoT thing to interact with")
24+
parser.add_argument('--region', required=True,
25+
help="AWS region to use. Must match the endpoint region.")
26+
args = parser.parse_args()
1527
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
1628

1729

@@ -113,20 +125,6 @@ def create_thing_if_needed(context: SampleContext):
113125
print(f"Thing {context.thing} successfully created with arn {context.thing_arn}")
114126

115127
if __name__ == '__main__':
116-
parser = argparse.ArgumentParser(
117-
description="AWS IoT Jobs sandbox application")
118-
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
119-
parser.add_argument('--cert', required=True,
120-
help="Path to the certificate file to use during mTLS connection establishment")
121-
parser.add_argument('--key', required=True,
122-
help="Path to the private key file to use during mTLS connection establishment")
123-
parser.add_argument('--thing', required=True,
124-
help="Name of the IoT thing to interact with")
125-
parser.add_argument('--region', required=True,
126-
help="AWS region to use. Must match the endpoint region.")
127-
128-
args = parser.parse_args()
129-
130128
initial_connection_success = Future()
131129
def on_lifecycle_connection_success(event: mqtt5.LifecycleConnectSuccessData):
132130
initial_connection_success.set_result(True)

samples/mqtt5_custom_authorizer_connect.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# --------------------------------- ARGUMENT PARSING -----------------------------------------
99
import argparse, uuid
1010

11-
1211
parser = argparse.ArgumentParser(
1312
description="MQTT5 Custom Authorizer Sample.",
1413
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
@@ -38,7 +37,6 @@
3837

3938
# args contains all the parsed commandline arguments used by the sample
4039
args = parser.parse_args()
41-
4240
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
4341

4442

samples/mqtt5_pkcs11_connect.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
# args contains all the parsed commandline arguments used by the sample
4040
args = parser.parse_args()
41-
4241
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
4342

4443

samples/mqtt5_pubsub.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
# args contains all the parsed commandline arguments used by the sample
3737
args = parser.parse_args()
38-
3938
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
4039

4140

samples/mqtt5_shared_subscription.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
# args contains all the parsed commandline arguments used by the sample
3939
args = parser.parse_args()
40-
4140
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
4241

4342

samples/shadow.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@
1010

1111
# --------------------------------- ARGUMENT PARSING -----------------------------------------
1212
import argparse
13-
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
1413

14+
parser = argparse.ArgumentParser(
15+
description="AWS IoT Shadow sandbox application")
16+
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
17+
parser.add_argument('--cert', required=True,
18+
help="Path to the certificate file to use during mTLS connection establishment")
19+
parser.add_argument('--key', required=True,
20+
help="Path to the private key file to use during mTLS connection establishment")
21+
parser.add_argument('--thing', required=True,
22+
help="Name of the IoT thing to interact with")
23+
args = parser.parse_args()
24+
# --------------------------------- ARGUMENT PARSING END -----------------------------------------
1525

1626

1727
@dataclass
@@ -76,18 +86,6 @@ def handle_input(context : SampleContext, line: str):
7686
return False
7787

7888
if __name__ == '__main__':
79-
parser = argparse.ArgumentParser(
80-
description="AWS IoT Shadow sandbox application")
81-
parser.add_argument('--endpoint', required=True, help="AWS IoT endpoint to connect to")
82-
parser.add_argument('--cert', required=True,
83-
help="Path to the certificate file to use during mTLS connection establishment")
84-
parser.add_argument('--key', required=True,
85-
help="Path to the private key file to use during mTLS connection establishment")
86-
parser.add_argument('--thing', required=True,
87-
help="Name of the IoT thing to interact with")
88-
89-
args = parser.parse_args()
90-
9189
initial_connection_success = Future()
9290
def on_lifecycle_connection_success(event: mqtt5.LifecycleConnectSuccessData):
9391
initial_connection_success.set_result(True)

0 commit comments

Comments
 (0)