Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
grahampugh committed Jan 26, 2022
1 parent 4f82f4c commit 51a30ad
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. This projec

Changes since last release.

## [1.1.6] - 2022-01-26

Removed deprecated `boot_volume_required` key from `packages` endpoint.

## [1.1.5] - 2021-05-25

No changes to JSSImporter, but the package re-incorporates upstream changes to python-jss that were temporarily put in 1.1.2 but inadvertently removed again in 1.1.4 (because those changes were meant to be temporary and so were not in the `master` branch).
Expand Down
58 changes: 32 additions & 26 deletions JSSImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


__all__ = ["JSSImporter"]
__version__ = "1.1.5"
__version__ = "1.1.6"
REQUIRED_PYTHON_JSS_VERSION = StrictVersion("2.1.1")

# Map Python 2 basestring type for Python 3.
Expand Down Expand Up @@ -79,7 +79,10 @@ class JSSImporter(Processor):
"""

input_variables = {
"prod_name": {"required": True, "description": "Name of the product.",},
"prod_name": {
"required": True,
"description": "Name of the product.",
},
"jss_inventory_name": {
"required": False,
"description": "Smart groups using the 'Application Title' "
Expand Down Expand Up @@ -193,12 +196,6 @@ class JSSImporter(Processor):
"Boolean. Defaults to 'False'",
"default": "False",
},
"package_boot_volume_required": {
"required": False,
"description": "Ensure that the package is installed on the boot drive "
"after imaging. Boolean. Defaults to 'True'",
"default": "True",
},
"groups": {
"required": False,
"description": "Array of group dictionaries. Wrap each group in a "
Expand Down Expand Up @@ -261,8 +258,14 @@ class JSSImporter(Processor):
"even exists). Please see the README for more information.",
"default": "",
},
"site_id": {"required": False, "description": "ID of the target Site",},
"site_name": {"required": False, "description": "Name of the target Site",},
"site_id": {
"required": False,
"description": "ID of the target Site",
},
"site_name": {
"required": False,
"description": "Name of the target Site",
},
"STOP_IF_NO_JSS_UPLOAD": {
"required": False,
"default": True,
Expand Down Expand Up @@ -486,7 +489,8 @@ def handle_package(self, stop_if_no_upload):
package = self.jss.Package(self.pkg_name)
self.output("Package object already exists on the Jamf Pro server.")
self.output(
"Package ID: {}".format(package.id), verbose_level=2,
"Package ID: {}".format(package.id),
verbose_level=2,
)
pkg_update = self.env["jss_changed_objects"]["jss_package_updated"]
# for cloud DPs we must assume that the package object means there is an associated package
Expand Down Expand Up @@ -568,7 +572,6 @@ def handle_package(self, stop_if_no_upload):
package_notes = self.env.get("package_notes")
package_priority = self.env.get("package_priority")
package_reboot = self.env.get("package_reboot")
package_boot_volume_required = self.env.get("package_boot_volume_required")

if self.category is not None:
cat_name = self.category.name
Expand All @@ -593,9 +596,6 @@ def handle_package(self, stop_if_no_upload):
self.update_object(package_notes, package, "notes", pkg_update)
self.update_object(package_priority, package, "priority", pkg_update)
self.update_object(package_reboot, package, "reboot_required", pkg_update)
self.update_object(
package_boot_volume_required, package, "boot_volume_required", pkg_update
)
return package

def zip_pkg_path(self, path):
Expand Down Expand Up @@ -698,7 +698,8 @@ def handle_policy(self):
added_env="jss_policy_added",
)
self.output(
"Policy object: {}".format(policy.id), verbose_level=3,
"Policy object: {}".format(policy.id),
verbose_level=3,
)
else:
self.output("Policy creation not desired, moving on...")
Expand All @@ -724,9 +725,8 @@ def handle_icon(self):
if self.env.get("self_service_icon") and self.policy is not None:
# Search through search-paths for icon file.
self.output(
"Looking for Icon file {}...".format(
self.env["self_service_icon"], verbose_level=2,
)
"Looking for Icon file {}...".format(self.env["self_service_icon"]),
verbose_level=2,
)
icon_path = self.find_file_in_search_path(self.env["self_service_icon"])
icon_filename = os.path.basename(icon_path)
Expand Down Expand Up @@ -992,8 +992,9 @@ def get_templated_object(self, obj_cls, template_path):
"""
self.output(
"Looking for {} template file {}...".format(
obj_cls.__name__, os.path.basename(template_path), verbose_level=2,
)
obj_cls.__name__, os.path.basename(template_path)
),
verbose_level=2,
)
final_template_path = self.find_file_in_search_path(template_path)

Expand Down Expand Up @@ -1068,7 +1069,8 @@ def find_file_in_search_path(self, path):

if final_path:
self.output(
"Found file: {}".format(final_path), verbose_level=2,
"Found file: {}".format(final_path),
verbose_level=2,
)
break

Expand Down Expand Up @@ -1309,7 +1311,8 @@ def main(self):
# Ensure we have the right version of python-jss
python_jss_version = StrictVersion(PYTHON_JSS_VERSION)
self.output(
"python-jss version: {}.".format(python_jss_version), verbose_level=2,
"python-jss version: {}.".format(python_jss_version),
verbose_level=2,
)
if python_jss_version < REQUIRED_PYTHON_JSS_VERSION:
self.output(
Expand All @@ -1320,7 +1323,8 @@ def main(self):
raise ProcessorError

self.output(
"JSSImporter version: {}.".format(__version__), verbose_level=2,
"JSSImporter version: {}.".format(__version__),
verbose_level=2,
)

# clear any pre-existing summary result
Expand Down Expand Up @@ -1356,7 +1360,8 @@ def main(self):
self.output("Warning: No distribution points configured!")
for dp in self.jss.distribution_points:
self.output(
"Checking if DP already mounted...", verbose_level=2,
"Checking if DP already mounted...",
verbose_level=2,
)
dp.was_mounted = hasattr(dp, "is_mounted") and dp.is_mounted()
# Don't bother mounting the DPs if there's no package.
Expand All @@ -1375,7 +1380,8 @@ def main(self):
for dp in self.jss.distribution_points:
if not dp.was_mounted:
self.output(
"Unmounting DP...", verbose_level=2,
"Unmounting DP...",
verbose_level=2,
)
self.jss.distribution_points.umount()
self.summarize()
Expand Down
2 changes: 1 addition & 1 deletion pkg/jssimporter/build-info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>suppress_bundle_relocation</key>
<true/>
<key>version</key>
<string>1.1.5</string>
<string>1.1.6</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion version.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>Version</key>
<string>1.1.5</string>
<string>1.1.6</string>
</dict>
</plist>

0 comments on commit 51a30ad

Please sign in to comment.