If you have a large number of locations to add it can be far more efficient to add them through the zendmd command line interface. Here is an example:
locations = "Denver,New York,London,Moab".split(',')
for name in locations:
dmd.getDmdRoot("Locations").createOrganizer(name)
commit()
Special thanks to Chet Luther for his post that started me on the right path and ZDeviceLoader?.py which gave me the syntax to add a location.
If you want to mass add Devices... --slmiller, Mon, 26 Jan 2009 10:46:08 -0600 reply
See this page: http://www.zenoss.com/community/docs/howtos/loading-a-list-of-devices-from-a-file/ #