Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use ne for comparison against non literal #1152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/jnpr/junos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ def execute(self, rpc_cmd, ignore_warning=False, **kvargs):
# protocol: operation-failed
# error: device asdf not found
# </rpc-reply>
if rpc_rsp_e.text is not None and rpc_rsp_e.text.strip() is not "":
if rpc_rsp_e.text is not None and rpc_rsp_e.text.strip() != "":
return rpc_rsp_e
# no children, so assume it means we are OK
return True
Expand Down Expand Up @@ -1342,7 +1342,7 @@ def open(self, *vargs, **kvargs):
"""

auto_probe = kvargs.get("auto_probe", self._auto_probe)
if auto_probe is not 0:
if auto_probe != 0:
if not self.probe(auto_probe):
raise EzErrors.ProbeError(self)

Expand Down
2 changes: 1 addition & 1 deletion lib/jnpr/junos/rpcmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get_config(
self._junos.transform = transform
# in case of model provided top level should be data
# return response
if model and filter_xml is None and options.get("format") is not "json":
if model and filter_xml is None and options.get("format") != "json":
response = response.getparent()
response.tag = "data"
return response
Expand Down
2 changes: 1 addition & 1 deletion lib/jnpr/junos/utils/start_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def run(self, command, this=_SHELL_PROMPT, timeout=0, sleep=0):
got = "".join(self.wait_for(this, timeout, sleep=sleep))
self.last_ok = False
if this is None:
self.last_ok = got is not ""
self.last_ok = got != ""
elif this != _SHELL_PROMPT:
self.last_ok = re.search(r"{}\s?$".format(this), got) is not None
elif re.search(r"{}\s?$".format(_SHELL_PROMPT), got) is not None:
Expand Down