Skip to content

Commit

Permalink
Fix the disk.zpool resources status not refreshed after a stop/start
Browse files Browse the repository at this point in the history
Drop the "zpool status" cache after zpool import and export.
  • Loading branch information
cvaroqui committed Dec 7, 2019
1 parent a2d9e64 commit 4f0f9c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/resDiskZpool.py
Expand Up @@ -8,7 +8,7 @@
import rcStatus
from lock import cmlock
from rcGlobalEnv import rcEnv
from rcUtilities import justcall, qcall, which, lazy, cache
from rcUtilities import justcall, qcall, which, lazy, cache, clear_cache
from rcZfs import zpool_devs, zpool_getprop, zpool_setprop
from converters import convert_duration

Expand Down Expand Up @@ -182,6 +182,7 @@ def do_start(self):
raise ex.excError("failed to import pool")
self.can_rollback = True
self.set_multihost()
clear_cache("zpool.status." + self.name)

def do_stop(self):
if not self.is_up():
Expand All @@ -192,6 +193,7 @@ def do_stop(self):
if ret != 0:
cmd = ["zpool", "export", "-f", self.name]
ret, out, err = self.vcall(cmd)
clear_cache("zpool.status." + self.name)
if ret != 0:
raise ex.excError

Expand Down

0 comments on commit 4f0f9c8

Please sign in to comment.