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

Computer Group Site Assignment BugFix #66 #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Computer Group Site Assignment BugFix #66 #72

wants to merge 1 commit into from

Conversation

cybertunnel
Copy link
Contributor

This PR should fix the bug outlined in #66 where the smart group wouldn't properly update and throw a 409.

The changes made:

  • Provided empty computer payload to ensure no conflicts

Details:
The Jamf Pro API assumes you want the same computers included in the group if you don't specify the <computers><computer /></computers> section of the XML payload. This is why we get a 409 since one or more computers in the group might not be assigned to the site the group is being moved to.

Copy link
Contributor

@glenfarclas17 glenfarclas17 left a comment

Choose a reason for hiding this comment

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

Heya Tyler!
I'm finally looking at all of your pending merges.

This one is a problem, cuz you're adding a 'computer' element in the parent class of all groups, which might be a MobileDeviceGroup or a UserGroup.

The way I'd do it is:

group.add_element(self.class::MEMBER_CLASS::RSRC_LIST_KEY.to_s).text = nil

self.class::MEMBER_CLASS::RSRC_LIST_KEY.to_s should return 'computers', 'mobile_devices', or 'users' as appropriate for the Group subclass being used.

Cheers,
-Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants