<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<div style="font-family: Tahoma; font-size: 10pt; ">Well I seem to have a working script using the fencing.py library, however I did have to make a few minor changes.</div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div style="font-family: Tahoma; font-size: 10pt; ">To the all_opt array I added two options as follows:-</div><div style="font-family: Tahoma; font-size: 10pt; "><div>        "session_url" : {</div><div>                "getopt" : "s:",</div><div>                "longopt" : "session-url",</div><div>                "help" : "-s, --session-url                  URL to connect to XenServer on.",</div><div>                "required" : "1",</div><div>                "shortdesc" : "The URL of the XenServer host.",</div><div>                "order" : 1},</div><div>        "uuid" : {</div><div>                "getopt" : "u:",</div><div>                "longopt" : "uuid",</div><div>                "help" : "-u, --uuid                  UUID of the VM to fence.",</div><div>                "required" : "1",</div><div>                "shortdesc" : "The UUID of the VM to fence.",</div><div>                "order" : 1}</div></div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div style="font-family: Tahoma; font-size: 10pt; ">Is this ok to be added to fencing.py, or should I be customising/appending this in my script?</div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div style="font-family: Tahoma; font-size: 10pt; ">Also the following line is preventing my "list" function from working:-</div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div><font class="Apple-style-span" face="Tahoma" size="2">if (options["-o"] == "list") and (0 == options["device_opt"].count("port")) and (0 == options["device_opt"].count("partition"))</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2">Not knowing the library well enough, I don't know what the above if statement is trying to catch. The result is my list action prints out "N/A". I have temporarily short circuited this statement (and'ing with 0 at the end) and it all works for me, so I just need to know what this is safeguarding to know what my version of the check should be. I would expect a count of zero "ports" and "partitions" in the options array when trying the "list" action... So I must be missing the point here.</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2">I just realised that no-one is going to be able to use the Red Hat version of my script on the google code site as I haven't included a fencing.py library with the above changes.... Lol, serves my right for late night coding.</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2">Some direction would be appreciated :)</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2">Thanks,<br>Matt.</font></div>                                     </body>
</html>