Apr 30, 2010 3:40 PM
BadRequest: The property zWinPassword does not exist
-
Like (0)
Ok, so... after my recent upgrade to 2.5.2 and upgrade of the WMI Data Source ZenPack I'm getting the following error when trying to save zProperties locally on any of my devices..
Type: BadRequest Traceback (innermost last):
Value: The property zWinPassword does not exist
BadRequest: The property zWinPassword does not exist
Now, I've seen this same error in the past and used the following method in zendmd to fix it:
a=find("devicename")
a.__delattr__("zWinPassword")
commit()
I also had to do it for zWinUser in some cases. In the past the issue was isolated to only a handful of devices but now I have the issue on every one of my devices. Can anyone suggest some zendmd code to cleanly fix this globally?
Here's a discussion that I had with Matt Ray on the subject, it explains some things that I didn't explain above:
[03:40pm] <@mrayzenoss> rmatte: take a look at this: docs/DOC-3219
[03:40pm] <@mrayzenoss> instead of Server.Linux just do all devics
[03:41pm] <@mrayzenoss> you want to loop over all devices right?
[03:41pm] <rmatte> correct
[03:41pm] <rmatte> you're sure that'll fix this particular issue?
[03:41pm] <@mrayzenoss> no, but I know that'll loop over all the devices
[03:42pm] <rmatte> well, I know how to loop over all devices, but when I try that with the code that I posted in the forum it errors out
[03:42pm] <rmatte> so I'm going to need to use some sort of check, I just don't know what
[03:42pm] <@mrayzenoss> oh, to see if the attribute is there or not?
[03:42pm] <rmatte> correct
[03:42pm] <rmatte> also, is removing the attribute going to hurt anything?
[03:42pm] <rmatte> I know it fixes the issue, but will it make the WMI pack stop working or something?
[03:43pm] <rmatte> like, I don't fully understand what caused it or what could happen by removing it?
Just to add that this doesn't appear to be related to Egor's pack (my mistake). His pack doesn't define those zProperties. They are standard zProperties in Zenoss.
I figured out what caused this. I used Jane Curry's jc_batch_load script. There are places to specify zWinUser and zWinPassword, but I always leave those blank. The script doesn't check if there's a value specified and tries to set them at the device level with no value anyways.
The lines that cause the issue in the script are:
# Now for the bits from Scott's script - loadDevice doesn't handle Windows users / passwords...
d=dmd.Devices.findDevice(deviceName)
print "dmd device is ",d
d.zWinUser=zWinUser
d.zWinPassword=zWinPassword
I commented out the lines so that I don't run in to the same issue in the future.
Thanks to all those who helped me out with troubleshooting this.
Cheers.
This is the code that I ended up using in zendmd to resolve the issue:
for d in dmd.Devices.getSubDevices():
try:
d.__delattr__("zWinUser")
except:
pass
try:
d.__delattr__("zWinPassword")
except:
pass
commit()
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||