Bug 492294 - fence_apc: user outlet not supported - Connection timeout
Summary: fence_apc: user outlet not supported - Connection timeout
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman
Version: 5.2.z
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Marek Grac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-26 11:16 UTC by Gaetan QUENTIN
Modified: 2009-05-19 20:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-27 11:47:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gaetan QUENTIN 2009-03-26 11:16:39 UTC
Description of problem:

When using fence_apc agent to controle an APC AP7921, we are obliged to use the dm user or the administrator user. When using outlets users - more secure because they see only the associated outlets - the script fails.

Version-Release number of selected component (if applicable):

cman-2.0.94-1.el

How reproducible:


Steps to Reproduce:
1.Declare outlet user in the powerswitch, enable it, and give him an outlet 
2.Use fence_apc :
/sbin/fence_apc2 -o on -a $IP -l $outletuser -p $outletuserpasswd -n $OutletNumber -v

  
Actual results:

Connection Timeout

Expected results:

...
     <ESC>- Main Menu, <ENTER>- Refresh
>Success: [Already] ON  / OFF


Additional info:

The reason is simple:

When the powerswitch show the list of Outlets, with user dm or administrator, we see the whole list:
     1- Outlet 1                 ON
     2- Outlet 2                 ON
...

fence_apc search for this expression in get_power_status:

status = re.compile("\s*"+options["-n"]+"-.*(ON|OFF)", re.IGNORECASE).search(result).group(1)

so it searchs for "$OutletNumber- ... ON|OFF"

It works if there is the whole list since this number is the outlet number too.
But when using the outlet user, list is not ordonned like that. For example:

1- Outlet 2                 ON
2- Outlet 4                 ON


We must change the regex like that:

status = re.compile("\s*"+"Outlet "+options["-n"]+".*(ON|OFF)", re.IGNORECASE).search(result).group(1)



Regards,
Gaetan.

Comment 1 Marek Grac 2009-03-27 11:47:22 UTC
I understand your problem but this is not a bug. Your patch can work for you but quite a lot of users uses aliases so there is no such thing as 'Outlet 2'. On APC these aliases does not have to be unique. Only unique number is one that we are parsing. 

Currently we are extending our fence agent to support option '-o list' which will show you 'outlet number -> alias' mapping. Then using conga you will be able to select proper outlet number much more easier.


Note You need to log in before you can comment on or make changes to this bug.