Skip to content

Commit

Permalink
Correct the usage of jss_package_added in jssimporter
Browse files Browse the repository at this point in the history
  • Loading branch information
mosen committed Jul 28, 2018
1 parent 03ec858 commit 9998819
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions JSSImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from xml.sax.saxutils import escape

sys.path.insert(0, '/Library/Application Support/JSSImporter')

import jss
# Ensure that python-jss dependency is at minimum version
try:
Expand Down Expand Up @@ -460,12 +461,12 @@ def handle_package(self):
package = self.jss.Package(self.pkg_name)
self.output("Pkg-object already exists according to JSS, "
"moving on...")
pkg_update = (self.env["jss_changed_objects"]["jss_package_updated"])
except jss.GetError:
# Package doesn't exist
package = jss.Package(self.jss, self.pkg_name)
pkg_update = (self.env["jss_changed_objects"]["jss_package_added"])

pkg_update = (self.env[
"jss_changed_objects"]["jss_package_updated"])
if self.category is not None:
cat_name = self.category.name
else:
Expand Down Expand Up @@ -496,7 +497,7 @@ def handle_package(self):
# Passes the id of the newly created package object so JDS'
# will upload to the correct package object. Ignored by
# AFP/SMB.
if self.env["jss_changed_objects"]["jss_package_updated"]:
if self.env["jss_changed_objects"]["jss_package_added"]:
self.copy(pkg_path, id_=package.id)
# For AFP/SMB shares, we still want to see if the package
# exists. If it's missing, copy it!
Expand Down

0 comments on commit 9998819

Please sign in to comment.