rgw: Adds passwd alternative to keystone admin token

http://tracker.ceph.com/issues/5374 Fixes #5374

This adds options parsing to have a user, password and tenant,
to be able to ask for a token.
This token is then used to authenticate against keystone, instead
of relying on the admin token.
Otherwise, you can still use the admin token to authenticate.
This doesn't change the existing behaviour.

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
rgw: Use keystone password to validate token too

Adds the alternative use of password, instead of admin token,
to validate tokens.

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
rgw: Use JSONFormatter to use keystone API

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
  fix the bug  ctypes.util.find_library to search for librados failed on Centos6.4.
  Signed-off-by: huangjun  <hjwsm1989@gmail.com>
ReplicatedPG::recover_backfill: update last_backfill to max() when backfill is complete

Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge remote-tracking branch 'upstream/next'
mon/OSDMonitor: fix signedness warning on poolid

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMonitor: always send pg creations after mapping

At some point in the dumpling cycle I separated the map stage from the
send stage.  We can send the creates any time we have a non-zero osdmap
epoch, and are in good shape as long as we do the map step after the
osdmap is loaded (hence the post_paxos_update).

Some background:

We originally introduced the map-but-don't send in a2fe0137, at which
point all was well because we only called it on ceph-mon startup.

Later, this turned into post_paxos_update in e635c478, at which point
it was now called by a running monitor.. but we didn't add in the
send_pg_creates().  This is where this bug stems from.

This particular path is responsible for the stalled test referenced in
bug #6673.

Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #786 from ceph/wip-6673

mon/PGMonitor: always send pg creations after mapping

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph-crush-location: new crush location hook

This generalizes the bit of code that builds a key=value pair list to
update an entity's CRUSH location.

Signed-off-by: Sage Weil <sage@inktank.com>
upstart, sysvinit: use ceph-crush-location hook

Instead of hard-coding a check in ceph.conf and some reasonable
defaults, defer this work to ceph-crush-location, and allow users to
specify their own hook with alternative logic.

This can be helpful in a nubmer of cases, like:

 - rack (or other) information included in hostname and easily parsed
   out by a hook
 - multiple types of devices in each host, resulting in 'parallel'
   crush trees (e.g., one for hdd, one for ssd)

Signed-off-by: Sage Weil <sage@inktank.com>
doc: fix formatting.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Merge pull request #779 from ceph/wip-crush-hook

upstart,sysvinit: allow 'osd crush location hook' script to determine osd crush position

Reviewed-by: Loic Dachary <loic@dachary.org>
doc: Fixed formatting. Fixed hyperlink.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
mon: OSDMonitor: fix some annoying whitespace

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: OSDMonitor: only allow an osd to boot iff it has the fsid on record

Fixes: #6605

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: OSDMonitor: fix comparison between signed and unsigned integer warning

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Revert "upstart, sysvinit: use ceph-crush-location hook"

This reverts commit 111a37efb19cb46a48d669bc9866c29b4015a889.
Revert "ceph-crush-location: new crush location hook"

This reverts commit fc49065d855cfd74cb861d294f3464dd616e82ee.

Merged to wrong branch; my bad!
ceph-crush-location: new crush location hook

This generalizes the bit of code that builds a key=value pair list to
update an entity's CRUSH location.

Signed-off-by: Sage Weil <sage@inktank.com>