'Get admin password of an instance
Returns the admin password of an instance in the clear if private_key
is provided, returns the ciphered password otherwise.
Requires that openssl is installed and in the path
:param server: The :class:`Server` (or its ID) for which the admin
password is to be returned
:param private_key: The private key to decrypt password
(optional)
:returns: An instance of novaclient.base.StrWithMeta or
novaclient.base.BytesWithMeta or
novaclient.base.UnicodeWithMeta'

def get_password(self, server, private_key=None):

    (resp, body) = self.api.client.get(('/servers/%s/os-server-password' % base.getid(server)))
    ciphered_pw = (body.get('password', '') if body else '')
    if (private_key and ciphered_pw):
        try:
            ciphered_pw = crypto.decrypt_password(private_key, ciphered_pw)
        except Exception as exc:
            ciphered_pw = ('%sFailed    to    decrypt:\n%s' % (exc, ciphered_pw))
    return self.convert_into_with_meta(ciphered_pw, resp)
