Skip to content

Commit

Permalink
Fix the force kwarg flag not declared in Volume::stop_vol_instance()
Browse files Browse the repository at this point in the history
Causing this stack:

Traceback (most recent call last):
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 1117, in do_action
    err = call_action(action)
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 1106, in call_action
    err = getattr(self, action)()
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 4485, in unprovision
    self.master_unprovision()
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 471, in _func
    func(self)
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 4490, in master_unprovision
    self.sub_set_action(STOP_GROUPS, "unprovision", xtags=set(["zone", "docker", "podman"]))
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 3539, in sub_set_action
    self.set_action(rsets, _type=_type, action=action, tags=tags, xtags=xtags)
  File "/usr/share/opensvc/opensvc/core/objects/svc.py", line 3629, in set_action
    rset.action(action, types=_type, tags=tags, xtags=xtags, xtypes=aborted)
  File "/usr/share/opensvc/opensvc/core/resourceset.py", line 330, in action
    resource.action(action)
  File "/usr/share/opensvc/opensvc/core/resource.py", line 462, in action
    self.do_action(action)
  File "/usr/share/opensvc/opensvc/core/resource.py", line 366, in do_action
    self.action_main(action)
  File "/usr/share/opensvc/opensvc/core/resource.py", line 335, in action_main
    getattr(self, action)()
  File "/usr/share/opensvc/opensvc/core/resource.py", line 1251, in unprovision
    self.pre_provision_stop()
  File "/usr/share/opensvc/opensvc/drivers/resource/volume/__init__.py", line 281, in pre_provision_stop
    self._stop(force=True)
  File "/usr/share/opensvc/opensvc/drivers/resource/volume/__init__.py", line 288, in _stop
    self.stop_vol_instance()
  File "/usr/share/opensvc/opensvc/drivers/resource/volume/__init__.py", line 306, in stop_vol_instance
    if self.volsvc.action("stop", options={"local": True, "leader": self.svc.options.leader, "force": force}) != 0:
NameError: name 'force' is not defined
  • Loading branch information
cvaroqui committed Dec 16, 2020
1 parent e84a491 commit e4b6fc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opensvc/drivers/resource/volume/__init__.py
Expand Up @@ -285,9 +285,9 @@ def stop(self):

def _stop(self, force=False):
self.uninstall_flag()
self.stop_vol_instance()
self.stop_vol_instance(force=force)

def stop_vol_instance(self):
def stop_vol_instance(self, force=False):
try:
self.volsvc
except ex.Error:
Expand Down

0 comments on commit e4b6fc0

Please sign in to comment.