~marcoceppi/charms/precise/mysql/fix-metadata

« back to all changes in this revision

Viewing changes to hooks/shared-db-relations

  • Committer: Dave Walker (Daviey)
  • Author(s): Adam Gandelman
  • Date: 2012-10-29 19:43:25 UTC
  • mfrom: (82.1.1 mysql)
  • Revision ID: davewalker@ubuntu.com-20121029194325-kg5zss5mtqt8szb3
hooks/shared-db-relations: Avoid dig usage for reliable resolution via mDNS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  # it'll need a grant for a user connecting from 127.0.0.1
35
35
  local_hostname=$(hostname -f)
36
36
  if [[ $REMOTE_HOST != $local_hostname ]] ; then
37
 
    REMOTE_IP=$(dig +search +short $REMOTE_HOST)
 
37
    REMOTE_IP=$(python -c "import socket ; print socket.gethostbyname('$REMOTE_HOST')")
38
38
  else
39
39
    REMOTE_IP="127.0.0.1"
40
40
  fi