First, a question for the list: do people want this to become a standard part of MunkiWebAdmin?
Good stuff, Josh!First, a question for the list: do people want this to become a standard part of MunkiWebAdmin?Next, I think there were a few leftovers in your copy/paste from testing that caused some errors in my test environment. Here's the same script with the modifications that made it functional for me:from munkilib import FoundationPlistimport os
invPath = r"/Library/Managed Installs/ApplicationInventory.plist"plugins = r"/Library/Internet Plug-Ins/"directoryListing = os.listdir(plugins)appinv = FoundationPlist.readPlist(invPath)
print "Adding %i plugins" % len(directoryListing)for x in directoryListing:try:path = os.path.join(plugins, x, 'Contents/Info.plist')
info = FoundationPlist.readPlist(path)plugin = {}plugin['CFBundlenName'] = info.get('CFBundleName','N/A')plugin['version'] = info.get('CFBundleVersion','N/A')plugin['path'] = pathplugin['name'] = info.get('CFBundleName', os.path.splitext(os.path.basename(x))[0])appinv.append(plugin.copy())except Exception, message:pass
FoundationPlist.writePlist(appinv, invPath)On Tue, Mar 26, 2013 at 9:18 AM, Josh Potter <pott...@gmail.com> wrote:
Updated to loop over the /Library/Internet Plug-ins/ directory and grab what it can. There are some files/bundles that FoundationPlist.readPlist can't handle, hence the try/exception.
#!/usr/bin/python
import FoundationPlist
import os
#The plist of App Inventory that we start by reaading and then adding the Java info to.#Path where the browser plug-ins are located
invPath = r"/Library/Managed Installs/ApplicationInventory.plist"
plugins = r"/Library/Internet Plug-Ins/"
#Create a list of the plugins
directoryListing = os.listdir(plugins)#Iterate through each plugin and grab the info
#Read in the App Inventory plist
appinv = FoundationPlist.readPlist(invPath)
for x in directoryListing:
#Some plugins will not have the necessary files for the FoundationPlist.readPlist call. We skip over
#those plugins with the try/exception.
try:
path = os.path.join(plugins,x,'Contents/Info.plist')
#Get the info from the plugin
info = FoundationPlist.readPlist(path)
#Grab what we want and create a new dict
plugin = {}
plugin['CFBundlenName'] = info.get('CFBundleName','N/A')
plugin['version'] = info.get('CFBundleVersion','N/A')
plugin['path'] = path
plugin['name'] = os.path.splitext(os.path.basename(pathname))[0]
#Add the new dict to the App Inventory dict
appinv.append(plugin.copy())
except Exception:
pass
#Overwrite the new ApplicationInventory.plist
FoundationPlist.writePlist(appinv, test_invPath)--
You received this message because you are subscribed to the Google Groups "MunkiWebAdmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-web-adm...@googlegroups.com.
Visit this group at http://groups.google.com/group/munki-web-admin?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--Joe Wollard--
You received this message because you are subscribed to the Google Groups "MunkiWebAdmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-web-adm...@googlegroups.com.
Visit this group at http://groups.google.com/group/munki-web-admin?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
If I install to the Internet plugins folder, I use an install key so Munki knows where to look if an update is out.
I agree that maybe it should be part of the inventory list, but I don't see where it would help with regards to "other applications".
If I install to the Internet plugins folder, I use an install key so Munki knows where to look if an update is out.
--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.