Skip to content

Commit

Permalink
pycodestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsteves committed Jan 13, 2023
1 parent 06ee582 commit a95fe2d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
19 changes: 10 additions & 9 deletions bin/panxapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def main():

try:
xapi = pan.xapi.PanXapi(timeout=options['timeout'],
tag=None if not options['tag'] else options['tag'],
tag=None if not options['tag']
else options['tag'],
use_http=options['use_http'],
use_get=options['use_get'],
api_username=options['api_username'],
Expand Down Expand Up @@ -164,7 +165,7 @@ def main():
action = 'dynamic-update'
kwargs = {
'cmd': options['cmd'],
}
}
if options['ad_hoc'] is not None:
extra_qs_used = True
kwargs['extra_qs'] = options['ad_hoc']
Expand Down Expand Up @@ -279,7 +280,7 @@ def main():
kwargs = {
'cmd': options['op'],
'cmd_xml': options['cmd_xml'],
}
}
if options['ad_hoc'] is not None:
extra_qs_used = True
kwargs['extra_qs'] = options['ad_hoc']
Expand Down Expand Up @@ -327,7 +328,7 @@ def main():
'sync': options['sync'],
'interval': options['interval'],
'timeout': options['job_timeout'],
}
}
if options['ad_hoc'] is not None:
extra_qs_used = True
kwargs['extra_qs'] = options['ad_hoc']
Expand Down Expand Up @@ -432,7 +433,7 @@ def parse_opts():
'element': None,
'cmd': None,
'timeout': None,
}
}

valid_where = ['after', 'before', 'top', 'bottom']

Expand Down Expand Up @@ -483,14 +484,14 @@ def parse_opts():
options['force'] = True
elif opt == '--partial':
if arg:
l = get_parts(arg)
[options['partial'].append(s) for s in l]
x = get_parts(arg)
[options['partial'].append(s) for s in x]
elif opt == '--sync':
options['sync'] = True
elif opt == '--vsys':
if arg:
l = get_vsys(arg)
[options['vsys'].append(s) for s in l]
x = get_vsys(arg)
[options['vsys'].append(s) for s in x]
elif opt == '-A':
options['commit_all'] = True
options['cmd'] = get_element(arg)
Expand Down
6 changes: 3 additions & 3 deletions lib/pan/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'shared-object-excluded',
'no-vsys',
'vsys',
])
])

_part_xml = {
'device-and-network-excluded':
Expand All @@ -38,7 +38,7 @@
'<no-vsys></no-vsys>',
'vsys':
'<member>%s</member>',
}
}


def valid_part(part):
Expand Down Expand Up @@ -94,7 +94,7 @@ def vsys(self, vsys):
part = 'vsys'
self.partial.add(part)

if type(vsys) == type(''):
if isinstance(vsys, str):
vsys = [vsys]
for name in vsys:
self._vsys.add(name)
Expand Down
4 changes: 2 additions & 2 deletions lib/pan/xapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def __api_request(self, query):

kwargs = {
'url': request,
}
}

# see PEP 476; urlopen() has context
if self.ssl_context is None:
Expand Down Expand Up @@ -587,7 +587,7 @@ def keygen(self, extra_qs=None):
'type': 'keygen',
'user': self.api_username,
'password': self.api_password,
}
}
if self.serial is not None:
query['target'] = self.serial
if extra_qs is not None:
Expand Down

0 comments on commit a95fe2d

Please sign in to comment.