Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Group gid fixed as integer #48491
What does this PR do?
Fixes the _changes() function to correctly evaluate the group id.
What issues does this PR fix or reference?
gid was being passed as a string, while the lgrp['gid'] was being passed as an integer.
Added casting or string
The return was false even though the group was successfully created.
This updated code now compares an integer with an integer for the gid.
Commits signed with GPG?
gid == <type 'str'> lgrp['gid'] == <type 'int'>
if gid: try: gid = int(gid) if lgrp['gid'] != gid: change['gid'] = gid except (TypeError, ValueError): ret['result'] = False ret['comment'] = 'Invalid gid' return ret
Changed evaluation from (string != int) to (int != int)
SLES12SP3 / Salt 2016.11.4 (Carbon)
State used for testing: