3

mount_shares_tool.py

 1 year ago
source link: https://gist.github.com/pudquick/aa8713d4334036bcb0060ff73dba54c4
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

mount_shares_tool.py · GitHub

Instantly share code, notes, and snippets.

Any ideas in ensuring the mount stays connected if the AFP file server drops off the network occasionally ?

Looks like there may be some underlying API changes in macOS 10.13?

Traceback (most recent call last):
  File "/usr/local/bin/mount_shares.py", line 119, in <module>
    password)
  File "/usr/local/bin/mount_shares.py", line 68, in mount_share_with_credentials
    open_options = {NetFS.kNAUIOptionKey: NetFS.kNAUIOptionNoUI}
KeyError: 'kNAUIOptionNoUI'

carlashley commented on Dec 7, 2017

edited

Seems like the NetFS.kNAUIOptionNoUI can't be looked up in 10.13 (per comment in FileRepo.py in munki: https://github.com/munki/munki/tree/master/code/client/munkilib/munkirepo).
Have to hard code the options in like so:
open_options = {'UIOption': 'NoUI'}

There's also a few other options that can't be looked up in 10.13, the FileRepo.py has those fixes if anyone else is looking for those.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK