Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 913286 Details for
Bug 1114526
Add action 'list' for fence brocade
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
0001-fence_brocade-Support-action-list.patch (text/plain), 1.81 KB, created by
Marek Grac
on 2014-06-30 09:39:08 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Marek Grac
Created:
2014-06-30 09:39:08 UTC
Size:
1.81 KB
patch
obsolete
>From 368d5816e3b9457988bc9e869a1c3a5670ce2384 Mon Sep 17 00:00:00 2001 >From: Marek 'marx' Grac <mgrac@redhat.com> >Date: Mon, 30 Jun 2014 11:38:27 +0200 >Subject: [PATCH] fence_brocade: Support action 'list' > >--- > fence/agents/brocade/fence_brocade.py | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/fence/agents/brocade/fence_brocade.py b/fence/agents/brocade/fence_brocade.py >index f935280..13afd8e 100644 >--- a/fence/agents/brocade/fence_brocade.py >+++ b/fence/agents/brocade/fence_brocade.py >@@ -39,6 +39,24 @@ def set_power_status(conn, options): > conn.send_eol(action + " " + options["--plug"]) > conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"])) > >+def get_list(conn, options): >+ trunk_re = re.compile(r'Trunk Port', re.IGNORECASE) >+ slots_re = re.compile(r'Ports of Slot', re.IGNORECASE) >+ slots_number = [] >+ outlets = {} >+ >+ conn.send_eol("portcfgshow") >+ conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"])) >+ for line in str(conn.before).split("\n"): >+ if slots_re.search(line): >+ # remove "Ports of Slot 0 " = 4 >+ slots_number = line.split()[4:] >+ if trunk_re.search(line): >+ # remove "Trunk Port" = 2 >+ outlets = dict(outlets.items() + zip(slots_number, zip([""]*100, line.split()[2:]))) >+ >+ return outlets >+ > def main(): > device_opt = ["ipaddr", "login", "passwd", "cmd_prompt", "secure", "port", "fabric_fencing"] > >@@ -66,7 +84,7 @@ FC switch needs to be enabled. This can be done by running fence_brocade and spe > ## Operate the fencing device > #### > conn = fence_login(options) >- result = fence_action(conn, options, set_power_status, get_power_status, None) >+ result = fence_action(conn, options, set_power_status, get_power_status, get_list) > fence_logout(conn, "exit") > sys.exit(result) > >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1114526
: 913286