rbd: only open the destination pool for import

Otherwise importing into another pool when the default pool, rbd,
doesn't exist results in an error trying to open the rbd pool.

Reported-by: Sébastien Han <han.sebastien@gmail.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2012-09-18 09:37:44 -07:00
parent 46883a5a0f
commit 4f3642c5f4

View File

@ -1343,7 +1343,7 @@ int main(int argc, const char **argv)
}
int r;
if (talk_to_cluster) {
if (talk_to_cluster && opt_cmd != OPT_IMPORT) {
r = rados.ioctx_create(poolname, io_ctx);
if (r < 0) {
cerr << "error opening pool " << poolname << ": " << cpp_strerror(-r) << std::endl;