Skip to content

Commit cfc799d

Browse files
feat: ♿ Add backwards compatability to python3.7 via from __future__ import annotations
1 parent e52c049 commit cfc799d

22 files changed

Lines changed: 67 additions & 35 deletions

pyedgeconnect/orch/_aggregate_stats.py

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# aggregateStats : ECOS aggregate statistics
5+
from __future__ import annotations
56

67

78
def get_aggregate_stats_tunnels(
@@ -644,11 +645,9 @@ def get_aggregate_stats_applications(
644645
parameters
645646
:rtype: dict
646647
"""
647-
path = (
648-
"/stats/aggregate/application2?"
649-
+ "startTime={}&endTime={}".format(
650-
start_time, end_time,
651-
)
648+
path = "/stats/aggregate/application2?" + "startTime={}&endTime={}".format(
649+
start_time,
650+
end_time,
652651
)
653652

654653
if group_pk is not None:
@@ -717,11 +716,9 @@ def get_aggregate_stats_applications_ne_pk_list(
717716
parameters
718717
:rtype: dict
719718
"""
720-
path = (
721-
"/stats/aggregate/application2?"
722-
+ "startTime={}&endTime={}".format(
723-
start_time, end_time,
724-
)
719+
path = "/stats/aggregate/application2?" + "startTime={}&endTime={}".format(
720+
start_time,
721+
end_time,
725722
)
726723

727724
if application is not None:
@@ -791,7 +788,9 @@ def get_aggregate_stats_applications_single_appliance(
791788
path = (
792789
"/stats/aggregate/application2/"
793790
+ "{}?startTime={}&endTime={}".format(
794-
ne_pk, start_time, end_time,
791+
ne_pk,
792+
start_time,
793+
end_time,
795794
)
796795
)
797796

@@ -1321,7 +1320,7 @@ def get_aggregate_stats_flows_single_appliance(
13211320
traffic_class: int = None,
13221321
flow: str = None,
13231322
ip: str = None,
1324-
data_format: str = None
1323+
data_format: str = None,
13251324
) -> dict:
13261325
"""Get aggregate flow stats data for a single appliance filter by
13271326
query parameters
@@ -1745,7 +1744,8 @@ def get_aggregate_stats_dns_ne_pk_list(
17451744
:rtype: dict
17461745
"""
17471746
path = "/stats/aggregate/dns?startTime={}&endTime={}".format(
1748-
start_time, end_time,
1747+
start_time,
1748+
end_time,
17491749
)
17501750

17511751
if is_source is not None:
@@ -1826,7 +1826,9 @@ def get_aggregate_stats_dns_single_appliance(
18261826
:rtype: dict
18271827
"""
18281828
path = "/stats/aggregate/dns/{}?startTime={}&endTime={}".format(
1829-
ne_pk, start_time, end_time,
1829+
ne_pk,
1830+
start_time,
1831+
end_time,
18301832
)
18311833

18321834
if is_source is not None:
@@ -1905,7 +1907,9 @@ def get_aggregate_stats_ports_single_appliance(
19051907
:rtype: dict
19061908
"""
19071909
path = "/stats/aggregate/ports/{}?startTime={}&endTime={}".format(
1908-
ne_pk, start_time, end_time,
1910+
ne_pk,
1911+
start_time,
1912+
end_time,
19091913
)
19101914

19111915
if is_source is not None:
@@ -1986,7 +1990,8 @@ def get_aggregate_stats_ports(
19861990
:rtype: dict
19871991
"""
19881992
path = "/stats/aggregate/ports?startTime={}&endTime={}".format(
1989-
start_time, end_time,
1993+
start_time,
1994+
end_time,
19901995
)
19911996

19921997
if is_source is not None:
@@ -2069,7 +2074,8 @@ def get_aggregate_stats_ports_ne_pk_list(
20692074
:rtype: dict
20702075
"""
20712076
path = "/stats/aggregate/ports?startTime={}&endTime={}".format(
2072-
start_time, end_time,
2077+
start_time,
2078+
end_time,
20732079
)
20742080

20752081
if is_source is not None:
@@ -2136,7 +2142,8 @@ def get_aggregate_stats_top_talkers(
21362142
:rtype: dict
21372143
"""
21382144
path = "/stats/aggregate/topTalkers?startTime={}&endTime={}".format(
2139-
start_time, end_time,
2145+
start_time,
2146+
end_time,
21402147
)
21412148

21422149
if top is not None:
@@ -2194,7 +2201,8 @@ def get_aggregate_stats_top_talkers_ne_pk_list(
21942201
:rtype: dict
21952202
"""
21962203
path = "/stats/aggregate/topTalkers?startTime={}&endTime={}".format(
2197-
start_time, end_time,
2204+
start_time,
2205+
end_time,
21982206
)
21992207

22002208
if top is not None:
@@ -2244,7 +2252,9 @@ def get_aggregate_stats_top_talkers_single_appliance(
22442252
:rtype: dict
22452253
"""
22462254
path = "/stats/aggregate/topTalkers/{}?startTime={}&endTime={}".format(
2247-
ne_pk, start_time, end_time,
2255+
ne_pk,
2256+
start_time,
2257+
end_time,
22482258
)
22492259

22502260
if top is not None:
@@ -2290,7 +2300,9 @@ def get_aggregate_stats_top_talkers_split_single_appliance(
22902300
path = (
22912301
"/stats/aggregate/topTalkers/split/"
22922302
+ "{}?startTime={}&endTime={}".format(
2293-
ne_pk, start_time, end_time,
2303+
ne_pk,
2304+
start_time,
2305+
end_time,
22942306
)
22952307
)
22962308

@@ -2343,7 +2355,8 @@ def get_aggregate_stats_traffic_behavior(
23432355
:rtype: dict
23442356
"""
23452357
path = "/stats/aggregate/trafficBehavior?startTime={}&endTime={}".format(
2346-
start_time, end_time,
2358+
start_time,
2359+
end_time,
23472360
)
23482361

23492362
if group_pk is not None:
@@ -2366,7 +2379,7 @@ def get_aggregate_stats_traffic_behavior_ne_pk_list(
23662379
data_format: str = None,
23672380
top: int = None,
23682381
last_hour: bool = None,
2369-
is_aggregated: bool = None
2382+
is_aggregated: bool = None,
23702383
) -> dict:
23712384
"""Get aggregate Traffic Behavioral stats data filter by query
23722385
parameters
@@ -2413,7 +2426,8 @@ def get_aggregate_stats_traffic_behavior_ne_pk_list(
24132426
:rtype: dict
24142427
"""
24152428
path = "/stats/aggregate/trafficBehavior?startTime={}&endTime={}".format(
2416-
start_time, end_time,
2429+
start_time,
2430+
end_time,
24172431
)
24182432

24192433
if behavioral_cat is not None:
@@ -2484,7 +2498,9 @@ def get_aggregate_stats_traffic_behavior_single_appliance(
24842498
path = (
24852499
"/stats/aggregate/trafficBehavior/"
24862500
+ "{}?startTime={}&endTime={}".format(
2487-
ne_pk, start_time, end_time,
2501+
ne_pk,
2502+
start_time,
2503+
end_time,
24882504
)
24892505
)
24902506

@@ -3584,9 +3600,7 @@ def get_aggregate_stats_security_policy_single_appliance(
35843600
+ "{}?startTime={}&endTime={}&granularity={}&".format(
35853601
ne_pk, start_time, end_time, granularity
35863602
)
3587-
+ "fromZone={}&toZone={}".format(
3588-
from_zone, to_zone
3589-
)
3603+
+ "fromZone={}&toZone={}".format(from_zone, to_zone)
35903604
)
35913605

35923606
if top is not None:
@@ -3732,11 +3746,8 @@ def get_aggregate_stats_top_talkers_ne_pk_tunnels(
37323746
parameters
37333747
:rtype: dict
37343748
"""
3735-
path = (
3736-
"/stats2/aggregate/topTalkers?"
3737-
+ "startTime={}&endTime={}".format(
3738-
start_time, end_time
3739-
)
3749+
path = "/stats2/aggregate/topTalkers?" + "startTime={}&endTime={}".format(
3750+
start_time, end_time
37403751
)
37413752

37423753
if top is not None:
@@ -3900,7 +3911,8 @@ def get_aggregate_stats_ports_ne_pk_tunnels(
39003911
:rtype: dict
39013912
"""
39023913
path = "/stats/aggregate/ports?startTime={}&endTime={}".format(
3903-
start_time, end_time,
3914+
start_time,
3915+
end_time,
39043916
)
39053917

39063918
if is_source is not None:

pyedgeconnect/orch/_alarm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# alarm : Alarms
5+
from __future__ import annotations
56

67

78
def get_alarms_from_appliances(

pyedgeconnect/orch/_appliance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# appliance : Add, delete and modify appliances
5+
from __future__ import annotations
56

67

78
def get_appliances(self) -> list:

pyedgeconnect/orch/_appliance_backup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# applianceBackup : ECOS backup and restore
5+
from __future__ import annotations
56

67

78
def backup_appliance_config(

pyedgeconnect/orch/_appliance_resync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP.
33
#
44
# applianceResync : Orchestrator appliance configuration synchronization
5+
from __future__ import annotations
56

67

78
def appliance_resync(

pyedgeconnect/orch/_bonded_tunnels_configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# bondedTunnelsConfiguration : ECOS bonded tunnel configuration
5+
from __future__ import annotations
56

67

78
def get_bonded_tunnel_details(

pyedgeconnect/orch/_debug_files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# debugFiles : ECOS debug files like tcpdump, snapshots, sysdumps
5+
from __future__ import annotations
56

67

78
def get_debug_files_from_appliance(

pyedgeconnect/orch/_discovery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# discovery : Get and modify the discovery configuration
5+
from __future__ import annotations
56

67

78
def get_appliance_discovery_emails(

pyedgeconnect/orch/_exception.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
33
#
44
# exception : Exception configuration
5+
from __future__ import annotations
56

67

78
def get_tunnel_exceptions(

pyedgeconnect/orch/_ip_objects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP.
33
#
44
# ipObjects : IP address groups and service groups management
5+
from __future__ import annotations
56

67

78
def get_all_address_groups(self) -> list:

0 commit comments

Comments
 (0)