CEPH filesystem development
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@dreamhost.com>
To: Eric_YH_Chen@wistron.com
Cc: ceph-devel@vger.kernel.org, Chris_YT_Huang@wistron.com
Subject: Re: No function to list the pool in rados.py
Date: Fri, 02 Dec 2011 14:11:51 -0800	[thread overview]
Message-ID: <4ED94D27.8090101@dreamhost.com> (raw)
In-Reply-To: <8512670932FB654F81AF0FEF1BE6D49D8EB4D1@WHQBEMAIL1.whq.wistron>

On 12/01/2011 09:33 PM, Eric_YH_Chen@wistron.com wrote:
> Hi, ceph developments:
>
>    Could we add one more function in rados.py to list the pool?
>
>    I had already implemented the function. Thanks a lot!
>
> class Rados(object):
>      def list(self):
>          size = c_size_t(512)
>          while True:
>              c_names = create_string_buffer(size.value)
>              ret = self.librados.rados_pool_list(self.cluster,
> byref(c_names), size)
>              if ret>  size.value:
>                  size = ret
>              else:
>                  break
>          return filter(lambda name: name != '', c_names.raw.split('\0'))

Added in c883100448bb7e86b4f0d52a425e0d0a278c79a0 with a couple small 
changes to check that we're connected and keep the type of size c_size_t.

Next time if you could send a patch or github pull request it'd be 
easier to apply.

Thanks!
Josh

      reply	other threads:[~2011-12-02 22:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02  5:33 No function to list the pool in rados.py Eric_YH_Chen
2011-12-02 22:11 ` Josh Durgin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED94D27.8090101@dreamhost.com \
    --to=josh.durgin@dreamhost.com \
    --cc=Chris_YT_Huang@wistron.com \
    --cc=Eric_YH_Chen@wistron.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox