Skip to content

Commit

Permalink
Add failover plugin auditing (#14146)
Browse files Browse the repository at this point in the history
This commit generates audit-trail for some HA-related configuration
changes.
  • Loading branch information
anodos325 authored Aug 7, 2024
1 parent 1d64d37 commit 5995885
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/middlewared/middlewared/plugins/failover.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def failover_extend(self, data):
('edit', {'name': 'master', 'method': lambda x: setattr(x, 'null', True)}),
('rm', {'name': 'id'}),
('attr', {'update': True}),
))
), audit='Failover config update')
async def do_update(self, data):
"""
Update failover state.
Expand Down Expand Up @@ -287,7 +287,7 @@ async def get_ips(self, app):
"""Get a list of IPs for which the webUI can be accessed."""
return await self.middleware.call('system.general.get_ui_urls')

@accepts()
@accepts(audit='Failover become passive')
@returns()
def become_passive(self):
"""
Expand Down Expand Up @@ -324,7 +324,7 @@ def become_passive(self):
# this shouldn't be reached but better safe than sorry
os.system('shutdown -r now')

@accepts(roles=['FAILOVER_WRITE'])
@accepts(roles=['FAILOVER_WRITE'], audit='Failover force master')
@returns(Bool())
async def force_master(self):
"""
Expand Down Expand Up @@ -678,7 +678,7 @@ def upgrade_version(self):
Str('train', empty=False),
Bool('resume', default=False),
Bool('resume_manual', default=False),
), roles=['FAILOVER_WRITE'])
), roles=['FAILOVER_WRITE'], audit='Failover upgrade')
@returns(Bool())
@job(lock='failover_upgrade', pipes=['input'], check_pipes=False)
def upgrade(self, job, options):
Expand Down

0 comments on commit 5995885

Please sign in to comment.