Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianczech committed Feb 6, 2024
1 parent 9450bf2 commit 2a61842
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 223 deletions.
144 changes: 26 additions & 118 deletions panos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,7 @@ def _setup(self):
)
)
params.append(
VersionedParamPath(
"disabled",
vartype="yesno",
path="disabled",
),
VersionedParamPath("disabled", vartype="yesno", path="disabled",),
)

self._params = tuple(params)
Expand Down Expand Up @@ -1471,10 +1467,7 @@ def _setup(self):
"facility",
default="LOG_USER",
path="facility",
values=[
"LOG_USER",
]
+ ["LOG_LOCAL{0}".format(x) for x in range(8)],
values=["LOG_USER",] + ["LOG_LOCAL{0}".format(x) for x in range(8)],
)
)

Expand Down Expand Up @@ -2282,28 +2275,12 @@ def _setup(self):
)
params.append(
VersionedParamPath(
"username_field_value",
path="username-field/{username_field}",
)
)
params.append(
VersionedParamPath(
"domain",
path="domain",
)
)
params.append(
VersionedParamPath(
"use_crl",
path="use-crl",
)
)
params.append(
VersionedParamPath(
"use_ocsp",
path="use-ocsp",
"username_field_value", path="username-field/{username_field}",
)
)
params.append(VersionedParamPath("domain", path="domain",))
params.append(VersionedParamPath("use_crl", path="use-crl",))
params.append(VersionedParamPath("use_ocsp", path="use-ocsp",))
params.append(
VersionedParamPath(
"crl_receive_timeout",
Expand All @@ -2330,50 +2307,27 @@ def _setup(self):
)
params.append(
VersionedParamPath(
"block_unknown_certificate",
vartype="yesno",
path="block-unknown-cert",
"block_unknown_certificate", vartype="yesno", path="block-unknown-cert",
)
)
params.append(
VersionedParamPath(
"block_certificate_timeout",
vartype="yesno",
path="block-timeout-cert",
"block_certificate_timeout", vartype="yesno", path="block-timeout-cert",
)
)
params.append(
VersionedParamPath(
"block_unauthenticated_certificate",
exclude=True,
)
VersionedParamPath("block_unauthenticated_certificate", exclude=True,)
)
params[-1].add_profile(
"7.1.0",
vartype="yesno",
path="block-unauthenticated-cert",
)
params.append(
VersionedParamPath(
"block_expired_certificate",
exclude=True,
)
"7.1.0", vartype="yesno", path="block-unauthenticated-cert",
)
params.append(VersionedParamPath("block_expired_certificate", exclude=True,))
params[-1].add_profile(
"8.1.0",
vartype="yesno",
path="block-expired-cert",
)
params.append(
VersionedParamPath(
"ocsp_exclude_nonce",
exclude=True,
)
"8.1.0", vartype="yesno", path="block-expired-cert",
)
params.append(VersionedParamPath("ocsp_exclude_nonce", exclude=True,))
params[-1].add_profile(
"9.0.0",
path="ocsp-exclude-nonce",
vartype="yesno",
"9.0.0", path="ocsp-exclude-nonce", vartype="yesno",
)

self._params = tuple(params)
Expand All @@ -2400,27 +2354,13 @@ def _setup(self):
# params
params = []

params.append(VersionedParamPath("default_ocsp_url", path="default-ocsp-url",))
params.append(
VersionedParamPath(
"default_ocsp_url",
path="default-ocsp-url",
)
)
params.append(
VersionedParamPath(
"ocsp_verify_certificate",
path="ocsp-verify-cert",
)
)
params.append(
VersionedParamPath(
"template_name",
exclude=True,
)
VersionedParamPath("ocsp_verify_certificate", path="ocsp-verify-cert",)
)
params.append(VersionedParamPath("template_name", exclude=True,))
params[-1].add_profile(
"9.0.0",
path="template-name",
"9.0.0", path="template-name",
)

self._params = tuple(params)
Expand Down Expand Up @@ -2455,8 +2395,7 @@ def _setup(self):

params.append(
VersionedParamPath(
"forward_trust_certificate_rsa",
path="forward-trust-certificate/rsa",
"forward_trust_certificate_rsa", path="forward-trust-certificate/rsa",
)
)
params.append(
Expand All @@ -2479,17 +2418,13 @@ def _setup(self):
)
params.append(
VersionedParamPath(
"root_ca_excludes",
vartype="member",
path="root-ca-exclude-list",
"root_ca_excludes", vartype="member", path="root-ca-exclude-list",
)
)
# Only option present on Panorama.
params.append(
VersionedParamPath(
"trusted_root_cas",
vartype="member",
path="trusted-root-CA",
"trusted_root_cas", vartype="member", path="trusted-root-CA",
)
)
params.append(
Expand Down Expand Up @@ -2524,19 +2459,8 @@ def _setup(self):
# params
params = []

params.append(
VersionedParamPath(
"description",
path="description",
)
)
params.append(
VersionedParamPath(
"exclude",
vartype="yesno",
path="exclude",
)
)
params.append(VersionedParamPath("description", path="description",))
params.append(VersionedParamPath("exclude", vartype="yesno", path="exclude",))

self._params = tuple(params)

Expand Down Expand Up @@ -2566,19 +2490,9 @@ def _setup(self):
params = []

params.append(
VersionedParamPath(
"password_hash",
vartype="encrypted",
path="phash",
)
)
params.append(
VersionedParamPath(
"disabled",
vartype="yesno",
path="disabled",
)
VersionedParamPath("password_hash", vartype="encrypted", path="phash",)
)
params.append(VersionedParamPath("disabled", vartype="yesno", path="disabled",))

self._params = tuple(params)

Expand Down Expand Up @@ -2619,12 +2533,6 @@ def _setup(self):
# params
params = []

params.append(
VersionedParamPath(
"users",
vartype="member",
path="user",
)
)
params.append(VersionedParamPath("users", vartype="member", path="user",))

self._params = tuple(params)
74 changes: 13 additions & 61 deletions panos/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,48 +153,22 @@ def _setup(self):
)
)
params.append(
VersionedParamPath(
"enable_packet_buffer_protection",
exclude=True,
)
VersionedParamPath("enable_packet_buffer_protection", exclude=True,)
)
params[-1].add_profile(
"8.0.0",
path="network/enable-packet-buffer-protection",
vartype="yesno",
)
params.append(
VersionedParamPath(
"enable_device_identification",
exclude=True,
)
"8.0.0", path="network/enable-packet-buffer-protection", vartype="yesno",
)
params.append(VersionedParamPath("enable_device_identification", exclude=True,))
params[-1].add_profile(
"10.0.0",
path="enable-device-identification",
vartype="yesno",
)
params.append(
VersionedParamPath(
"device_include_acl",
exclude=True,
)
"10.0.0", path="enable-device-identification", vartype="yesno",
)
params.append(VersionedParamPath("device_include_acl", exclude=True,))
params[-1].add_profile(
"10.0.0",
path="device-acl/include-list",
vartype="member",
)
params.append(
VersionedParamPath(
"device_exclude_acl",
exclude=True,
)
"10.0.0", path="device-acl/include-list", vartype="member",
)
params.append(VersionedParamPath("device_exclude_acl", exclude=True,))
params[-1].add_profile(
"10.0.0",
path="device-acl/exclude-acl",
vartype="member",
"10.0.0", path="device-acl/exclude-acl", vartype="member",
)

self._params = tuple(params)
Expand Down Expand Up @@ -1403,12 +1377,7 @@ def _setup(self):
"mode",
path="{mode}",
default="layer3",
values=[
"layer3",
"layer2",
"virtual-wire",
"ha",
],
values=["layer3", "layer2", "virtual-wire", "ha",],
)
)
params.append(
Expand Down Expand Up @@ -2210,11 +2179,7 @@ def _setup(self):
VersionedParamPath("enable", path="enable", default=True, vartype="yesno")
)
params.append(
VersionedParamPath(
"reject_default_route",
default=True,
vartype="yesno",
)
VersionedParamPath("reject_default_route", default=True, vartype="yesno",)
)
params.append(
VersionedParamPath(
Expand Down Expand Up @@ -4246,11 +4211,7 @@ def _setup(self):
)
params[-1].add_profile(
"8.1.0",
values=(
"ip",
"dynamic",
"fqdn",
),
values=("ip", "dynamic", "fqdn",),
path="peer-address/{peer_ip_type}",
)
params.append(
Expand Down Expand Up @@ -4656,14 +4617,7 @@ def _setup(self):
params.append(
VersionedParamPath(
"mk_esp_encryption",
values=(
"des",
"3des",
"aes128",
"aes192",
"aes256",
"null",
),
values=("des", "3des", "aes128", "aes192", "aes256", "null",),
path="{type}/{mk_protocol}/encryption/algorithm",
)
)
Expand Down Expand Up @@ -5503,9 +5457,7 @@ def _setup(self):

params = []

params.append(
VersionedParamPath("interface", path="interface"),
)
params.append(VersionedParamPath("interface", path="interface"),)

self._params = tuple(params)

Expand Down
Loading

0 comments on commit 2a61842

Please sign in to comment.