Bug 492294 - fence_apc: user outlet not supported - Connection timeout
fence_apc: user outlet not supported - Connection timeout
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Marek Grac
Cluster QE
Depends On:
  Show dependency treegraph
Reported: 2009-03-26 07:16 EDT by Gaetan QUENTIN
Modified: 2009-05-19 16:30 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-27 07:47:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gaetan QUENTIN 2009-03-26 07:16:39 EDT
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):


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)

Comment 1 Marek Grac 2009-03-27 07:47:22 EDT
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.