def _build_pool(conn, meter, path): pool = _util.lookup_pool_by_path(conn, path) if pool: logging.debug("Existing pool '%s' found for %s", pool.name(), path) pool.refresh(0) return pool name = _util.generate_name("boot-scratch", conn.storagePoolLookupByName) logging.debug("Building storage pool: path=%s name=%s", path, name) poolbuild = Storage.DirectoryPool(conn=conn, name=name, target_path=path) # Explicitly don't build? since if we are creating this directory # we probably don't have correct perms return poolbuild.install(meter=meter, create=True, build=False, autostart=True)
def _build_pool(conn, meter, path): pool = _util.lookup_pool_by_path(conn, path) if pool: logging.debug("Existing pool '%s' found for %s" % (pool.name(), path)) pool.refresh(0) return pool name = _util.generate_name("boot-scratch", conn.storagePoolLookupByName) logging.debug("Building storage pool: path=%s name=%s" % (path, name)) poolbuild = Storage.DirectoryPool(conn=conn, name=name, target_path=path) # Explicitly don't build? since if we are creating this directory # we probably don't have correct perms return poolbuild.install(meter=meter, create=True, build=False, autostart=True)