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

Fix stacktrace when registry entries are missing #48362

Merged
merged 4 commits into from Jun 30, 2018

Conversation

Projects
None yet
3 participants
@twangboy
Contributor

twangboy commented Jun 28, 2018

What does this PR do?

Fixes an issue where there is a stacktrace if there are missing registry entries. If a machine has never been set up to use proxy the registry entries are not there.

What issues does this PR fix or reference?

#48276

Tests written?

No

Commits signed with GPG?

Yes

@@ -312,7 +312,9 @@ def get_proxy_bypass(network_service="Ethernet"):
reg_val = __salt__['reg.read_value']('HKEY_CURRENT_USER',
r'SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings',
'ProxyOverride')
bypass_servers = reg_val['vdata'].replace("<local>", "").split(";")
bypass_servers = []
if reg_val['vdata']:

This comment has been minimized.

@rares-pop

rares-pop Jun 28, 2018

Contributor

what about:
vdata = reg_val.get('vdata')
if vdata is not None:
bypass_...
to avoid the second lookup.

Use explicit parameter names
Optimize lookups
80 character lines
@rares-pop

This comment has been minimized.

Contributor

rares-pop commented Jun 29, 2018

Looks good to me!

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jun 29, 2018

@twangboy There is a small lint error and some tests are failing now due to this change. Can you take a look?

https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-ubuntu16-py3/11094/

twangboy added some commits Jun 29, 2018

@rallytime rallytime merged commit 7e25f26 into saltstack:2017.7 Jun 30, 2018

8 of 16 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
default Pull Requests » Salt PR - Main Build - PY2/PY3 #9862
Details
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #6135 — FAILURE
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #20188 — FAILURE
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has failed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has failed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has failed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has failed
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #26339 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #18385 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #24063 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #11105 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #23020 — SUCCESS
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details

@twangboy twangboy deleted the twangboy:fix_48276 branch Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment