Re: [pywin32-bugs] Setting object values that are an object
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@sk...> - 2007-02-05 23:16:01
|
This mailing list is for bugs sent by the sourceforge bug tracker. Try the pyt...@py... address for general queries, where you will find some people with WMI experience. Unfortunately, I can't offer any clues to what might be going wrong in this case. Cheers, Mark > 1. I assume that what I have to do is create an instance of the > TargetLoginOptions class, fill that in, then set the LoginOptions > attribute of the Target class to what I just created: > > C = wmi.Get ("MSiSCSIInitiator_TargetLoginOptions") > opts = C.SpawnInstance_ () > opts.Username = taskfile.user_name > opts.Password = taskfile.password > opts.AuthType = 1 # CHAP > tp.LoginOptions = opts > tp.Login () > > I get a "generic error". From the behavior of the rest of the system, > it looks like the operation is attempted, but the outcome is as if the > LoginOptions had not been present. > > 2. Since the Login method has a set of inputs, one of which is > LoginOptions, I tried passing "opts" that way. > > The intuitively obvious syntax is: > tp.Login (LoginOptions = opts) > but that doesn't work. It looks like method invocation knows about > positional arguments but not keyword arguments. > > So I read an MSDN article that talks about constructing input > arguments. It translates to this: > > ip = wmi.Get ("MSiSCSIInitiator_TargetClass"). \ > Methods_ ("Login").inParameters.SpawnInstance_() > ip.LoginOptions = opts > tp.Login (ip) > > Same result: no luck (operation is attempted but it acts as if > LoginOptions was not present. > > I also tried changing the last line to: > tp.ExecMethod_ ("Login", ip) > > Almost the same result -- a "Generic Failure" exception, but this time > it appears that the operation was not actually attempted. > > Does anyone have any idea where I can go from here? > > paul > > > -------------------------------------------------------------- > ----------- > Using Tomcat but need to do more? Need to support web > services, security? > Get stuff done quickly with pre-integrated technology to make > your job easier. > Download IBM WebSphere Application Server v.1.0.1 based on > Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057& dat=121642 _______________________________________________ pywin32-bugs mailing list pyw...@li... https://lists.sourceforge.net/lists/listinfo/pywin32-bugs |