euca_conf does not properly register new nodes

Bug #523897 reported by Stefan Bucur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eucalyptus
New
Undecided
Unassigned
eucalyptus (Ubuntu)
New
Undecided
Unassigned

Bug Description

When euca_conf --discover-nodes or --register-nodes adds a new node to the NODES list in eucalyptus.conf, the node will not be added if its name is a substring of a name of any previously added nodes.

The bug in the euca_conf shell script is here:

# NODES list
                if ! echo "${NODES}"|grep "${NEWNODE}" > /dev/null ; then
                        # node is not present: we need to add it
                        NODES="${NODES} $NEWNODE"
                        change_var_value $FILE NODES "${NODES}"
                fi

Here, grep will match any matching substring, *even if it does not form a full node name*.

The problem is significant in particular for IP addresses, when it is likely that one IP address to be the substring of another. In my case, it was: 10.0.10.1 and 10.0.10.10. After I added the node 10.0.10.10, euca_conf refused to register 10.0.10.1 in eucalyptus.conf, even if its output was successful.

A quick solution would be to add the "-w" parameter to grep, but I'm not yet sure it works in every situation (e.g. when ${NEWNODE} contains regexp language symbols).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.