Skip to content

Commit

Permalink
use pool UUID instead of label in query
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmac committed Jun 25, 2024
1 parent 8efb7aa commit 26f2b99
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/control/cmd/daos/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,21 @@ func getPoolList(log logging.Logger, sysName string, queryEnabled bool) ([]*daos
if err != nil {
return nil, err
}
poolUUID, err := uuidFromC(cPool.mgpi_uuid)
if err != nil {
return nil, err
}

poolLabel := C.GoString(cPool.mgpi_label)

var pool *daos.PoolInfo
if queryEnabled {
var poolInfo C.daos_pool_info_t
var poolHandle C.daos_handle_t
if err := daosError(C.daos_pool_connect(cPool.mgpi_label, cSysName, C.DAOS_PC_RO,
cPoolUUID := C.CString(poolUUID.String())
defer freeString(cPoolUUID)

if err := daosError(C.daos_pool_connect(cPoolUUID, cSysName, C.DAOS_PC_RO,
&poolHandle, &poolInfo, nil)); err != nil {
log.Errorf("failed to connect to pool %q: %s", poolLabel, err)
continue
Expand All @@ -661,11 +669,6 @@ func getPoolList(log logging.Logger, sysName string, queryEnabled bool) ([]*daos
}
} else {
// Just populate the basic info.
poolUUID, err := uuidFromC(cPool.mgpi_uuid)
if err != nil {
return nil, err
}

pool = &daos.PoolInfo{
UUID: poolUUID,
Label: poolLabel,
Expand Down

0 comments on commit 26f2b99

Please sign in to comment.