diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a2539..75ad2cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +### 0.3.5 (December 9, 2014) Hypercard + +CHANGES: + +- Updates to python-jss 0.5.3 +- Adds ```JSS_SUPPRESS_WARNINGS``` input variable to disable urllib3 warnings (probably because you are disabling JSS_VERIFY_SSL or using a wacky certificate). Use at your own risk! (#18) +- I will now refer to this project as JSSImporter instead of jss-autopkg-addon. + +FIXES: + +- Non-flat packages would not upload to a JDS. There is also the possibility of them not working on SMB fileshares as reported by @mitchelsblake. Now, non-flat packages are zipped prior to upload for all DP types. (sheagcraig/python-jss#20) +- See [my blog](http://labs.da.org/wordpress/sheagcraig/2014/12/09/zipping-non-flat-packages-for-casper/) for further info on this. + ### 0.3.4 (December 5, 2014) Walrus Odor CHANGES: diff --git a/JSSImporter.py b/JSSImporter.py index b6bbcc7..944733b 100755 --- a/JSSImporter.py +++ b/JSSImporter.py @@ -31,8 +31,8 @@ __all__ = ["JSSImporter"] -__version__ = '0.3.4' -REQUIRED_PYTHON_JSS_VERSION = StrictVersion('0.5.2') +__version__ = '0.3.5' +REQUIRED_PYTHON_JSS_VERSION = StrictVersion('0.5.3') class JSSImporter(Processor): @@ -92,6 +92,13 @@ class JSSImporter(Processor): "with the JSS will be skipped. Defaults to 'True'.", "default": True, }, + "JSS_SUPPRESS_WARNINGS": { + "required": False, + "description": "If you get a lot of urllib3 warnings, and you " + "want to suppress them, set to True. Remember, these warnings are " + "there for a reason.", + "default": False, + }, "category": { "required": False, "description": "Category to create/associate imported app " @@ -276,6 +283,14 @@ def handle_package(self): """ os_requirements = self.env.get("os_requirements") + # See if the package is non-flat (requires zipping prior to upload). + if os.path.isdir(self.env['pkg_path']): + shutil.make_archive(self.env['pkg_path'], 'zip', + os.path.dirname(self.env['pkg_path']), + self.pkg_name) + self.env['pkg_path'] += '.zip' + self.pkg_name += '.zip' + try: package = self.j.Package(self.pkg_name) self.output("Pkg-object already exists according to JSS, " @@ -571,10 +586,12 @@ def main(self): repoUrl = self.env["JSS_URL"] authUser = self.env["API_USERNAME"] authPass = self.env["API_PASSWORD"] - sslVerify = self.env.get("JSS_VERIFY_SSL") - repos = self.env.get("JSS_REPOS") + sslVerify = self.env["JSS_VERIFY_SSL"] + suppress_warnings = self.env["JSS_SUPPRESS_WARNINGS"] + repos = self.env["JSS_REPOS"] self.j = jss.JSS(url=repoUrl, user=authUser, password=authPass, - ssl_verify=sslVerify, repo_prefs=repos) + ssl_verify=sslVerify, repo_prefs=repos, + suppress_warnings=suppress_warnings) self.pkg_name = os.path.basename(self.env["pkg_path"]) self.prod_name = self.env["prod_name"] self.version = self.env["version"] diff --git a/README.md b/README.md index 5dfae1f..63bdc50 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -jss-autopkg-addon +JSSImporter ================= This processor adds the ability for AutoPkg to create groups, upload packages and scripts, add extension attributes, and create policies for the Casper JSS, allowing you to fully-automate your software testing workflow. @@ -370,9 +370,11 @@ Installing and/or upgrading the following packages may solve the problem: Hopefully this is temporary, although requests' changelog does claim to have "Fix(ed) previously broken SNI support." at version 2.1.0 (Current included version is 2.5.0). +If you have lots of warnings from urllib3, there's also a ```JSS_SUPPRESS_WARNINGS``` input variable which, when set to ```True``` will prevent those warnings from appearing repeatedly. Use at your own risk! + Comments/Questions/Ideas ================= Please send me feature requests or issues through the Github page. -I'm working on a series of blog posts covering software testing best practices with Casper, and how to configure jss-autopkg-addon, and write recipes for it, on my blog: (http://www.sheacraig.com/) +I'm working on a series of blog posts covering software testing best practices with Casper, and how to configure JSSImporter, and write recipes for it, on my [blog](http://labs.da.org/wordpress/sheagcraig/) diff --git a/version.plist b/version.plist index 89915e0..bdbe285 100644 --- a/version.plist +++ b/version.plist @@ -3,6 +3,6 @@ Version - 0.3.4 + 0.3.5