Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python error when using JSSImporter 0.3.7 #35

Closed
rtrouton opened this issue Mar 19, 2015 · 6 comments
Closed

Python error when using JSSImporter 0.3.7 #35

rtrouton opened this issue Mar 19, 2015 · 6 comments

Comments

@rtrouton
Copy link

I'm consistently getting an error when running .jss recipes with JSSImporter 0.3.7 and Casper 9.65. Not seeing these issues with JSSImporter 0.3.7 and Casper 9.63, so I suspect it's an issue with 9.65. To rule out cruft-related issues, I wiped and completely rebuilt the VM which I am running AutoPkg+AutoPkgr+JSSImporter in.

I am seeing the issue when running AutoPkg from the command line, which should rule out AutoPkgr as the culprit and non-.jss recipes are running OK. I'm only seeing the problem with .jss recipes. Update from a failed run is below:


metropolis:~ autopkg$ autopkg run com.github.rtrouton.jss.Cyberduck --verbose
Processing com.github.rtrouton.jss.Cyberduck...
SparkleUpdateInfoProvider
SparkleUpdateInfoProvider: Version retrieved from appcast: 17000
SparkleUpdateInfoProvider: Found URL https://update.cyberduck.io//Cyberduck-17000.tar.gz
URLDownloader
URLDownloader: Item at URL is unchanged.
URLDownloader: Using existing /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/downloads/Cyberduck-17000.tar.gz
EndOfCheckPhase
PkgRootCreator
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/Cyberduck
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/Cyberduck/Applications
Unarchiver
Unarchiver: Guessed archive format 'tar_gzip' from filename Cyberduck-17000.tar.gz
Unarchiver: Unarchived /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/downloads/Cyberduck-17000.tar.gz to /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/Cyberduck/Applications
Versioner
Versioner: Found version 4.6.5 in file /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/Cyberduck/Applications/Cyberduck.app/Contents/Info.plist
PkgCreator
PkgCreator: Package already exists at path /Users/autopkg/Library/AutoPkg/Cache/com.github.rtrouton.jss.Cyberduck/Cyberduck-4.6.5.pkg.
PkgCreator: Existing package matches version and identifier, not building.
JSSImporter
/Library/Python/2.7/site-packages/python_jss-0.5.7-py2.7.egg/jss/contrib/requests/packages/urllib3/connection.py:251: SecurityWarning: Certificate has no subjectAltName, falling back to check for a commonName for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See urllib3/urllib3#497 for details.)
SecurityWarning
JSSImporter: Category type: category-'Internet Utilities' already exists according to JSS, moving on...
JSSImporter: Category type: policy_category-'Testing' already exists according to JSS, moving on...
Traceback (most recent call last):
File "/usr/local/bin/autopkg", line 1469, in
sys.exit(main(sys.argv))
File "/usr/local/bin/autopkg", line 1463, in main
exit(subcommands[verb]'function')
File "/usr/local/bin/autopkg", line 1287, in run_recipes
autopackager.process(recipe)
File "/Library/AutoPkg/autopkglib/init.py", line 466, in process
self.env = processor.process()
File "/Library/AutoPkg/autopkglib/init.py", line 295, in process
self.main()
File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 703, in main
self.j.distribution_points.mount()
File "/Library/Python/2.7/site-packages/python_jss-0.5.7-py2.7.egg/jss/distribution_points.py", line 240, in mount
child.mount()
File "/Library/Python/2.7/site-packages/python_jss-0.5.7-py2.7.egg/jss/distribution_points.py", line 333, in mount
if not self.is_mounted():
File "/Library/Python/2.7/site-packages/python_jss-0.5.7-py2.7.egg/jss/distribution_points.py", line 384, in is_mounted
fs_type = re.search('(([\w]),.$', mount).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

@sheagcraig
Copy link
Collaborator

Hey @rtrouton . It looks like the new code that is supposed to handle the mount testing is coming up with nothing and freaking out.

If you could send me the output of mount from your terminal, that would help, although I'm seeing some issues right off of the bat looking at it. I'll test over here in the interim.

@sheagcraig
Copy link
Collaborator

Specifically, it works under the assumption that every line in the output of mount has a fs_type, which is the first option listed in the parenthesized, last part of the output.

Indeed, perhaps that's not the case on your server.

Regardless, having done a lot of swift lately, the idea of the return of re.search potentially being None means that I can't assume it will always get a match (even though it should...).

@rtrouton
Copy link
Author

I'm running it in a 10.9.5 VM, hosted by ESXi 5.5. Here's the requested mount info:

servername:~ autopkg$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
.host:/VMware Shared Folders on /Volumes/VMware Shared Folders (vmhgfs)
servername:~ autopkg$

@sheagcraig
Copy link
Collaborator

I see the problem!

Test your regex skills! Can you see where the regex: \(([\w]*),.*$ fails to match your mount output?

Hints on IRC...

@sheagcraig
Copy link
Collaborator

Fixed in python-jss 0.5.8.

Update with:
easy_install -U python-jss

or just re-run the JSSImporter package.

@rtrouton
Copy link
Author

Looks like I'm good to go after installing a fresh download of the JSSImporter installer package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants