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

Fix Python 3 compatibility bug #94

Merged
merged 1 commit into from
Nov 18, 2021
Merged

Fix Python 3 compatibility bug #94

merged 1 commit into from
Nov 18, 2021

Conversation

jcnars
Copy link
Collaborator

@jcnars jcnars commented Nov 18, 2021

(Described also with additional snippets in (internal) https://b.corp.google.com/issues/202240337#comment16 through comment#21)

Got into a situation where for the same given asm_disk.json, data_mount.json config files input to the toolkit, targetted to be run on the very same BMX host, we had a successful vs failure case:

  • successful: when run from existing control-node / GCP VM, ansible version 2.9.25, Python version 2.7.5
  • failure: when run from a GKE pod, ansible version 2.9.25, Python version 3.8.6

The failure message was:

TASK [ora-host : (udev) Add ASM mpath disk rules on BM (udev rules file)] ******
fatal: [bmshost.orcl]: FAILED! => {"msg": "Unexpected templating type error occurred on (ACTION==\"add|change\",
 ENV{DM_UUID}==\"{{ item }}\", SYMLINK+=\"{{ path_udev }}/{{ uuid_result[item] | json_query ('[*].name') | list | 
join(', ') }}\", GROUP=\"{{ grid_group }}\", OWNER=\"{{ grid_user }}\", MODE=\"0660\"): 'NoneType' object is not 
iterable"}

PLAY RECAP *********************************************************************
bmshost.orcl         : ok=64   changed=4    unreachable=0    failed=1    skipped=24   rescued=0    ignored=0 
  • After extensive debugging, it was found that using the key was the key :)
  • This proposed fix is tested from both Python2 (where it didn't break prior to this proposed change) and Python3 (where this issue was exposed and the proposed solutions works) clients successfully.
  • I have checked that there's no other instance of with_items: <dict>.keys() in our toolkit code that can lead to this.

@jcnars jcnars changed the title Fix Python 3 compatibility bug described (internal) https://b.corp.google.com/issues/202240337#comment16 Fix Python 3 compatibility bug Nov 18, 2021
Copy link
Member

@mfielding mfielding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcnars, mfielding

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jcnars jcnars merged commit 0823d0a into master Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants