jssimporter / JSSImporter

JSSImporter is deprecated. Please see the wiki for alternatives
Apache License 2.0
145 stars 38 forks source link

Ability to use the Policy.add_package(action_type="Cache") in JSSImporter? #106

Closed JayQ2 closed 7 years ago

JayQ2 commented 7 years ago

Hi Shea - Seeing if you could help me out here. Read some of the older issues and threads.

Seeing if it is possible to use the changes in python-jss you made for Policy.add_package(action_type="Cache") in JSSImporter. Tried to do some homework on it and found the following JSSImporter code https://github.com/sheagcraig/JSSImporter/compare/v0.5.0...v0.5.1

if self.package is not None:
             packages_element = self.ensure_XML_structure(
                 policy_template, 'package_configuration/packages')
-            package_element = policy_template.add_object_to_path(
-                self.package, packages_element)
-            action = ElementTree.SubElement(package_element, 'action')
-            action.text = 'Install'
+            policy_template.add_package(self.package)

Are we able to call the other actions?

Here is my over all scenario: Currently building out a full test environment encompassing AutoUpdateMagic using the tools both you and Elliot Jordan have made available.

Looking to: Incorporate the option you made available in python-jss to use Policy.add_package(action_type="Cache") on policy creation in the the AutoUpdateMagic(python-jss,JSSImporter,Autopkg,Autopkgr) workflow. Digging into JSSImporter creating entry in an override of PolicyTemplate.xml I am creating. Looks like it all gets called on the fly as it is executed.

Goal is to use your change when running overridden recipes and templates to use the Cache and Install Cached change for policy creation.

I have referenced your code above and what you and Elliot have provided to try and piece this together: https://github.com/homebysix/auto-update-magic/issues/18 https://github.com/sheagcraig/JSSImporter/issues/75 https://github.com/sheagcraig/python-jss/blob/master/CHANGELOG.md

Any help appreciated. Thanks.

sheagcraig commented 7 years ago

In! Test it out and give me feedback!