Created
September 27, 2013 10:55
-
-
Save GothAck/6726943 to your computer and use it in GitHub Desktop.
Reclassify servers in Zenoss, keeping their title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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