Skip to content

Commit

Permalink
Fix possible failure during POST object_create with provision
Browse files Browse the repository at this point in the history
relay provision to command args '--provision' instead of thr.set_smon
  • Loading branch information
cgalibern committed Feb 11, 2021
1 parent 016c69a commit 5e1d7d9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions opensvc/daemon/handlers/object/create/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def action(self, nodename, thr=None, **kwargs):
cmd.append("--namespace="+options.namespace)
if options.restore:
cmd.append("--restore")
if options.provision:
cmd.append("--provision")
thr.log_request("create/update %s" % ",".join(paths), nodename, **kwargs)
proc = thr.service_command(None, cmd, stdout=PIPE, stderr=PIPE, stdin=json.dumps(options.data))
if options.sync:
Expand All @@ -119,7 +121,4 @@ def action(self, nodename, thr=None, **kwargs):
"status": 0,
"info": "started %s action %s" % (options.path, " ".join(cmd)),
}
if options.provision:
for path in paths:
thr.set_smon(path, global_expect="provisioned")
return result

0 comments on commit 5e1d7d9

Please sign in to comment.