Cluster.visible_state not set correctly
jamesclarke opened this issue · comments
I believe that the following line contains a bug and will never be True
:
Line 10 in b7da355
since
pool.state.value
is of type str
and batch_models.PoolState.active
is of type <enum PoolState>
.
I think this line was meant to read:
if pool.state is batch_models.PoolState.active:
...
I discovered this when examining a Cluster
object in a REPL:
In [32]: cluster.visible_state
Out[32]: 'active'
In [33]: cluster.pool.state
Out[33]: <PoolState.active: 'active'>
In [34]: cluster.pool.allocation_state
Out[34]: <AllocationState.resizing: 'resizing'>
and think that the intended logic of the code was to have the following result:
In [32]: cluster.visible_state
Out[32]: 'resizing'
You are correct, that line will always be false. Thanks for reporting!