def restart_instances(self, request, queryset):
"""
Restart all transmitted PostgreSQL instances
Basicaly we just call for a fast stop followed by a start. Nothing
complicated here. Unlike stop, we don't skip stopped instances, and
unline start, we don't skip running ones.
"""
for inst in queryset:
try:
util = PGUtility(inst)
util.stop()
util.start()
except Exception, e:
self.message_user(request, "%s : %s" % (e, inst), messages.ERROR)
continue
self.message_user(request, "%s restarted!" % inst)
评论列表
文章目录