Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken fence_xenapi.py #559

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

peter-webbird
Copy link

Fix to make --uuid work (so that this is actually usable). Added missing --plug-separator option (to prevent error message). Added ability to bypass SSL Certificate verification using --ssl-insecure

Fix to make --uuid work (so that this is actually usable). Added missing --plug-separator option (to prevent error message). Added ability to bypass SSL Certificate verification using --ssl-insecure
@knet-jenkins
Copy link

knet-jenkins bot commented Sep 17, 2023

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/fence-agents/job/fence-agents-pipeline/job/PR-559/1/input

Copy link
Collaborator

@oalbrigt oalbrigt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of changes needed, and you need to run make xml-upload and add the updated metadata to the PR to avoid CI failing.

try:
# Create the XML RPC session to the specified URL.
session = XenAPI.Session(url)
session = XenAPI.Session(url, None, None, 0, 1, skipVerification)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session() doesnt appear to have a parameter for skipVerification:
https://github.com/ClusterLabs/fence-agents/blob/main/lib/XenAPI.py.py#L121

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the XenAPI library bundled in this repo is significantly outdated. The latest version from https://github.com/xapi-project/xen-api/blob/master/scripts/examples/python/XenAPI/XenAPI.py should be loaded instead.

def main():

device_opt = ["login", "passwd", "port", "no_login", "no_password", "session_url", "web"]
device_opt = ["login", "passwd", "port", "no_login", "no_password", "session_url", "web", "ssl", "uuid", "plug_separator"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plug_separator is included in "port" from fencing.py, so you can remove that and it's definition above.

uuid isnt neither either, as the fencing library sets it based on the --plug/-n parameter.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get it to work without these two parameters. Maybe I'm just testing it wrong? This way works for me and I have no way of validating other solutions, so someone else might need to take over this pull request (or just delete it if you prefer).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably need to update your systems fencing library (usually located in /usr/share/fence).

Update XenAPI to latest version from xapi-project/xen-api repo
@knet-jenkins
Copy link

knet-jenkins bot commented Sep 18, 2023

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/fence-agents/job/fence-agents-pipeline/job/PR-559/2/input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants