Skip to content

Commit

Permalink
Merge pull request #166 from jssimporter/Issue165
Browse files Browse the repository at this point in the history
Issue165
  • Loading branch information
grahampugh authored Oct 7, 2019
2 parents 1da4bb5 + d7c6e76 commit b9c9aa8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ All notable changes to this project will be documented in this file. This projec
- The above efforts to improve package upload reliability may conversely cause problems on setups with multiple DPs of different types. Scenarios involving Cloud plus Local DPs are not yet tested, and there probably needs to be a more intelligent method of treating each DP as a separate package upload process than currently exists.


## [1.0.3] - 2019-10-04 - 1.0.3

This is a bugfix release to address Issue #165 - local distribution points failing to upload new packages due to failing to obtain a package ID. The package ID check has been removed from local DPs, but left for cloud DPs. Tested and now working on JCDS and SMB DPs.


## [1.0.2] - 2019-09-25 - 1.0.2

This is the official 1.0.2 release, exactly the same as the former 1.0.2b8.
Expand Down
29 changes: 12 additions & 17 deletions JSSImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


__all__ = ["JSSImporter"]
__version__ = "1.0.2"
__version__ = "1.0.3"
REQUIRED_PYTHON_JSS_VERSION = StrictVersion("2.0.1")


Expand Down Expand Up @@ -487,19 +487,13 @@ def handle_package(self):

# For local DPs we check that the package is already on the distribution point and upload it if not
if self.repo_type() == "DP" or self.repo_type() == "SMB" or self.repo_type() == "AFP" or self.repo_type() == "Local":
if not self.jss.distribution_points.exists(os.path.basename(pkg_path)):
if self.jss.distribution_points.exists(os.path.basename(pkg_path)):
self.output("Package upload not required.")
self.upload_needed = False
else:
self.copy(pkg_path)
package = self.wait_for_id(jss.Package, self.pkg_name)
try:
package.id
pkg_update = (self.env["jss_changed_objects"]["jss_package_added"])
except ValueError:
raise ProcessorError("Failed to get Package ID from {}.".format(self.repo_type()))
self.output("Package {} uploaded to distribution point.".format(self.pkg_name))
self.upload_needed = True
else:
self.output("Package upload not required.")
self.upload_needed = False

# only update the package object if an uploand ad was carried out
if (self.env["STOP_IF_NO_JSS_UPLOAD"] is True
Expand Down Expand Up @@ -528,12 +522,13 @@ def handle_package(self):
cat_name = self.category.name
else:
cat_name = ""
self.wait_for_id(jss.Package, self.pkg_name)
try:
package.id
pkg_update = (self.env["jss_changed_objects"]["jss_package_added"])
except ValueError:
raise ProcessorError("Failed to get Package ID from {}.".format(self.repo_type()))
if self.repo_type() == "JDS" or self.repo_type() == "CDP" or self.repo_type() == "AWS":
self.wait_for_id(jss.Package, self.pkg_name)
try:
package.id
pkg_update = (self.env["jss_changed_objects"]["jss_package_added"])
except ValueError:
raise ProcessorError("Failed to get Package ID from {}.".format(self.repo_type()))
self.update_object(cat_name, package, "category", pkg_update)
self.update_object(os_requirements, package, "os_requirements",
pkg_update)
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.0.2</string>
<string>1.0.3</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.0.2</string>
<string>1.0.3</string>
</dict>
</plist>

0 comments on commit b9c9aa8

Please sign in to comment.