Skip to content

Instantly share code, notes, and snippets.

@GothAck
Created September 27, 2013 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GothAck/6726943 to your computer and use it in GitHub Desktop.
Save GothAck/6726943 to your computer and use it in GitHub Desktop.
Reclassify servers in Zenoss, keeping their title
for dev in dmd.Devices.Server.Linux.getSubDevices():
if 'MyNewClass' in [a for x in dev.path() for a in x]:
print 'Already moved %s: %s' % (dev.id, dev.title)
continue
title = dev.title
id = dev.id
dev.changeDeviceClass('/Server/Linux/MyNewClass')
sync()
dev = find(id)
dev.title = title
commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment