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

Use empty dict for 'changes' instead of None #48685

Merged
merged 1 commit into from Jul 20, 2018

Conversation

Projects
None yet
2 participants
@bbinet
Contributor

bbinet commented Jul 20, 2018

See #47059 #46985 for previous similar changes.

This PR fixes the missing occurences of changes=None to replace None by an empty dict (this can result in state failures: "An exception occurred in this state: 'Changes' should be a dictionary."):

$ git grep "'changes': *None"
salt/states/esxvm.py:                       'changes': None,
salt/states/grafana4_datasource.py:    ret = {'name': name, 'result': None, 'comment': None, 'changes': None}
salt/states/grafana_datasource.py:    ret = {'name': name, 'result': None, 'comment': None, 'changes': None}
salt/states/grafana_datasource.py:    ret = {'result': None, 'comment': None, 'changes': None}
salt/states/vault.py:            'changes': None,
salt/states/vault.py:            'changes': None,
salt/states/vault.py:            'changes': None,

Note that I've not changed the salt/states/grafana4_datasource.py file in this PR as this is already fixed in upcoming PR #48671.

'comment': 'Virtual machine '
'{0} will be created'.format(vm_name)})
result['comment'] = 'Virtual machine {0} will be created'.format(
vm_name)})

This comment has been minimized.

@rallytime

rallytime Jul 20, 2018

Contributor

You need to remove the } here.

@@ -111,7 +111,7 @@ def _handle_existing_policy(name, new_rules, existing_rules):
if response.status_code != 204:
return {
'name': name,
'changes': None,
'changes': {}

This comment has been minimized.

@rallytime

rallytime Jul 20, 2018

Contributor

There needs to be a , at the end of this line.

@bbinet bbinet force-pushed the bbinet:none-changes branch from d3b3880 to 842eb3d Jul 20, 2018

@bbinet

This comment has been minimized.

Contributor

bbinet commented Jul 20, 2018

@rallytime These are now fixed, thank you!

@rallytime rallytime merged commit 266c6f2 into saltstack:2018.3 Jul 20, 2018

7 of 8 checks passed

jenkins/pr/py2-centos-7 running py2-centos-7...
Details
WIP ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details

@bbinet bbinet deleted the bbinet:none-changes branch Jul 20, 2018

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