code: def pool_exists(service, name):
      
      try:
          out = check_output(['rados', '--id', service, 'lspools'])
          if six.PY3:
              out = out.decode('UTF-8')
      except CalledProcessError:
          return False
  
      return name in out.split()
docs: Check to see if a RADOS pool already exists.