Skip to content

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG.md
	JSSImporter.py
	version.plist
  • Loading branch information
Shea Craig committed Dec 9, 2014
2 parents 893d365 + 9cadccb commit a45cf55
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
27 changes: 22 additions & 5 deletions JSSImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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 "
Expand Down Expand Up @@ -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, "
Expand Down Expand Up @@ -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"]
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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/)
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>0.3.4</string>
<string>0.3.5</string>
</dict>
</plist>

0 comments on commit a45cf55

Please sign in to comment.