summaryrefslogtreecommitdiff
path: root/heat/cmd
diff options
context:
space:
mode:
authorThomas Herve <therve@redhat.com>2016-04-13 14:38:59 +0200
committerThomas Herve <therve@redhat.com>2016-04-15 10:00:26 +0200
commit7977f9f2f324f8916433763132c6ee67213e6ed1 (patch)
tree5a95e783757e7249e5d317879216644cf9bc4789 /heat/cmd
parentc5cff9297811c3ac8573a9496aa8b99725a164f6 (diff)
downloadheat-7977f9f2f324f8916433763132c6ee67213e6ed1.tar.gz
Add command to reset one stack status
Adds a new heat-manage reset_stack_status to recover from specific crashes that leaves resources in progress. It removes resource hooks and stack locks as well. Closes-Bug: #1561214 Change-Id: I70fa5857c959bc5f1424d562ff8b7740331b5328
Diffstat (limited to 'heat/cmd')
-rw-r--r--heat/cmd/manage.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/heat/cmd/manage.py b/heat/cmd/manage.py
index b73fabb70..086a8a0c6 100644
--- a/heat/cmd/manage.py
+++ b/heat/cmd/manage.py
@@ -98,6 +98,18 @@ def do_resource_data_list():
print(print_format % (k, data[k]))
+def do_reset_stack_status():
+ print(_("Warning: this command is potentially destructive and only "
+ "intended to recover from specific crashes."))
+ print(_("It is advised to shutdown all Heat engines beforehand."))
+ print(_("Continue ? [y/N]"))
+ data = raw_input()
+ if not data.lower().startswith('y'):
+ return
+ ctxt = context.get_admin_context()
+ db_api.reset_stack_status(ctxt, CONF.command.stack_id)
+
+
def purge_deleted():
"""Remove database records that have been previously soft deleted."""
utils.purge_deleted(CONF.command.age, CONF.command.granularity)
@@ -157,6 +169,11 @@ def add_command_parsers(subparsers):
parser.add_argument('resource_id',
help=_('Stack resource id'))
+ parser = subparsers.add_parser('reset_stack_status')
+ parser.set_defaults(func=do_reset_stack_status)
+ parser.add_argument('stack_id',
+ help=_('Stack id'))
+
ServiceManageCommand.add_service_parsers(subparsers)
command_opt = cfg.SubCommandOpt('command',