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 306521 Details for
Bug 237266
ask for a fence script for Power server's HMC
[?]
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.
Fence agent for HMC / LPAR
fence_lpar.py (text/x-python), 2.40 KB, created by
Marek Grac
on 2008-05-23 16:56:25 UTC
(
hide
)
Description:
Fence agent for HMC / LPAR
Filename:
MIME Type:
Creator:
Marek Grac
Created:
2008-05-23 16:56:25 UTC
Size:
2.40 KB
patch
obsolete
>#!/usr/bin/python > >## >## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. >## >## The Following Agent Has Been Tested On: >## >## Version >## +---------------------------------------------+ >## Tested on HMC >## >##### > >import sys, re, pexpect >sys.path.append("@FENCEAGENTSLIBDIR@") >from fencing import * > >#BEGIN_VERSION_GENERATION >RELEASE_VERSION="" >REDHAT_COPYRIGHT="" >BUILD_DATE="" >#END_VERSION_GENERATION > >def get_power_status(conn, options): > try: > conn.send("lssyscfg -r lpar -m "+ options["-s"] +" --filter 'lpar_names=" + options["-n"] + "'\n") > conn.log_expect(options, options["-c"], SHELL_TIMEOUT) > except pexpect.EOF: > fail(EC_CONNECTION_LOST) > except pexpect.TIMEOUT: > fail(EC_TIMED_OUT) > > status = re.compile(",state=(.*?),", re.IGNORECASE).search(conn.before).group(1) > > ## > ## Transformation to standard ON/OFF status if possible > if status == "Running": > status = "on" > > if status == "Not Activated": > status = "off" > > return status > >def set_power_status(conn, options): > try: > if options["-o"] == "on": > conn.send("chsysstate -o on -r lpar -m " + options["-s"] + > " -n " + options["-n"] + > " -f `lssyscfg -r lpar -F curr_profile " + > " -m " + options["-s"] + > " --filter \"lpar_names="+ options["-n"] +"\"`\n" ) > else: > conn.send("chsysstate -o shutdown -r lpar --immed" + > " -m " + options["-s"] + " -n " + options["-n"] + "\n") > conn.log_expect(options, options["-c"], POWER_TIMEOUT) > except pexpect.EOF: > fail(EC_CONNECTION_LOST) > except pexpect.TIMEOUT: > fail(EC_TIMED_OUT) > >def main(): > device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", > "action", "ipaddr", "login", "passwd", "passwd_script", > "secure", "partition", "managed" ] > > options = check_input(device_opt, process_input(device_opt)) > > ## > ## Fence agent specific defaults > ##### > if 0 == options.has_key("-c"): > options["-c"] = ":~>" > > if 0 == options.has_key("-x"): > fail_usage("Failed: You have to use ssh connection (-x) to fence device") > > if 0 == options.has_key("-s"): > fail_usage("Failed: You have to enter name of managed system") > > if 0 == options.has_key("-n"): > fail_usage("Failed: You have to enter name of the partition") > > ## > ## Operate the fencing device > #### > conn = fence_login(options) > fence_action(conn, options, set_power_status, get_power_status) > > ## > ## Logout from system > ###### > conn.send("quit\r\n") > conn.close() > >if __name__ == "__main__": > main()
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 Raw
Actions:
View
Attachments on
bug 237266
: 306521 |
306522